You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(46) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(5) |
Feb
|
Mar
(6) |
Apr
(2) |
May
(25) |
Jun
(2) |
Jul
(1) |
Aug
(5) |
Sep
(4) |
Oct
(7) |
Nov
|
Dec
(18) |
| 2003 |
Jan
(8) |
Feb
(1) |
Mar
(2) |
Apr
(4) |
May
(14) |
Jun
(32) |
Jul
(15) |
Aug
(23) |
Sep
(23) |
Oct
(22) |
Nov
(27) |
Dec
(24) |
| 2004 |
Jan
(18) |
Feb
(38) |
Mar
(32) |
Apr
(18) |
May
(70) |
Jun
(1) |
Jul
(21) |
Aug
(19) |
Sep
(32) |
Oct
(11) |
Nov
(11) |
Dec
(19) |
| 2005 |
Jan
(48) |
Feb
(13) |
Mar
(19) |
Apr
(25) |
May
(4) |
Jun
(23) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
(17) |
Nov
(4) |
Dec
(5) |
| 2006 |
Jan
(31) |
Feb
(30) |
Mar
(28) |
Apr
(11) |
May
(21) |
Jun
(7) |
Jul
(12) |
Aug
(5) |
Sep
(7) |
Oct
(24) |
Nov
(2) |
Dec
|
|
From: lawrence m. <we...@gm...> - 2003-11-09 19:19:57
|
What do people think of this change to erc's catalog handling.
It replaces the current mechanism of defining umpteen different
variables per catalog with defining one variable per catalog, a
hash-table containing all the entries and their format strings.
The only user-visible change is that erc-define-catalog is now a
macro, rather than a function, so its arguments no longer have
to be quoted. Should this be an undesirable backward
incompatibilty, it's easy to change.
Index: erc.el
===================================================================
RCS file: /cvsroot/erc/erc/erc.el,v
retrieving revision 1.584
diff -u -r1.584 erc.el
--- erc.el 9 Nov 2003 18:08:35 -0000 1.584
+++ erc.el 9 Nov 2003 19:08:31 -0000
@@ -6768,21 +6768,37 @@
;;; Message catalog
-(defun erc-make-message-variable-name (catalog entry)
- (intern (concat "erc-message-"
- (symbol-name catalog) "-" (symbol-name entry))))
+(defun erc-make-message-catalog-name (catalog)
+ (intern (format "erc-message-catalog-%s" catalog)))
+(defun erc-message-catalog (catalog)
+ (symbol-value (erc-make-message-catalog-name catalog)))
+
(defun erc-define-catalog-entry (catalog entry format-spec)
- (set (erc-make-message-variable-name catalog entry)
- format-spec))
+ "Define an ENTRY in an ERC CATALOG, as FORMAT-SPEC.
-(defun erc-define-catalog (catalog entries)
- (dolist (entry entries)
- (erc-define-catalog-entry catalog (car entry) (cdr entry))))
-
-(erc-define-catalog
- 'english
- '((bad-ping-response . "Unexpected PING response from %n (time %t)")
+See also `erc-define-catalog'."
+ (setq catalog (erc-message-catalog catalog))
+ (puthash entry format-spec catalog))
+
+(defmacro erc-define-catalog (catalog entries)
+ "Define an ERC message catalog.
+
+CATALOG should be the name of the language this catalog is in.
+ENTRIES should be an alist mapping symbols to format strings.
+
+This defines a new variable `erc-message-catalog-CATALOG', a
+hash-table, and populates it with ENTRIES."
+ `(progn
+ ,(or (boundp (erc-make-message-catalog-name catalog))
+ `(defvar ,(erc-make-message-catalog-name catalog)
+ (make-hash-table :test #'eql)
+ ,(format "ERC %s catalog." catalog)))
+ (dolist (entry ',entries)
+ (erc-define-catalog-entry ',catalog (car entry) (cdr entry)))))
+
+(erc-define-catalog english
+ ((bad-ping-response . "Unexpected PING response from %n (time %t)")
(bad-syntax . "Error occurred - incorrect usage?\n%c %u\n%d")
(incorrect-args . "Incorrect arguments. Usage:\n%c %u\n%d")
(cannot-find-file . "Cannot find file %f")
@@ -6856,16 +6872,20 @@
(format ": %s" reason)
"")))))
-
(defvar erc-current-message-catalog 'english)
(make-variable-buffer-local 'erc-current-message-catalog)
+
(defun erc-retrieve-catalog-entry (entry &optional catalog)
- (unless catalog (setq catalog erc-current-message-catalog))
- (let ((var (erc-make-message-variable-name catalog entry)))
- (if (boundp var)
- (symbol-value var)
- (when (boundp (erc-make-message-variable-name 'english entry))
- (symbol-value (erc-make-message-variable-name 'english entry))))))
+ "Retrieve ENTRY from an ERC CATALOG.
+
+If CATALOG is nil, it defaults to the value of
+`erc-current-message-catalog'.
+
+If CATALOG doesn't contain a value for ENTRY, the value of ENTRY in
+`erc-message-catalog-english' is used."
+ (or catalog (setq catalog erc-current-message-catalog))
+ (or (gethash entry (erc-message-catalog catalog)
+ (gethash entry (erc-message-catalog 'english)))))
(defun erc-format-message (msg &rest args)
(when (oddp (length args))
--
lawrence mitchell <we...@gm...>
|
|
From: Alex S. <al...@em...> - 2003-11-04 15:10:39
|
Mario Lang <ml...@de...> writes: > I think it should at least allow for a FORMAT-STRING to be a conscell and be used > for a BODY to be useful. We could use (command &rest args) where ARGS is either a SIMPLE-ANSWER or a BODY. A SIMPLE-ANSWER has the form FORMAT-STRING &rest FORMAT-ARGS. The only requirement for BODY is that it may not start with a string. How about that? > On the other hand, if someone wants to work on ctcp, I think it > would be much more desireable to split CTCP out of erc.el into > erc-ctcp.el. This would be `require'ed at almost all times, but it > would be great to have CTCP in one place, especially since it is > just an extention to IRC. Sure, splitting erc.el is always a good idea. Alex. -- http://www.emacswiki.org/alex/ There is no substitute for experience. |
|
From: Mario L. <ml...@de...> - 2003-11-03 23:02:28
|
lawrence mitchell <we...@gm...> writes: > I notice that most of ERC's CTCP handlers are defined almost > identically, so I wondered if it might be useful to create a > define-ctcp-handler. Here's a first stab at it. It only > handles simple cases at the moment, if people think it's worth > persuing I might make it try and handle complicated cases too. The current implementation does not look very useful for erc-dcc.el and erc-xdcc.el. > (defmacro define-erc-ctcp-handler (command format-string &rest format-args) > "Define an ERC CTCP handler for COMMAND. > > This creates functions and variables for dealing with CTCP requests > and responses. <nitpicking>We should at least say which variables...</nitpicking> > FORMAT-STRING should be a string containing the response to be sent, > it should contain as many format directives as there are FORMAT-ARGS." > (let* ((command-name (upcase (symbol-name command))) > (query-hook (intern (format "erc-ctcp-query-%s-hook" > command-name))) > (query (intern (format "erc-ctcp-query-%s" > command-name))) > (reply-hook (intern (format "erc-ctcp-reply-%s-hook" > command-name))) > (reply (intern (format "erc-ctcp-reply-%s" > command-name))) > (reply-msg (intern (format "CTCP-%s" command-name))) > (query-msg (format "%s %s" command format-string))) > `(progn > (defvar ,query-hook (list ,query)) > (defun ,query (proc nick login host to msg) > (unless erc-disable-ctcp-replies > (erc-send-ctcp-notice > nick (format ,query-msg ,@format-args))) > nil) > (defvar ,reply-hook (list ,reply)) > (defun ,reply (proc nick login host to msg) > (erc-display-message > nil 'notice nil > ',reply-msg > ?n nick ?m msg) > nil)))) > > Sample usage: > > (define-erc-ctcp-handler FNORD > "%s is a member of the FNORD society" (erc-current-nick)) > > This expands into: > > (progn > (defvar erc-ctcp-query-FNORD-hook > (list erc-ctcp-query-FNORD)) > (defun erc-ctcp-query-FNORD > (proc nick login host to msg) > (unless erc-disable-ctcp-replies > (erc-send-ctcp-notice nick > (format "FNORD %s is a member of the FNORD society" > (erc-current-nick)))) > nil) > (defvar erc-ctcp-reply-FNORD-hook > (list erc-ctcp-reply-FNORD)) > (defun erc-ctcp-reply-FNORD > (proc nick login host to msg) > (erc-display-message nil 'notice nil 'CTCP-FNORD 110 nick 109 msg) > nil)) I think it should at least allow for a FORMAT-STRING to be a conscell and be used for a BODY to be useful. On the other hand, if someone wants to work on ctcp, I think it would be much more desireable to split CTCP out of erc.el into erc-ctcp.el. This would be `require'ed at almost all times, but it would be great to have CTCP in one place, especially since it is just an extention to IRC. -- CYa, Mario | Debian Developer <URL:http://debian.org/> | Get my public key via finger ml...@db... | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44 |
|
From: lawrence m. <we...@gm...> - 2003-11-03 22:50:44
|
Gah! Test before posting :)
lawrence mitchell wrote:
[...]
> (defvar ,query-hook (list ,query))
^^^^^^
',query
[...]
> (defvar ,reply-hook (list ,reply))
^^^^^^
',reply
[...]
--
lawrence mitchell <we...@gm...>
|
|
From: lawrence m. <we...@gm...> - 2003-11-03 22:42:38
|
Since I'm meant to be doing proper work, I'm looking for ways to
procrastinate :).
I notice that most of ERC's CTCP handlers are defined almost
identically, so I wondered if it might be useful to create a
define-ctcp-handler. Here's a first stab at it. It only
handles simple cases at the moment, if people think it's worth
persuing I might make it try and handle complicated cases too.
(defmacro define-erc-ctcp-handler (command format-string &rest format-args)
"Define an ERC CTCP handler for COMMAND.
This creates functions and variables for dealing with CTCP requests
and responses.
FORMAT-STRING should be a string containing the response to be sent,
it should contain as many format directives as there are FORMAT-ARGS."
(let* ((command-name (upcase (symbol-name command)))
(query-hook (intern (format "erc-ctcp-query-%s-hook"
command-name)))
(query (intern (format "erc-ctcp-query-%s"
command-name)))
(reply-hook (intern (format "erc-ctcp-reply-%s-hook"
command-name)))
(reply (intern (format "erc-ctcp-reply-%s"
command-name)))
(reply-msg (intern (format "CTCP-%s" command-name)))
(query-msg (format "%s %s" command format-string)))
`(progn
(defvar ,query-hook (list ,query))
(defun ,query (proc nick login host to msg)
(unless erc-disable-ctcp-replies
(erc-send-ctcp-notice
nick (format ,query-msg ,@format-args)))
nil)
(defvar ,reply-hook (list ,reply))
(defun ,reply (proc nick login host to msg)
(erc-display-message
nil 'notice nil
',reply-msg
?n nick ?m msg)
nil))))
Sample usage:
(define-erc-ctcp-handler FNORD
"%s is a member of the FNORD society" (erc-current-nick))
This expands into:
(progn
(defvar erc-ctcp-query-FNORD-hook
(list erc-ctcp-query-FNORD))
(defun erc-ctcp-query-FNORD
(proc nick login host to msg)
(unless erc-disable-ctcp-replies
(erc-send-ctcp-notice nick
(format "FNORD %s is a member of the FNORD society"
(erc-current-nick))))
nil)
(defvar erc-ctcp-reply-FNORD-hook
(list erc-ctcp-reply-FNORD))
(defun erc-ctcp-reply-FNORD
(proc nick login host to msg)
(erc-display-message nil 'notice nil 'CTCP-FNORD 110 nick 109 msg)
nil))
--
lawrence mitchell <we...@gm...>
|
|
From: Jeremy Maitin-S. <jb...@at...> - 2003-10-29 02:59:02
|
As stated in the subject, I subscribe to the list, so there is no need to send personal replies. -- Jeremy Maitin-Shepard |
|
From: Sacha C. <sa...@fr...> - 2003-10-29 02:37:23
|
Jeremy Maitin-Shepard <jb...@at...> writes: > The attached patch adds the functionality needed to order nickname > completions such that the most recent speakers are listed first. Thanks! I'd been meaning to do this for ages now, but I hadn't gotten around to it. I'll take a look at the code this evening (~ 12 hours from now). -- Sacha Chua <sa...@fr...> - Ateneo CS faculty geekette interests: emacs, gnu/linux, wearables, teaching compsci http://sacha.free.net.ph/ |
|
From: Stephan S. <st...@gm...> - 2003-10-27 21:03:36
|
Hi. This patch is a proposal for /WHOIS. Most irc-servers have only limited information about users that are connected to an other server. So they do not know things like the away message oder the idle time. So far it is possible to use /WHOIS nick server to get the whois info about that nick from server but on most ircnets it should be possible to use /WHOIS nick nick to get the whois info from the server to which that user is connected. If erc-whois-from-other-server is set to non-nil /WHOIS nick will send /WHOIS nick nick instead of just /WHOIS nick. I have tested it on IRCnet (irc.uni-erlangen.de).. What do you think about it? (Now finaly in diff -u format :) diff -u erc.el.1.577 erc.el --- erc.el Mon Oct 27 20:28:55 2003 +++ erc.new Mon Oct 27 20:31:39 2003 @@ -2100,6 +2100,12 @@ :type '(repeat (cons (string :tag "Target") coding-system))) +(defcustom erc-whois-from-other-server nil + "If non-nil, \"/WHOIS <nick>\" should get the info from that user's +server." + :group 'erc + :type 'boolean) + (defun erc-coding-sytem-for-target (target) "Return the coding system or cons cell appropriate for TARGET. This is determined via `erc-encoding-coding-alist' or @@ -2692,9 +2698,10 @@ (defun erc-cmd-WHOIS (user &optional server) "Display whois information for USER." - (let ((send (if server - (format "WHOIS %s %s" user server) - (format "WHOIS %s" user)))) + (let ((send (cond (server (format "WHOIS %s %s" user server)) + (erc-whois-from-other-server + (format "WHOIS %s %s" user user)) + (t (format "WHOIS %s" user))))) (erc-log (format "cmd: %s" send)) (erc-send-command send) t)) -- Stephan Stahl |
|
From: Stephan S. <st...@is...> - 2003-10-27 07:05:04
|
On Sat, Oct 25, 2003 at 09:15:14AM +0200, Stephan Stahl wrote: > diff -c erc.el.1.576 erc.el Oh boy how stupid.. i should not code on weekends :). Next diff will really be -u format. Thanks for commiting. -- Stephan Stahl |
|
From: Mario L. <ml...@de...> - 2003-10-25 13:47:10
|
Stephan Stahl <st...@is...> writes: > I didn't like the fact that /dcc send leaves a buffer after it has > completed and what is worse that buffer has a modified state so each > time i wanted to kill it i had to comfirm the C-x C-k. This patch will > do it for me. Maybe its useful for others.. Thanks, applied. > $ diff -c erc-dcc.el.1.79 erc-dcc.el Coudl you please send future patches in diff -u format? -- CYa, Mario | Debian Developer <URL:http://debian.org/> | Get my public key via finger ml...@db... | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44 |
|
From: Stephan S. <st...@gm...> - 2003-10-25 07:15:43
|
Hi.
That typo prevents customizing of erc-modules to use erc-truncate.
Very good irc client btw :).
diff -c erc.el.1.576 erc.el
*** erc.el.1.576 Sat Oct 25 08:58:30 2003
--- erc.el Sat Oct 25 08:58:48 2003
***************
*** 1521,1527 ****
(const :tag "Automatic IRC Services handling" services)
(const :tag "Convert smileys to pretty icons" smiley)
(const :tag "Channel activity tracking" track)
! (const :tag "Truncate buffers to a certain size" tuncate)
(repeat :tag "Others" :inline t symbol))
:group 'erc)
--- 1521,1527 ----
(const :tag "Automatic IRC Services handling" services)
(const :tag "Convert smileys to pretty icons" smiley)
(const :tag "Channel activity tracking" track)
! (const :tag "Truncate buffers to a certain size" truncate)
(repeat :tag "Others" :inline t symbol))
:group 'erc)
--
Stephan Stahl
|
|
From: Stephan S. <st...@is...> - 2003-10-24 10:17:42
|
Hi.
I didn't like the fact that /dcc send leaves a buffer after it has
completed and what is worse that buffer has a modified state so each
time i wanted to kill it i had to comfirm the C-x C-k. This patch will
do it for me. Maybe its useful for others..
$ diff -c erc-dcc.el.1.79 erc-dcc.el
*** erc-dcc.el.1.79 Fri Oct 24 08:21:40 2003
--- erc-dcc.el Fri Oct 24 08:21:41 2003
***************
*** 714,719 ****
--- 714,721 ----
?f buffer-file-name
?s (number-to-string (- sent-marker (point-min))))
(setq erc-dcc-list (delete elt erc-dcc-list))
+ (set-buffer-modified-p nil)
+ (kill-buffer (current-buffer))
(delete-process proc))
((<= confirmed-marker sent-marker)
(while (and (< (- sent-marker confirmed-marker)
--
Stephan Stahl
|
|
From: lawrence m. <we...@gm...> - 2003-10-17 23:00:59
|
Having been bitten again by the "oops, using some silly speak erc module in the wrong channel" problem for the umpteenth time, I decided to do something about it. This patch adds a new optional argument to DEFINE-ERC-MODULE, LOCAL-P. If LOCAL-P is non-NIL, erc-FOO-mode will be created as a buffer-local variable. If this seems like a good idea, I'll commit it. Index: erc.el =================================================================== RCS file: /cvsroot/erc/erc/erc.el,v retrieving revision 1.576 diff -u -r1.576 erc.el --- erc.el 17 Oct 2003 07:55:35 -0000 1.576 +++ erc.el 17 Oct 2003 22:53:58 -0000 @@ -925,13 +925,16 @@ (defvar erc-dbuf nil) (make-variable-buffer-local 'erc-dbuf) -(defmacro define-erc-module (name alias doc enable-body disable-body) +(defmacro define-erc-module (name alias doc enable-body disable-body + &optional local-p) "Define a new minor mode using ERC conventions. Symbol NAME is the name of the module. Symbol ALIAS is the alias to use, or nil. DOC is the documentation string to use for the minor mode. ENABLE-BODY is a list of expressions used to enable the mode. DISABLE-BODY is a list of expressions used to disable the mode. +If LOCAL-P is non-nil, the mode will be created as a buffer-local +mode. Rather than a global one. This will define a minor mode called erc-NAME-mode, possibly an alias erc-ALIAS-mode, as well as the helper functions @@ -958,7 +961,7 @@ With arg, turn ERC %S mode on if and only if arg is positive. %s" name name doc) nil nil nil - :global t :group (quote ,group) + :global (not ,local-p) :group (quote ,group) (if ,mode (,enable) (,disable))) Note that I think this change doesn't work if one is using XEmacs, since ERC-DEFINE-MINOR-MODE in erc-compat doesn't deal with any possible keyword arguments. I think that this changed version does work though. Could XEmacsers test it? | (defmacro erc-define-minor-mode (mode doc &optional init-value lighter | keymap &rest body) | "Define a minor mode like in Emacs." | ;; Deal with at least /some/ keywords. | ;; the rest don't seem to be as important. | (let (keyw globalp group) | (while (keywordp (setq keyw (car body))) | (setq body (cdr body)) | (case keyw | (:global (setq globalp (pop body))) | (:group (setq group (pop body))) | (t (pop body)))) | `(progn | (if ,group | (defcustom ,mode ,init-value | "Non-nil if the corresponding mode is enabled." | :group ,group | :type 'boolean) | (defvar ,mode ,init-value | "Non-nil if the corresponding mode is enabled.")) | (unless ,globalp | (make-variable-buffer-local ',mode)) | (defun ,mode (&optional arg) | ,doc | (interactive) | (setq ,mode (if arg | (> (prefix-numeric-value arg) 0) | (not ,mode))) | ,@body | ,mode) | (add-minor-mode ,mode ,lighter ,keymap)))) -- lawrence mitchell <we...@gm...> |
|
From: Mario L. <ml...@de...> - 2003-10-17 07:58:03
|
Teemu Hukkanen <tjh...@ik...> writes: > lawrence mitchell <s01...@sm...> writes: > >> Does the following patch achieve similar functionality to what you'd >> envisaged? > > Yes, it does. OK, checked in. Thanks to you both. -- CYa, Mario |
|
From: Teemu H. <tjh...@ik...> - 2003-10-17 07:27:31
|
lawrence mitchell <s01...@sm...> writes: > This patch seems to be incorrect in some places, e.g. you do > > ((setq prop-list (cons (list hl-start j fg bg bold ul inv) > prop-list)) > > Which isn't valid elisp. I was trying not to touch the interpreting code, just make it optional. An error slipped in by mistake. > Also, your test for erc-interpret-mirc-color means that the > control chars don't get stripped out of the string, which is > annoying. Using mirc colour codes is annoying, and should be discouraged. Interpreting them achives a whole new level of annoyance. > Does the following patch achieve similar functionality to what you'd > envisaged? Yes, it does. |
|
From: lawrence m. <we...@gm...> - 2003-10-16 18:24:27
|
A while back, I posted a possible patch to erc-log.el to set the
coding-system correctly for log file writing. However, at the
time it never got applied.
If no-one has any objections, I'll apply a (slightly modified)
version of it:
Index: erc-log.el
===================================================================
RCS file: /cvsroot/erc/erc/erc-log.el,v
retrieving revision 1.7
diff -u -r1.7 erc-log.el
--- erc-log.el 15 Jul 2003 07:53:00 -0000 1.7
+++ erc-log.el 16 Oct 2003 18:18:35 -0000
@@ -46,6 +46,9 @@
;; (when (and (eq major-mode 'erc-mode)
;; (not (null buffer-file-name))) t))))
;;
+;; If you only want to save logs for some buffers, customise the
+;; variable `erc-enable-logging'.
+
;; How it works:
;;
;; If logging is enabled, at some point, `erc-save-buffer-in-logs'
@@ -83,20 +86,6 @@
;; A third possibility might be to fake lockfiles. However, this
;; might lead to problems if an emacs crashes, as the lockfile
;; would be left lying around.
-;;
-;; * Should one be able to enable logging on a per-buffer basis? I
-;; think yes, since often people don't want to log server buffers
-;; or dcc chats etc...
-;; This would also remove the need to overload the semantics of
-;; `erc-log-channels-directory'.
-;; If logging should be enabled on a per buffer basis, there are a
-;; number of different ways it could be implemented.
-;; ** A boolean variable, that is buffer local.
-;; ** A regexp that matches buffer names.
-;; ** A function that gets called with the buffer name (and possibly
-;; other useful variables) and figures out whether said buffer
-;; should be logged.
-;; ** A combination of all of the above.
;;; Code:
@@ -164,6 +153,13 @@
:group 'erc-log
:type 'boolean)
+(defcustom erc-log-file-coding-system 'emacs-mule
+ "*The coding system ERC should use for writing log files.
+
+This should ideally, be a \"catch-all\" coding system, like
+`emacs-mule', or `iso-2022-7bit'."
+ :group 'erc-log)
+
(defconst erc-w32-invalid-file-characters
(if (memq system-type '(windows-nt ms-dos cygwin))
(let ((regexp file-name-invalid-regexp))
@@ -213,8 +209,8 @@
(add-hook 'erc-quit-hook
'erc-conditional-save-queries)
(add-hook 'erc-part-hook
- 'erc-conditional-save-buffer
-)
+ 'erc-conditional-save-buffer)
+
;;;functionality referenced from erc.el
(defun erc-log-setup-logging ()
"Setup the buffer-local logging variables in the current buffer.
@@ -328,7 +324,8 @@
(interactive)
(or buffer (setq buffer (current-buffer)))
(when (erc-logging-enabled buffer)
- (let ((file (erc-current-logfile buffer)))
+ (let ((file (erc-current-logfile buffer))
+ (coding-system-for-write erc-log-file-coding-system))
(with-current-buffer buffer
(save-restriction
(widen)
--
lawrence mitchell <we...@gm...>
|
|
From: lawrence m. <we...@gm...> - 2003-10-16 18:09:39
|
Teemu Hukkanen wrote:
> I was pretty impressed with erc when I tried it recently, I've been
> hooked ever since. After I started ReadingTheWiki, that is. The utter
> lack of documentation was the only obstacle with erc. Sure, the source
> is documented, but I just wanted to use the program. There is a lot of
> information in the wiki, but it doesn't come with the program.
Help appreciated :).
> After some experimentation with charsets all was good, until someone
> used mIRC escape codes on a channel I was on. The result of that is this
> small patch.
This patch seems to be incorrect in some places, e.g. you do
((setq prop-list (cons (list hl-start j fg bg bold ul inv)
prop-list))
Which isn't valid elisp.
Also, your test for erc-interpret-mirc-color means that the
control chars don't get stripped out of the string, which is
annoying. Does the following patch achieve similar
functionality to what you'd envisaged?
Alex, the original change was only a few lines, so papers aren't
needed, are they?
Index: erc.el
===================================================================
RCS file: /cvsroot/erc/erc/erc.el,v
retrieving revision 1.574
diff -u -r1.574 erc.el
--- erc.el 15 Oct 2003 17:15:31 -0000 1.574
+++ erc.el 16 Oct 2003 18:03:37 -0000
@@ -327,6 +327,11 @@
channels, or in an emergency (message flood) it can be turned off to
save processing time.")
+(defcustom erc-interpret-mirc-color nil
+ "*If non-nil, erc will interpret mIRC color codes."
+ :group 'erc
+ :type 'boolean)
+
(defcustom erc-use-info-buffers nil
"*If non-nil, erc will open INFO buffers.
INFO buffers contain information about channels members."
@@ -3370,9 +3375,10 @@
;; bg nil
)
(let ((ccode (substring (car parts) 1)))
- (if (string-match
- "^\\([0-9]\\([0-9]\\)?\\(,[0-9]\\([0-9]\\)?\\)?\\)"
- ccode)
+ (if (and erc-interpret-mirc-color
+ (string-match
+ "^\\([0-9]\\([0-9]\\)?\\(,[0-9]\\([0-9]\\)?\\)?\\)"
+ ccode))
(let ((cspec (match-string 1 ccode)))
(cond ((string-match "^\\([0-9]+\\),\\([0-9]+\\)" cspec)
(setq fg (string-to-number
--
lawrence mitchell <we...@gm...>
|
|
From: lawrence m. <we...@gm...> - 2003-10-15 17:17:20
|
lawrence mitchell wrote: > DEFINE-ERC-MODULE seems to incorrectly not set erc-foo-mode in > erc-foo-enable and erc-foo-disable. This leads to incorrect > results if one does, say, erc-foo-enable, and then erc-foo-mode, > hoping to turn foo-mode off. > Unless anyone has any objections, I'll apply this patch: [...] I've now committed this. -- lawrence mitchell <we...@gm...> |
|
From: lawrence m. <we...@gm...> - 2003-10-14 16:09:41
|
DEFINE-ERC-MODULE seems to incorrectly not set erc-foo-mode in
erc-foo-enable and erc-foo-disable. This leads to incorrect
results if one does, say, erc-foo-enable, and then erc-foo-mode,
hoping to turn foo-mode off.
Unless anyone has any objections, I'll apply this patch:
Index: erc.el
===================================================================
RCS file: /cvsroot/erc/erc/erc.el,v
retrieving revision 1.573
diff -u -r1.573 erc.el
--- erc.el 10 Oct 2003 00:07:09 -0000 1.573
+++ erc.el 14 Oct 2003 16:07:36 -0000
@@ -962,12 +962,14 @@
name)
(interactive)
(add-to-list 'erc-modules (quote ,name))
+ (setq ,mode t)
,@enable-body)
(defun ,disable ()
,(format "Disable ERC %S mode."
name)
(interactive)
(setq erc-modules (delq (quote ,name) erc-modules))
+ (setq ,mode nil)
,@disable-body)
,(when (and alias (not (eq name alias)))
`(defalias
--
lawrence mitchell <we...@gm...>
|
|
From: Eric M. L. <er...@si...> - 2003-10-03 13:13:20
|
>>> Mario Lang <ml...@de...> seems to think that:
>"Eric M. Ludlam" <er...@si...> writes:
>
>> Here is a patch for erc speedbar (CVS). I suspect that the first time
>> I sent this source forge rejected my mail.
>Something seems to be strange with what you sent:
>
>patching file erc-speedbar.el
>patch: pch.c:1196: another_hunk: Assertion `p_prefix_context != -1 && p_suffix_c
>ontext != -1' failed.
>
>Is what I get when executing
>patch -p0 <sb.patch
Hmm, that is an odd error. Perhaps my sig was still attached to the
bottom of the patch? I'll remove it from this email. I created the
patch using (as I'm sure you might guess) Emacs and `vc-diff'. Here is
the file as it sits on my disk to avoid future problems.
Someone who better knows this file may want to run `checkdoc' on it,
and try to fix up the documentation strings. I made up a few doc
strings, but I don't know the deeper secrets of the erc specific routines.
Enjoy
Eric
------
;; TODO / ideas:
;;
;; * Write intelligent update function:
;; update-channel, update-nick, remove-nick-from-channel, ...
;; * Use indicator-strings for op/voice
;; * Extract/convert face notes field from bbdb if available and show it using sb-image.el
;;
(require 'erc)
(require 'speedbar)
(require 'dframe)
(defvar erc-speedbar-key-map nil
"Keymap used when in the erc display mode.")
(defun erc-install-speedbar-variables ()
"Install those variables used by speedbar to enhance ERC."
(if erc-speedbar-key-map
nil
(setq erc-speedbar-key-map (speedbar-make-specialized-keymap))
;; Basic tree features
(define-key erc-speedbar-key-map "e" 'speedbar-edit-line)
(define-key erc-speedbar-key-map "\C-m" 'speedbar-edit-line)
(define-key erc-speedbar-key-map "+" 'speedbar-expand-line)
(define-key erc-speedbar-key-map "=" 'speedbar-expand-line)
(define-key erc-speedbar-key-map "-" 'speedbar-contract-line)
)
(speedbar-add-expansion-list '("ERC" erc-speedbar-menu-items
erc-speedbar-key-map
erc-speedbar-server-buttons))
(speedbar-add-mode-functions-list
'("ERC" (speedbar-item-info . erc-speedbar-item-info)))
)
(defvar erc-speedbar-menu-items
'(["Goto buffer" speedbar-edit-line t]
["Expand Node" speedbar-expand-line
(save-excursion (beginning-of-line)
(looking-at "[0-9]+: *.\\+. "))]
["Contract Node" speedbar-contract-line
(save-excursion (beginning-of-line)
(looking-at "[0-9]+: *.-. "))]
)
"Additional menu-items to add to speedbar frame.")
;; Make sure our special speedbar major mode is loaded
(if (featurep 'speedbar)
(erc-install-speedbar-variables)
(add-hook 'speedbar-load-hook 'erc-install-speedbar-variables))
;;; ERC hierarchy display method
;;;###autoload
(defun erc-speedbar-browser ()
"Initialize speedbar to display an ERC browser.
This will add a speedbar major display mode."
(interactive)
(require 'speedbar)
;; Make sure that speedbar is active
(speedbar-frame-mode 1)
;; Now, throw us into Info mode on speedbar.
(speedbar-change-initial-expansion-list "ERC")
(speedbar-get-focus))
(defun erc-speedbar-buttons (buffer)
"Create buttons for speedbar in BUFFER."
(erase-buffer)
(let (serverp chanp)
(with-current-buffer buffer
(setq serverp (eq buffer (process-buffer erc-process)))
(setq chanp (erc-channel-p (erc-default-target))))
(cond (serverp
(erc-speedbar-channel-buttons nil 0 buffer))
(chanp
(erc-speedbar-insert-target buffer 0)
(forward-line -1)
(erc-speedbar-expand-channel "+" buffer 0))
(t (error "Not sure, this should never happen")))))
(defun erc-speedbar-server-buttons (directory depth)
"Insert the initial list of servers you are connected to."
(let ((servers (erc-buffer-list (lambda ()
(eq (current-buffer)
(process-buffer erc-process))))))
(when servers
(speedbar-with-writable
(dolist (server servers)
(speedbar-make-tag-line
'bracket ?+ 'erc-speedbar-expand-server server
(buffer-name server) 'erc-speedbar-goto-buffer server nil
depth))
t))))
(defun erc-speedbar-expand-server (text server indent)
(cond ((string-match "+" text)
(speedbar-change-expand-button-char ?-)
(if (speedbar-with-writable
(save-excursion
(end-of-line) (forward-char 1)
(erc-speedbar-channel-buttons nil (1+ indent) server)))
(speedbar-change-expand-button-char ?-)
(speedbar-change-expand-button-char ??)))
((string-match "-" text) ;we have to contract this node
(speedbar-change-expand-button-char ?+)
(speedbar-delete-subblock indent))
(t (error "Ooops... not sure what to do")))
(speedbar-center-buffer-smartly))
(defun erc-speedbar-channel-buttons (directory depth server-buffer)
(when (get-buffer server-buffer)
(let* ((proc (with-current-buffer server-buffer erc-process))
(targets (erc-buffer-list (lambda ()
(not (eq (process-buffer erc-process)
(current-buffer))))
proc)))
(when targets
(speedbar-with-writable
(dolist (target targets)
(erc-speedbar-insert-target target depth))
t)))))
(defun erc-speedbar-insert-target (buffer depth)
(if (with-current-buffer buffer
(erc-channel-p (erc-default-target)))
(speedbar-make-tag-line
'bracket ?+ 'erc-speedbar-expand-channel buffer
(buffer-name buffer) 'erc-speedbar-goto-buffer buffer nil
depth)
;; Query target
(speedbar-make-tag-line
nil nil nil nil
(buffer-name buffer) 'erc-speedbar-goto-buffer buffer nil
depth)))
(defun erc-speedbar-sort-channel-members (members)
"Return a list of channel MEMBERS sorted by who is active."
(let ((sort-fold-search t))
(sort (copy-sequence members)
(lambda (a b)
(cond ((and (nth 4 a) (not (nth 4 b)))
t)
((and (not (nth 4 a)) (nth 4 b))
nil)
(t
(string< (car a) (car b)))))
)))
(defun erc-speedbar-expand-channel (text channel indent)
"For the line matching TEXT, in CHANNEL, expand or contract a line.
INDENT is the current indentation level."
(cond ((string-match "+" text)
(speedbar-change-expand-button-char ?-)
(speedbar-with-writable
(save-excursion
(end-of-line) (forward-char 1)
(let ((modes (with-current-buffer channel
(mapconcat 'identity channel-modes "")))
(topic (erc-interpret-controls
(with-current-buffer channel channel-topic))))
(speedbar-make-tag-line
'angle ?i nil nil
(concat "Modes: +" modes) nil nil nil
(1+ indent))
(when (not (string= topic ""))
(speedbar-make-tag-line
'angle ?i nil nil
(concat "Topic: " topic) nil nil nil
(1+ indent)))
(let ((names
(erc-speedbar-sort-channel-members
(with-current-buffer channel channel-members))))
(when names
(speedbar-with-writable
(dolist (entry names)
(erc-speedbar-insert-user entry ?+ (1+ indent)))))))))
)
((string-match "-" text)
(speedbar-change-expand-button-char ?+)
(speedbar-delete-subblock indent))
(t (error "Ooops... not sure what to do")))
(speedbar-center-buffer-smartly))
(defun erc-speedbar-insert-user (entry exp-char indent)
"Insert one user based on the channel member list ENTRY.
EXP-CHAR is the expansion character to use.
INDENT is the current indentation level."
(let* ((op (nth 1 entry))
(voice (nth 2 entry))
(nick (nth 0 entry))
(nick-str (concat (if op "@" "") (if voice "+" "") nick))
(host (nth 3 entry))
(user (nth 4 entry))
(finger (concat user (when (or user host) "@") host))
(name (nth 5 entry))
(info (nth 6 entry))
(sbtoken (list finger name info)))
(if (or user host name info) ; we want to be expandable
(progn
(speedbar-make-tag-line
'bracket ?+ 'erc-speedbar-expand-user sbtoken
nick-str nil sbtoken nil
indent)
(when (equal exp-char ?-)
(forward-line -1)
(erc-speedbar-expand-user "+" (list finger name info) indent)))
(speedbar-make-tag-line
'statictag ?? nil nil
nick-str nil nil nil
indent))))
(defun erc-speedbar-update-channel (buffer)
"Update the speedbar information about a ERC buffer. The update
is only done when the channel is acutally expanded already."
;; This is only a rude hack and doesnt care about multiserver usage
;; yet, consider this a brain storming, better ideas?
(with-current-buffer speedbar-buffer
(save-excursion
(goto-char (point-min))
(when (re-search-forward (concat "^1: *.+. *"
(regexp-quote (buffer-name buffer)))
nil t)
(beginning-of-line)
(speedbar-delete-subblock 1)
(erc-speedbar-expand-channel "+" buffer 1)))))
(defun erc-speedbar-expand-user (text token indent)
(cond ((string-match "+" text)
(speedbar-change-expand-button-char ?-)
(speedbar-with-writable
(save-excursion
(end-of-line) (forward-char 1)
(let ((finger (nth 0 token))
(name (nth 1 token))
(info (nth 2 token)))
(when finger
(speedbar-make-tag-line
nil nil nil nil
finger nil nil nil
(1+ indent)))
(when name
(speedbar-make-tag-line
nil nil nil nil
name nil nil nil
(1+ indent)))
(when info
(speedbar-make-tag-line
nil nil nil nil
info nil nil nil
(1+ indent)))))))
((string-match "-" text)
(speedbar-change-expand-button-char ?+)
(speedbar-delete-subblock indent))
(t (error "Ooops... not sure what to do")))
(speedbar-center-buffer-smartly))
(defun erc-speedbar-goto-buffer (text buffer indent)
"When user clicks on TEXT, goto an ERC buffer.
The INDENT level is ignored."
(require 'dframe)
(dframe-select-attached-frame speedbar-frame)
(let ((bwin (get-buffer-window buffer 0)))
(if bwin
(progn
(select-window bwin)
(raise-frame (window-frame bwin)))
(if dframe-power-click
(let ((pop-up-frames t)) (select-window (display-buffer buffer)))
(dframe-select-attached-frame speedbar-frame)
(switch-to-buffer buffer)))))
(defun erc-speedbar-line-text ()
"Return the text for the item on the current line."
(beginning-of-line)
(when (re-search-forward "[]>] " nil t)
(buffer-substring-no-properties (point) (point-at-eol))))
(defun erc-speedbar-item-info ()
"Display informatin about the current buffer on the current line."
(let ((data (speedbar-line-token))
(txt (erc-speedbar-line-text)))
(cond ((and data (listp data))
(message "%s: %s" txt (car data)))
((bufferp data)
(message "Channel: %s" txt))
(t
(message "%s" txt))))
)
(provide 'erc-speedbar)
;;; erc-speedbar.el ends here
|
|
From: Mario L. <ml...@de...> - 2003-10-03 08:33:56
|
"Eric M. Ludlam" <er...@si...> writes: > Here is a patch for erc speedbar (CVS). I suspect that the first time > I sent this source forge rejected my mail. Something seems to be strange with what you sent: patching file erc-speedbar.el patch: pch.c:1196: another_hunk: Assertion `p_prefix_context != -1 && p_suffix_c ontext != -1' failed. Is what I get when executing patch -p0 <sb.patch -- CYa, Mario | Debian Developer <URL:http://debian.org/> | Get my public key via finger ml...@db... | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44 |
|
From: Eric M. L. <er...@si...> - 2003-10-02 17:44:03
|
Here is a patch for erc speedbar (CVS). I suspect that the first time
I sent this source forge rejected my mail.
Basically, I did what I could to make it appear useful. I hadn't used
ERC or IRC before hacking this patch, so I don't know if it really is
useful or not. Based on the list list of ERC supported commands, I
can certainly imagine many ways to improve it.
Enjoy
Eric
-------
(erc-install-speedbar-variables): Add functions list (needs new speedbar?)
(erc-speedbar-buttons): Add doc. Clear the buffer
(erc-speedbar-sort-channel-members): New function.
(erc-speedbar-expand-channel): Call new sort function. Change some visuals.
(erc-speedbar-insert-user): Change some visuals based on channel data.
(erc-speedbar-line-text, erc-speedbar-item-info): New functions
------
*** erc-speedbar.el.~1.10.~ Mon Nov 18 20:08:47 2002
--- erc-speedbar.el Fri Sep 26 21:29:04 2003
***************
*** 29,35 ****
(speedbar-add-expansion-list '("ERC" erc-speedbar-menu-items
erc-speedbar-key-map
! erc-speedbar-server-buttons)))
(defvar erc-speedbar-menu-items
'(["Goto buffer" speedbar-edit-line t]
--- 29,38 ----
(speedbar-add-expansion-list '("ERC" erc-speedbar-menu-items
erc-speedbar-key-map
! erc-speedbar-server-buttons))
! (speedbar-add-mode-functions-list
! '("ERC" (speedbar-item-info . erc-speedbar-item-info)))
! )
(defvar erc-speedbar-menu-items
'(["Goto buffer" speedbar-edit-line t]
***************
*** 61,66 ****
--- 64,71 ----
(speedbar-get-focus))
(defun erc-speedbar-buttons (buffer)
+ "Create buttons for speedbar in BUFFER."
+ (erase-buffer)
(let (serverp chanp)
(with-current-buffer buffer
(setq serverp (eq buffer (process-buffer erc-process)))
***************
*** 71,77 ****
(erc-speedbar-insert-target buffer 0)
(forward-line -1)
(erc-speedbar-expand-channel "+" buffer 0))
! (t (error "Not sure, this should never happen.")))))
(defun erc-speedbar-server-buttons (directory depth)
--- 76,82 ----
(erc-speedbar-insert-target buffer 0)
(forward-line -1)
(erc-speedbar-expand-channel "+" buffer 0))
! (t (error "Not sure, this should never happen")))))
(defun erc-speedbar-server-buttons (directory depth)
***************
*** 129,135 ****
--- 134,155 ----
(buffer-name buffer) 'erc-speedbar-goto-buffer buffer nil
depth)))
+ (defun erc-speedbar-sort-channel-members (members)
+ "Return a list of channel MEMBERS sorted by who is active."
+ (let ((sort-fold-search t))
+ (sort (copy-sequence members)
+ (lambda (a b)
+ (cond ((and (nth 4 a) (not (nth 4 b)))
+ t)
+ ((and (not (nth 4 a)) (nth 4 b))
+ nil)
+ (t
+ (string< (car a) (car b)))))
+ )))
+
(defun erc-speedbar-expand-channel (text channel indent)
+ "For the line matching TEXT, in CHANNEL, expand or contract a line.
+ INDENT is the current indentation level."
(cond ((string-match "+" text)
(speedbar-change-expand-button-char ?-)
(speedbar-with-writable
***************
*** 140,154 ****
(topic (erc-interpret-controls
(with-current-buffer channel channel-topic))))
(speedbar-make-tag-line
! nil nil nil nil
(concat "Modes: +" modes) nil nil nil
(1+ indent))
(when (not (string= topic ""))
(speedbar-make-tag-line
! nil nil nil nil
(concat "Topic: " topic) nil nil nil
(1+ indent)))
! (let ((names (with-current-buffer channel channel-members)))
(when names
(speedbar-with-writable
(dolist (entry names)
--- 160,176 ----
(topic (erc-interpret-controls
(with-current-buffer channel channel-topic))))
(speedbar-make-tag-line
! 'angle ?i nil nil
(concat "Modes: +" modes) nil nil nil
(1+ indent))
(when (not (string= topic ""))
(speedbar-make-tag-line
! 'angle ?i nil nil
(concat "Topic: " topic) nil nil nil
(1+ indent)))
! (let ((names
! (erc-speedbar-sort-channel-members
! (with-current-buffer channel channel-members))))
(when names
(speedbar-with-writable
(dolist (entry names)
***************
*** 161,166 ****
--- 183,191 ----
(speedbar-center-buffer-smartly))
(defun erc-speedbar-insert-user (entry exp-char indent)
+ "Insert one user based on the channel member list ENTRY.
+ EXP-CHAR is the expansion character to use.
+ INDENT is the current indentation level."
(let* ((op (nth 1 entry))
(voice (nth 2 entry))
(nick (nth 0 entry))
***************
*** 169,186 ****
(user (nth 4 entry))
(finger (concat user (when (or user host) "@") host))
(name (nth 5 entry))
! (info (nth 6 entry)))
(if (or user host name info) ; we want to be expandable
(progn
(speedbar-make-tag-line
! 'bracket ?+ 'erc-speedbar-expand-user (list finger name info)
! nick-str nil nil nil
indent)
(when (equal exp-char ?-)
(forward-line -1)
(erc-speedbar-expand-user "+" (list finger name info) indent)))
(speedbar-make-tag-line
! nil nil nil nil
nick-str nil nil nil
indent))))
--- 194,212 ----
(user (nth 4 entry))
(finger (concat user (when (or user host) "@") host))
(name (nth 5 entry))
! (info (nth 6 entry))
! (sbtoken (list finger name info)))
(if (or user host name info) ; we want to be expandable
(progn
(speedbar-make-tag-line
! 'bracket ?+ 'erc-speedbar-expand-user sbtoken
! nick-str nil sbtoken nil
indent)
(when (equal exp-char ?-)
(forward-line -1)
(erc-speedbar-expand-user "+" (list finger name info) indent)))
(speedbar-make-tag-line
! 'statictag ?? nil nil
nick-str nil nil nil
indent))))
***************
*** 244,249 ****
--- 270,292 ----
(dframe-select-attached-frame speedbar-frame)
(switch-to-buffer buffer)))))
+ (defun erc-speedbar-line-text ()
+ "Return the text for the item on the current line."
+ (beginning-of-line)
+ (when (re-search-forward "[]>] " nil t)
+ (buffer-substring-no-properties (point) (point-at-eol))))
+
+ (defun erc-speedbar-item-info ()
+ "Display informatin about the current buffer on the current line."
+ (let ((data (speedbar-line-token))
+ (txt (erc-speedbar-line-text)))
+ (cond ((and data (listp data))
+ (message "%s: %s" txt (car data)))
+ ((bufferp data)
+ (message "Channel: %s" txt))
+ (t
+ (message "%s" txt))))
+ )
(provide 'erc-speedbar)
--
Eric Ludlam: za...@gn..., er...@si...
Home: http://www.ludlam.net Siege: www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: www.gnu.org
|
|
From: lawrence m. <we...@gm...> - 2003-10-02 14:06:52
|
Mario Lang wrote: > lawrence mitchell <we...@gm...> writes: [...] >> Do we support Emacs 20? > No, we don't. We are using some functions which do not exist > in Emacs 20, but I forgot which... right, I've now committed an ERC-REPLACE-REGEXP-IN-STRING to erc-compat.el, on Emacs it's just an alias for REPLACE-REGEXP-IN-STRING. I've also replaced all (two) occurances of REPLACE-REGEXP-IN-STRING with the new version. -- lawrence mitchell <we...@gm...> |
|
From: Mario L. <ml...@de...> - 2003-09-30 07:37:59
|
lawrence mitchell <we...@gm...> writes: > Alex Schroeder wrote: > > [...] > >> Looks just like the sort of crud we have in erc-compat.el ;) >> I would just distinguish two cases, however. No reason to support >> Emacs 19 and other brands. > > Do we support Emacs 20? No, we don't. We are using some functions which do not exist in Emacs 20, but I forgot which... -- CYa, Mario | Debian Developer <URL:http://debian.org/> | Get my public key via finger ml...@db... | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44 |
|
From: lawrence m. <we...@gm...> - 2003-09-29 23:59:12
|
Alex Schroeder wrote: [...] > Looks just like the sort of crud we have in erc-compat.el ;) > I would just distinguish two cases, however. No reason to support > Emacs 19 and other brands. Do we support Emacs 20? Which only has dired-replace-in-string (if dired is loaded). -- lawrence mitchell <we...@gm...> |