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: It's me F. ;) <m_...@16...> - 2004-12-08 22:53:20
|
Alex Schroeder <al...@em...> writes: > If we use your patch, I will need you to sign copyright papers. Is > this ok for you? If yes, I will send you a longer mail with some more > info. If you think my patch is helpful. I'd glade to sign copyright to ERC Group or FSF or anyone who can help erc support NON-ASCII characters. yours FKtPp |
From: Alex S. <al...@em...> - 2004-12-08 01:46:41
|
If we use your patch, I will need you to sign copyright papers. Is this ok for you? If yes, I will send you a longer mail with some more info. Alex. -- .O. http://www.emacswiki.org/alex/ ..O Schroeder's fifth law: OOO Never accept more work than you can handle in one night of hacking. |
From: Nelson F. <nel...@ie...> - 2004-12-06 00:51:54
|
Hi all, Not sure what in the irc message triggers this, but in a particular group I keep on getting this error (also reproducible by a /list on irc.dal.net). Any idea of how better to troubleshoot ? ERC version 4 $Revision: 1.675$ Invalid function: (macro . #<compiled-function (string) "...(7)" [string when erc-log-p erc-log-aux] 4 ("/usr/lib/xemacs/xemacs-packages/lisp/erc/erc.elc" . 58404)>) Thanks, Nelson -- Nelson Ferreira |
From: It's me F. ;) <m_...@16...> - 2004-12-06 00:02:21
|
Damien Elmes <erc...@re...> writes: > Hi folks, > > I jumped on a network the other day which doesn't use any English, and > their server messages (such as MOTD and LIST messages) are sent using > a 7bit character encoding (iso-2022-jp). You can test it if you want > want by going to irc.2ch.net. > > Unfortunately it seems like ERC can't cope with foreign characters in > the server messages yet - at least not on my setup. I hacked up a > quick patch to fix the problem for me, and thought someone might be > interested. It's probably not suitable for inclusion in ERC yet, but I > wanted to know if anyone has thought of a better way to support > foreign characters in this context. Note that I changed the TOPIC > handler since I thought a more generalised solution would be better - > which means that after the patch is applied /topic messages won't be > customisable on a per-channel basis, until > erc-decode-server-message-string is improved. > > Any thoughts? > > Damien > > --- erc-backend.el 10 Nov 2004 17:01:42 +0900 1.15 > +++ erc-backend.el 05 Dec 2004 18:39:31 +0900 > @@ -110,6 +110,19 @@ > (command-args '() :type list) > (contents "" :type string)) > > +(defvar erc-delayed-decoding-responses '("PRIVMSG" "NOTICE") > + "A list of responses which handle character decoding by themselves") > + > +(defun erc-decode-server-message-string (str msg) > + "Decode a server message if a separate handler won't do it later. > +This is useful for /lists, /topics etc on international networks. > +It could modify target based on the network or other information in > +the future." > + (let ((target nil)) ; NYI > + (if (member (erc-response.command msg) erc-delayed-decoding-responses) > + str > + (erc-decode-string-from-target str target)))) > + > (defun erc-parse-server-response (proc string) > "Parse and act upon a complete line from an IRC server. > PROC is the process (connection) from which STRING was received. > @@ -135,15 +148,19 @@ > > (while (and posn > (not (eq (aref string posn) ?:))) > - (push (let* ((bposn posn) > - (eposn (string-match " " string bposn))) > - (setq posn (and eposn > - (string-match "[^ ]" string eposn))) > - (substring string bposn eposn)) > - (erc-response.command-args msg))) > + (push > + (erc-decode-server-message-string > + (let* ((bposn posn) > + (eposn (string-match " " string bposn))) > + (setq posn (and eposn > + (string-match "[^ ]" string eposn))) > + (substring string bposn eposn)) msg) > + (erc-response.command-args msg))) > (when posn > - (let ((str (substring string (1+ posn)))) > - (push str (erc-response.command-args msg)))) > + (let ((str (substring string (1+ posn)))) > + (push > + (erc-decode-server-message-string str msg) > + (erc-response.command-args msg)))) > > (setf (erc-response.contents msg) > (first (erc-response.command-args msg))) > @@ -665,8 +682,7 @@ > (define-erc-response-handler (TOPIC) > nil nil > (let* ((ch (first (erc-response.command-args parsed))) > - (topic (erc-trim-string (erc-decode-string-from-target > - (erc-response.contents parsed) ch))) > + (topic (erc-trim-string (erc-response.contents parsed))) > (time (format-time-string "%T %m/%d/%y" (current-time)))) > (multiple-value-bind (nick login host) > (erc-parse-user (erc-response.sender parsed)) hi, I also write a patch for this. and It is per-channel basic. Here is it: Index: erc-backend.el =================================================================== RCS file: E:\FKtPp\cvsroot/emacs/erc/erc-backend.el,v retrieving revision 1.1.1.3 retrieving revision 1.3 diff -u -r1.1.1.3 -r1.3 --- erc-backend.el 21 Oct 2004 14:25:08 -0000 1.1.1.3 +++ erc-backend.el 21 Oct 2004 14:36:39 -0000 1.3 @@ -151,8 +151,45 @@ (setf (erc-response.command-args msg) (nreverse (erc-response.command-args msg))) + (erc-decode-parsed-server-response msg) + (erc-handle-parsed-server-response proc msg))))) +(defun erc-decode-parsed-server-response (parsed-response) + "Decode a pre-parsed PARSED-RESPONSE before it can be handled. + +Decode `erc-response' acroding the car of it's `command-args' or if +that is not a channel, use the `erc-default-coding-system' to +decoding." + (let* ((args (erc-response.command-args parsed-response)) + (first-arg (car args)) + (matchp (string-match "^[#&].*" first-arg)) + (decode-target (if matchp + (erc-decode-string-from-target first-arg nil) + nil)) + (decoded-args ())) + (setf (erc-response.unparsed parsed-response) + (erc-decode-string-from-target + (erc-response.unparsed parsed-response) + decode-target)) + (setf (erc-response.sender parsed-response) + (erc-decode-string-from-target + (erc-response.sender parsed-response) + decode-target)) + (setf (erc-response.command parsed-response) + (erc-decode-string-from-target + (erc-response.command parsed-response) + decode-target)) + (dolist (arg args nil) + (add-to-list 'decoded-args + (erc-decode-string-from-target arg decode-target) + t)) + (setf (erc-response.command-args parsed-response) decoded-args) + (setf (erc-response.contents parsed-response) + (erc-decode-string-from-target + (erc-response.contents parsed-response) + decode-target)))) + ;; (defun erc-parse-server-response (process response) ;; "Parse a server PROCESS's IRC RESPONSE." ;; ;; FIXME: this function doesn't do the same as our original @@ -602,8 +639,9 @@ (privp (erc-current-nick-p tgt)) s buffer fnick - (msg (erc-decode-string-from-target msg - (if privp sender-spec tgt)))) + ;; (msg (erc-decode-string-from-target msg +;; (if privp sender-spec tgt))) + ) (setf (erc-response.contents parsed) msg) (setq buffer (erc-get-buffer (if privp nick tgt) proc)) (when buffer @@ -665,8 +703,9 @@ (define-erc-response-handler (TOPIC) nil nil (let* ((ch (first (erc-response.command-args parsed))) - (topic (erc-trim-string (erc-decode-string-from-target - (erc-response.contents parsed) ch))) + (topic (erc-trim-string ;; (erc-decode-string-from-target + (erc-response.contents parsed) ;; ch) + )) (time (format-time-string "%T %m/%d/%y" (current-time)))) (multiple-value-bind (nick login host) (erc-parse-user (erc-response.sender parsed)) |
From: Damien E. <erc...@re...> - 2004-12-05 09:54:37
|
Hi folks, I jumped on a network the other day which doesn't use any English, and their server messages (such as MOTD and LIST messages) are sent using a 7bit character encoding (iso-2022-jp). You can test it if you want want by going to irc.2ch.net. Unfortunately it seems like ERC can't cope with foreign characters in the server messages yet - at least not on my setup. I hacked up a quick patch to fix the problem for me, and thought someone might be interested. It's probably not suitable for inclusion in ERC yet, but I wanted to know if anyone has thought of a better way to support foreign characters in this context. Note that I changed the TOPIC handler since I thought a more generalised solution would be better - which means that after the patch is applied /topic messages won't be customisable on a per-channel basis, until erc-decode-server-message-string is improved. Any thoughts? Damien --- erc-backend.el 10 Nov 2004 17:01:42 +0900 1.15 +++ erc-backend.el 05 Dec 2004 18:39:31 +0900 @@ -110,6 +110,19 @@ (command-args '() :type list) (contents "" :type string)) +(defvar erc-delayed-decoding-responses '("PRIVMSG" "NOTICE") + "A list of responses which handle character decoding by themselves") + +(defun erc-decode-server-message-string (str msg) + "Decode a server message if a separate handler won't do it later. +This is useful for /lists, /topics etc on international networks. +It could modify target based on the network or other information in +the future." + (let ((target nil)) ; NYI + (if (member (erc-response.command msg) erc-delayed-decoding-responses) + str + (erc-decode-string-from-target str target)))) + (defun erc-parse-server-response (proc string) "Parse and act upon a complete line from an IRC server. PROC is the process (connection) from which STRING was received. @@ -135,15 +148,19 @@ (while (and posn (not (eq (aref string posn) ?:))) - (push (let* ((bposn posn) - (eposn (string-match " " string bposn))) - (setq posn (and eposn - (string-match "[^ ]" string eposn))) - (substring string bposn eposn)) - (erc-response.command-args msg))) + (push + (erc-decode-server-message-string + (let* ((bposn posn) + (eposn (string-match " " string bposn))) + (setq posn (and eposn + (string-match "[^ ]" string eposn))) + (substring string bposn eposn)) msg) + (erc-response.command-args msg))) (when posn - (let ((str (substring string (1+ posn)))) - (push str (erc-response.command-args msg)))) + (let ((str (substring string (1+ posn)))) + (push + (erc-decode-server-message-string str msg) + (erc-response.command-args msg)))) (setf (erc-response.contents msg) (first (erc-response.command-args msg))) @@ -665,8 +682,7 @@ (define-erc-response-handler (TOPIC) nil nil (let* ((ch (first (erc-response.command-args parsed))) - (topic (erc-trim-string (erc-decode-string-from-target - (erc-response.contents parsed) ch))) + (topic (erc-trim-string (erc-response.contents parsed))) (time (format-time-string "%T %m/%d/%y" (current-time)))) (multiple-value-bind (nick login host) (erc-parse-user (erc-response.sender parsed)) |
From: <boj...@dd...> - 2004-11-28 19:07:42
|
(info "(elisp)Documentation Tips") * The first line of the documentation string should consist of one or two complete sentences that stand on their own as a summary. * When a documentation string refers to a Lisp symbol, write it as it would be printed [...] with single-quotes around it. [...] There are two exceptions: write t and nil without single-quotes. -- Johan Bockgård |
From: Jeremy Maitin-S. <jb...@at...> - 2004-11-28 07:50:28
|
I have revised erc-autoaway.el to support xscreensaver. Specifically, the revision supports setting the user to away status when xscreensaver is activated, and also discarding the user's away status when xscreensaver is deactivated. The revision also supports user-specification of whether, when automatically setting the user to away status, the automatic away message should be set on servers where the user is already marked as away; as a related feature, I also added support for user-specification of whether, when automatically discarding the user's away status, to affect only servers where the current away status was set automatically by erc-autoaway. The revision is described by the attached patch: |
From: Jeremy Maitin-S. <jb...@cm...> - 2004-11-28 06:00:40
|
I have revised erc-autoaway.el to support xscreensaver. Specifically, the revision supports setting the user to away status when xscreensaver is activated, and also discarding the user's away status when xscreensaver is deactivated. The revision also supports user-specification of whether, when automatically setting the user to away status, the automatic away message should be set on servers where the user is already marked as away; as a related feature, I also added support for user-specification of whether, when automatically discarding the user's away status, to affect only servers where the current away status was set automatically by erc-autoaway. The revision is described by the attached patch: |
From: Alex S. <al...@em...> - 2004-11-27 01:09:54
|
Jorgen Schaefer <fo...@fo...> writes: > Alex, are you reading this? Could you respond please? Yep, that's how it should be: Any patch over 10 lines requires papers. Just to avoid any illusions, though, we're still not perfect, and I haven't updated my data in quite some time. I add new authors to the list, but don't always follow up, until we're getting closer to a new release or other significant things happen on #emacs... :) Alex. -- .O. http://www.emacswiki.org/alex/ ..O Schroeder's fifth law: OOO Never accept more work than you can handle in one night of hacking. |
From: Jorgen S. <fo...@fo...> - 2004-11-26 17:07:00
|
Thomas Weidner <3....@gm...> writes: > ok i think it is not a problem to have the behaviour (nearly) as it is > now. the difference whould be, that the nicknames are printed when the > server sends the end of names and not immediately, but i think thats > no problem. Correct. We probably should provide different "styles" of NAME lists, which shouldn't be much of a problem. > But what about the patch for the channel member modes? currently my > nick listing code relies on it. should i seperate it? I would really > like to see erc having support for additional user modes, as many irc > networks make use of them. I don't see a problem here, but I think you need to sign some papers (i.e. need to assign papers to the FSF), since your contribution is quite big. Alex, are you reading this? Could you respond please? Greetings, -- Jorgen -- ((email . "fo...@fo...") (www . "http://www.forcix.cx/") (gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet")) |
From: Thomas W. <3....@gm...> - 2004-11-25 21:36:26
|
Jorgen Schaefer wrote: > Thomas Weidner <3....@gm...> writes: > > >>>>i think this is much nicer than it is now. >>> >>>Please don't make this the default... Do you think you can write a >>>module that enables this feature? >> >>i think this is possible, but what about the behaviour as it is >>now? > > > I happen to like it :-) But as long as I can get it back, I'm fine > with it. > > Actually, the "best" default behavior IMHO would be a simple > sorted list, but not in columns - the nick length varies too much > to make that generally useful. > > Of course, as I enjoy the current way, I'm happy with everything > you do if you leave me a way to easily configure it to stay as it > is now ;) ok i think it is not a problem to have the behaviour (nearly) as it is now. the difference whould be, that the nicknames are printed when the server sends the end of names and not immediately, but i think thats no problem. But what about the patch for the channel member modes? currently my nick listing code relies on it. should i seperate it? I would really like to see erc having support for additional user modes, as many irc networks make use of them. |
From: Jorgen S. <fo...@fo...> - 2004-11-25 18:25:32
|
Thomas Weidner <3....@gm...> writes: >>>i think this is much nicer than it is now. >> >> Please don't make this the default... Do you think you can write a >> module that enables this feature? > > i think this is possible, but what about the behaviour as it is > now? I happen to like it :-) But as long as I can get it back, I'm fine with it. Actually, the "best" default behavior IMHO would be a simple sorted list, but not in columns - the nick length varies too much to make that generally useful. Of course, as I enjoy the current way, I'm happy with everything you do if you leave me a way to easily configure it to stay as it is now ;) Greetings, -- Jorgen -- ((email . "fo...@fo...") (www . "http://www.forcix.cx/") (gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet")) |
From: Thomas W. <3....@gm...> - 2004-11-25 12:57:20
|
Jorgen Schaefer wrote: > Thomas Weidner <3....@gm...> writes: > > >>Hey again ;) >> >>I did some work again (sorry if i break erc completely ;-)) ERC now >>lists the nicknames in a channel in a more irssi-like way: >>01:46 *** 65 users on #game-developers.net: >> >>01:46 [ *Magister] [ @acez_] [@DeathDealer] [ @ntroPi] >> >> [ Fab96] [ Lightkey] [ schnippi] [ Squolly] >> >> [ ST] [ thomas001] >> >>i think this is much nicer than it is now. > > > Please don't make this the default... Do you think you can write a > module that enables this feature? i think this is possible, but what about the behaviour as it is now? ERC displays the nicks as they are received by the server in a RPL_NAMES message. I don't think this is very good. what about something like erc-display-nicknames-function, which is called when all names were received? everyone could use the function with the formatting he/she likes. or is the behaviour really wanted,that nicks are printed as soon as they are received? |
From: Jorgen S. <fo...@fo...> - 2004-11-25 09:36:11
|
Thomas Weidner <3....@gm...> writes: > Hey again ;) > > I did some work again (sorry if i break erc completely ;-)) ERC now > lists the nicknames in a channel in a more irssi-like way: > 01:46 *** 65 users on #game-developers.net: > > 01:46 [ *Magister] [ @acez_] [@DeathDealer] [ @ntroPi] > > [ Fab96] [ Lightkey] [ schnippi] [ Squolly] > > [ ST] [ thomas001] > > i think this is much nicer than it is now. Please don't make this the default... Do you think you can write a module that enables this feature? Greetings, -- Jorgen -- ((email . "fo...@fo...") (www . "http://www.forcix.cx/") (gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet")) |
From: Thomas W. <3....@gm...> - 2004-11-25 00:57:48
|
Hey again ;) I did some work again (sorry if i break erc completely ;-)) ERC now lists the nicknames in a channel in a more irssi-like way: 01:46 *** 65 users on #game-developers.net: 01:46 [ *Magister] [ @acez_] [@DeathDealer] [ @ntroPi] [ Fab96] [ Lightkey] [ schnippi] [ Squolly] [ ST] [ thomas001] i think this is much nicer than it is now. Sorry i cannot provide a seperate patch for this, but it depends on my previous patch anyway. Its possible to drop this dependancy by changing only a few things. the new (complete) patch is attached to this posting. pls have (again) a look at it. it works fine here, but don't know if it will do so somewhere else. |
From: Thomas W. <3....@gm...> - 2004-11-23 10:46:22
|
Hi, i wrote a small patch so that erc uses all the user modes provided bei the server's 005 message with PREFIX=(abc)!@#. I am new to elisp and to erc, but i think this might be useful (using erc is annoying without it for me). so pls have a look at it. Common subdirectories: erc/CVS and erc.new/CVS Common subdirectories: erc/debian and erc.new/debian Only in erc.new: erc-auto.el diff -ux '*.elc' -x '*~' erc/erc-backend.el erc.new/erc-backend.el --- erc/erc-backend.el 2004-10-18 02:38:24.000000000 +0200 +++ erc.new/erc-backend.el 2004-11-23 03:21:10.000000000 +0100 @@ -243,6 +243,15 @@ (mapconcat 'identity (erc-response.command-args parsed) " ")))) (erc-display-message parsed 'notice proc line))) +(defun erc-parse-nick-prefixes (prefix-string) + (when (string-match "^(\\(.*\\))\\(.*\\)$" prefix-string) + (let ((modes (match-string 1 prefix-string)) + (prefixes (match-string 2 prefix-string))) + (when (= (length modes) (length prefixes)) + (dotimes (i (length modes)) + (add-to-list 'erc-server-nick-prefixes + (cons (aref prefixes i) + (aref modes i)))))))) (def-edebug-spec define-erc-response-handler (&define :name erc-response-handler @@ -432,7 +441,7 @@ (erc-format-message 'JOIN ?n nick ?u login ?h host ?c chnl)))))) (when buffer (set-buffer buffer)) - (erc-update-channel-member chnl nick nick t nil nil host login) + (erc-update-channel-member chnl nick nick t nil host login) ;; on join, we want to stay in the new channel buffer ;;(set-buffer ob) (unless (member "JOIN" erc-hide-list) @@ -612,7 +621,7 @@ ;; message. We will accumulate private identities indefinitely ;; at this point. (erc-update-channel-member (if privp nick tgt) nick nick - privp nil nil host login nil nil t) + privp nil host login nil nil t) (let ((cdata (erc-get-channel-user nick))) (setq fnick (funcall erc-format-nick-function (car cdata) (cdr cdata)))))) (cond @@ -670,7 +679,7 @@ (time (format-time-string "%T %m/%d/%y" (current-time)))) (multiple-value-bind (nick login host) (erc-parse-user (erc-response.sender parsed)) - (erc-update-channel-member ch nick nick nil nil nil host login) + (erc-update-channel-member ch nick nick nil nil host login) (erc-update-channel-topic ch (format "%s\C-c (%s, %s)" topic nick time)) (unless (member "TOPIC" erc-hide-list) (erc-display-message @@ -741,11 +750,13 @@ ;; fill erc-server-parameters (when (string-match "^\\([A-Z]+\\)\=\\(.*\\)$\\|^\\([A-Z]+\\)$" section) - (add-to-list 'erc-server-parameters - `(,(or (match-string 1 section) - (match-string 3 section)) - . - ,(match-string 2 section)))))) + (let ((name (or (match-string 1 section) + (match-string 3 section))) + (value (match-string 2 section))) + (when (string-equal name "PREFIX") + (erc-parse-nick-prefixes value)) + (add-to-list 'erc-server-parameters + (cons name value)))))) (erc-display-message parsed 'notice proc line))) (define-erc-response-handler (221) @@ -974,7 +985,7 @@ (when (string-match "\\(^[0-9]+ \\)\\(.*\\)$" name) (setq hopcount (match-string 1 name)) (setq name (match-string 2 name))) - (erc-update-channel-member channel nick nick nil nil nil host user name) + (erc-update-channel-member channel nick nick nil nil host user name) (erc-display-message parsed 'notice 'active (format "%-11s %-10s %-4s %s@%s (%s)" channel nick flag user host name))))) diff -ux '*.elc' -x '*~' erc/erc.el erc.new/erc.el --- erc/erc.el 2004-10-18 00:01:24.000000000 +0200 +++ erc.new/erc.el 2004-11-23 11:32:54.000000000 +0100 @@ -238,6 +238,14 @@ WALLCHOPS - supports sending messages to all operators in a channel") (make-variable-buffer-local 'erc-server-parameters) +(defvar erc-server-nick-prefixes '((?@ . ?o) (?+ . ?v)) + "Variable describing the supported user modes + +This is a alist containing the supported nick prefixes and +corresponding modes. It has the format: + ((PREFIX . MODE) ...) +where PREFIX and MODE are both characters") +(make-variable-buffer-local 'erc-server-nick-prefixes) (defcustom erc-disconnected-hook nil "Run this hook with arguments (NICK IP REASON) when disconnected. @@ -351,7 +359,9 @@ (defstruct (erc-channel-user (:type vector) :named) - op voice + ;; op voice + ;; a list containing mode characters like ?o or ?v or even ?q + modes ;; Last message time (in the form of the return value of ;; (current-time) @@ -463,7 +473,7 @@ (hash-table-p erc-channel-users) (let ((cdata (erc-get-channel-user nick))) (and cdata (cdr cdata) - (erc-channel-user-op (cdr cdata)))))) + (member ?o (erc-channel-user-modes (cdr cdata))))))) (defsubst erc-channel-user-voice-p (nick) "Return `t' if NICK has voice in the current channel." @@ -471,7 +481,21 @@ (hash-table-p erc-channel-users) (let ((cdata (erc-get-channel-user nick))) (and cdata (cdr cdata) - (erc-channel-user-voice (cdr cdata)))))) + (member ?v (erc-channel-user-modes (cdr cdata))))))) + +(defsubst erc-channel-user-get-modes (nick) + (and nick + (hash-table-p erc-channel-users) + (let ((cdata (erc-get-channel-user nick))) + (and cdata (cdr cdata) + (erc-channel-user-modes (cdr cdata)))))) + +;;; for compatability +(defsubst erc-channel-user-op (user) + (member ?o (erc-channel-user-modes user))) + +(defsubst erc-channel-user-voice (user) + (member ?v (erc-channel-user-modes user))) (defun erc-get-channel-user-list () "Returns a list of users in the current channel. Each element @@ -511,6 +535,36 @@ erc-channel-users) nicks))) +(defun erc-get-nick-prefix-from-mode (mode) + (with-current-buffer (erc-server-buffer) + (let ((p (rassoc mode erc-server-nick-prefixes))) + (if p + (car p) + nil)))) + +(defun erc-get-nick-prefix-string-from-mode (mode) + (let ((p (erc-get-nick-prefix-from-mode mode))) + (if p + (char-to-string p) + ""))) + +(defun erc-get-nick-mode-from-prefix (pref) + (with-current-buffer (erc-server-buffer) + (let ((p (assoc pref erc-server-nick-prefixes))) + (if p + (cdr p) + nil)))) + +(defun erc-get-nick-mode-string-from-prefix (pref) + (let ((m (erc-get-nick-mode-from-prefix pref))) + (if m + (char-to-string m) + ""))) + +(defun erc-get-server-nick-prefix-alist () + (with-current-buffer (erc-server-buffer) + erc-server-nick-prefixes)) + (defun erc-get-server-nickname-alist () "Returns an alist of known nicknames on the current server." (if (erc-process-alive) @@ -4734,13 +4788,12 @@ "Format a nickname such that @ or + are prefix for the NICK if OP or VOICE are t respectively." (if user - (let (op voice) + (let (modes) (if channel-data - (setq op (erc-channel-user-op channel-data) - voice (erc-channel-user-voice channel-data))) - (concat (if voice "+" "") - (if op "@" "") - (erc-server-user-nickname user))))) + (setq modes (erc-channel-user-modes channel-data))) + (concat + (mapconcat 'erc-get-nick-prefix-string-from-mode modes "") + (erc-server-user-nickname user))))) (defun erc-format-my-nick () "Return the beginning of this user's message, correctly propertized" @@ -5240,27 +5293,24 @@ Update `erc-channel-users' according to NAMES-STRING. NAMES-STRING is a string listing some of the names on the channel." - (let (names name op voice) + (let (names name op modes) ;; We need to delete "" because in XEmacs, (split-string "a ") ;; returns ("a" ""). (setq names (delete "" (split-string names-string))) (let ((erc-channel-members-changed-hook nil)) (dolist (item names) - (cond ((string-match "^@\\(.*\\)$" item) - (setq name (match-string 1 item) - op 'on - voice 'off)) - ((string-match "^+\\(.*\\)$" item) - (setq name (match-string 1 item) - op 'off - voice 'on)) - (t (setq name item - op 'off - voice 'off))) + (block search-prefix + (dolist (mp (erc-get-server-nick-prefix-alist)) + (let ((re (format "%c\\(.*\\)$" (car mp)))) + (when (string-match re item) + (setq name (match-string 1 item) + modes (list (cdr mp))) + (return-from search-prefix)))) + (setq name item)) (puthash (erc-downcase name) t erc-channel-new-member-names) (erc-update-current-channel-member - name name t op voice))) + name name t modes))) (run-hooks 'erc-channel-members-changed-hook))) (defcustom erc-channel-members-changed-hook nil @@ -5320,16 +5370,14 @@ changed)) (defun erc-update-current-channel-member - (nick new-nick &optional add op voice host login full-name info + (nick new-nick &optional add modes host login full-name info update-message-time) "Updates the stored user information for the user with nickname NICK. `erc-update-user' is called to handle changes to nickname, -host, login, full-name, and info. If `op' or `voice' are -non-nil, they must be equal to either `on' or `off', in which -case the operator or voice status of USER in the current channel -is changed accordingly. If `update-message-time' is non-nil, the -last-message-time of the user in the current channel is set -to (current-time). +host, login, full-name, and info. MODES contains a list of +characters describing valid user modes. If `update-message-time' +is non-nil, the last-message-time of the user in the current +channel is set to (current-time). If ADD is non-nil, the user will be added with the specified information if it is not already present in the user or channel @@ -5347,20 +5395,13 @@ (if cuser (progn (erc-log (format "update-member: user = %S, cuser = %S" user cuser)) - (when (and op - (not (eq (erc-channel-user-op cuser) op))) + (when modes + (when (equal modes '(nil)) + (setq modes nil)) + (unless (equal (erc-channel-user-modes cuser) modes) (setq changed t) - (setf (erc-channel-user-op cuser) - (cond ((eq op 'on) t) - ((eq op 'off) nil) - (t op)))) - (when (and voice - (not (eq (erc-channel-user-voice cuser) voice))) - (setq changed t) - (setf (erc-channel-user-voice cuser) - (cond ((eq voice 'on) t) - ((eq voice 'off) nil) - (t voice)))) + (setf (erc-channel-user-modes cuser) modes))) + (when update-message-time (setf (erc-channel-user-last-message-time cuser) (current-time))) (setq user-changed @@ -5381,12 +5422,7 @@ (cons (current-buffer) (erc-server-user-buffers user)))) (setq cuser (make-erc-channel-user - :op (cond ((eq op 'on) t) - ((eq op 'off) nil) - (t op)) - :voice (cond ((eq voice 'on) t) - ((eq voice 'off) nil) - (t voice)) + :modes modes :last-message-time (if update-message-time (current-time)))) (puthash (erc-downcase nick) (cons user cuser) @@ -5397,7 +5433,7 @@ (or changed user-changed add))) (defun erc-update-channel-member (channel nick new-nick - &optional add op voice host login + &optional add modes host login full-name info update-message-time) "Updates user and channel information for the user with nickname NICK in channel CHANNEL. @@ -5405,7 +5441,7 @@ See also: `erc-update-current-channel-member'" (erc-with-buffer (channel) - (erc-update-current-channel-member nick new-nick add op voice host + (erc-update-current-channel-member nick new-nick add modes host login full-name info update-message-time))) @@ -5560,16 +5596,24 @@ (let ((mode (nth 0 (car arg-modes))) (onoff (nth 1 (car arg-modes))) (arg (nth 2 (car arg-modes)))) - (cond ((string-match "^[oO]" mode) - (erc-update-channel-member tgt arg arg nil onoff)) - ((string-match "^[Vv]" mode) - (erc-update-channel-member tgt arg arg nil nil - onoff)) - ((string-match "^[Ll]" mode) - (erc-update-channel-limit tgt onoff arg)) - ((string-match "^[Kk]" mode) - (erc-update-channel-key tgt onoff arg)) - (t nil)); only ops are tracked now + (block search-mode + (dolist (pm (erc-get-server-nick-prefix-alist)) + (let ((re (format "^%c" (cdr pm))) + (modes (copy-list + (erc-channel-user-get-modes arg)))) + (when (string-match re mode) + (if (eq onoff 'on) + (add-to-list 'modes (cdr pm)) + (setq modes (delete (cdr pm) modes))) + (erc-update-channel-member tgt arg arg nil + (or modes '(nil))) + (return-from search-mode)))) + (cond + ((string-match "^[Ll]" mode) + (erc-update-channel-limit tgt onoff arg)) + ((string-match "^[Kk]" mode) + (erc-update-channel-key tgt onoff arg)) + (t nil))); only ops are tracked now (setq arg-modes (cdr arg-modes)))) (erc-update-mode-line buf)))) ;; nick modes - ignored at this point @@ -6546,7 +6590,7 @@ (user (if channel-data (car channel-data) (erc-get-server-user word))) - host login full-name info nick op voice) + host login full-name info nick modes) (when user (setq nick (erc-server-user-nickname user) host (erc-server-user-host user) @@ -6554,18 +6598,16 @@ full-name (erc-server-user-full-name user) info (erc-server-user-info user)) (if cuser - (setq op (erc-channel-user-op cuser) - voice (erc-channel-user-voice cuser))) + (setq modes (erc-channel-user-modes cuser))) (if (interactive-p) (message "%s is %s@%s%s%s" nick login host (if full-name (format " (%s)" full-name) "") - (if (or op voice) - (format " and is +%s%s on %s" - (if op "o" "") - (if voice "v" "") - (erc-default-target)) - "")) + (if modes + (format " and is +%s on %s" + (mapconcat 'erc-get-nick-prefix-string-from-mode modes) + (erc-default-target)) + "")) user)))) ;; (defun erc-operator-p (nick &optional channel) |
From: <boj...@dd...> - 2004-10-18 01:39:45
|
Brian Palmer <bp...@re...> writes: > boj...@dd... (Johan Bockgård) writes: > >> Brian Palmer <bp...@re...> writes: > Ah. I think the old behaviour was a bug. erc-send-pre-hook > explicitly notes that you can change the text that is sent or > whether it is sent at all; the text that should go through the > checking for whitespace filter should be the final text that you're > going to output. You should also have the opportunity to modify the > text even if it's just blank lines. erc-ring currently uses erc-send-pre-hook (`erc-add-to-input-ring'). In this case at least something should to be done (in erc-ring.el) to prevent pushing empty strings on the input history list. -- Johan Bockgård |
From: Brian P. <bp...@re...> - 2004-10-17 21:46:18
|
boj...@dd... (Johan Bockg=E5rd) writes: > Brian Palmer <bp...@re...> writes: [accepted most of the changes pointed out.] [erc-send-pre-hook] > This hook will be run in every case. That is not good. Please try to > preserve the old behavior when possible, in particular when dealing > with when/if hooks are run. Ah. I think the old behaviour was a bug. erc-send-pre-hook explicitly notes that you can change the text that is sent or whether it is sent at all; the text that should go through the checking for whitespace filter should be the final text that you're going to output. You should also have the opportunity to modify the text even if it's just blank lines.=20 > In pre-cvs Emacs this test interprets input of the form "\n+/foo" as a > command, (split-string "\n/foo" "\n") =3D> ("/foo"). > And (split-string "" "\n") =3D> nil, meaning that we won't get a warning > message in this case. That's annoying. pre-cvs emacs seems broken. I'll have to think about an elegant way to handle that.=20 > To summarize: If `erc-send-whitespace-lines' is nil and input consists > only of whitespace erc should beep and complain once (not once per > line),=20 what if the message contains a mixture of blank and non-blank lines? The docstring from erc-warn-about-blank-lines suggests to me it needs to cause at least one beep. I don't know that that is *useful* (but then, I think erc-warn-about-blank-lines is pretty useless, and I'd love to just eliminate it. If anybody does really care about it, a check-and-beep could go into erc-send-pre-hook, instead).=20 --=20 I'm awfully glad I'm a Beta, because I don't work so hard. |
From: <boj...@dd...> - 2004-10-17 20:06:43
|
Brian Palmer <bp...@re...> writes: > Index: erc.el > =================================================================== > RCS file: /cvsroot/erc/erc/erc.el,v > retrieving revision 1.702 > diff -r1.702 erc.el > 157,160c157,167 > < (defcustom erc-send-whitespace-lines nil > < "If set to non-nil, send lines consisting of only whitespace." > < :group 'erc > < :type 'boolean) > --- >> (defcustom erc-send-whitespace-lines 'middle >> "Set whether erc will send user lines that are completely whitespace. ^ This is a variable, not a function. >> If t, send all whitespace-only lines; if 'middle, only ^ `middle' >> send non leading/terminal whitespace-only lines. If nil, skip over >> every whitespace-only line. Lines that are not sent will be warned >> about, if erc-warn-about-blank-lines is set. " ^ non-nil > --- >> (let ((str input) >> (rv nil)) >> (setq erc-send-this t) >> (setq erc-insert-this t) >> (run-hook-with-args 'erc-send-pre-hook input) This hook will be run in every case. That is not good. Please try to preserve the old behavior when possible, in particular when dealing with when/if hooks are run. >> (let* ((lines (split-string str "\n")) >> (interpet-commands (= (length lines) 1))) typo ^ Also, note that split-string behaves differently in different emacsen. In pre-cvs Emacs this test interprets input of the form "\n+/foo" as a command, (split-string "\n/foo" "\n") => ("/foo"). And (split-string "" "\n") => nil, meaning that we won't get a warning message in this case. >> (loop for (line next-line) on lines for not-first-line = nil then t >> if (or (not (string-match "\\`[ \t\r\f\n]*\\'" line)) >> (eq t erc-send-whitespace-lines) >> (and (eq 'middle erc-send-whitespace-lines) not-first-line (not (null next-line)))) Please keep lines short. >> do (erc-send-single-line line interpet-commands erc-send-this erc-insert-this) >> (setq rv t) >> else >> if erc-warn-about-blank-lines >> do (message "Blank line - ignoring...") >> (beep) >> finally return rv)))) >> To summarize: If `erc-send-whitespace-lines' is nil and input consists only of whitespace erc should beep and complain once (not once per line), and `erc-send-pre-hook' should not be run (the old behavior). -- Johan Bockgård |
From: Jorgen S. <fo...@fo...> - 2004-10-17 19:57:10
|
Andreas Schwab <sc...@su...> writes: > Jorgen Schaefer <fo...@fo...> writes: > >> Pascal J.Bourguignon <pj...@in...> writes: >> >>> While you're at it, trim spaces on the left (and right) to avoid >>> sending /commands to the channel just because there's some space at >>> the beginnning. >> >> Please don't make that the default. I hate this "feature" with a >> passion. (I often use spaces in front to show people what to type >> etc.) > > You can also use /say for that. I know... I don't like /say for that (it's too inconvenient). As I said, as long as it's an option and not hardcoded, that's ok ;) Greetings, -- Jorgen -- ((email . "fo...@fo...") (www . "http://www.forcix.cx/") (gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet")) |
From: Andreas S. <sc...@su...> - 2004-10-17 19:14:56
|
Jorgen Schaefer <fo...@fo...> writes: > Pascal J.Bourguignon <pj...@in...> writes: > >> While you're at it, trim spaces on the left (and right) to avoid >> sending /commands to the channel just because there's some space at >> the beginnning. > > Please don't make that the default. I hate this "feature" with a > passion. (I often use spaces in front to show people what to type > etc.) You can also use /say for that. Andreas. --=20 Andreas Schwab, SuSE Labs, sc...@su... SuSE Linux AG, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." |
From: <boj...@dd...> - 2004-10-17 18:42:16
|
Jorgen Schaefer <fo...@fo...> writes: > Pascal J.Bourguignon <pj...@in...> writes: > >> While you're at it, trim spaces on the left (and right) to avoid >> sending /commands to the channel just because there's some space at >> the beginnning. > > Please don't make that the default. I hate this "feature" with a > passion. (I often use spaces in front to show people what to type > etc.) Ditto. -- Johan Bockgård |
From: Jorgen S. <fo...@fo...> - 2004-10-17 17:48:17
|
Pascal J.Bourguignon <pj...@in...> writes: > While you're at it, trim spaces on the left (and right) to avoid > sending /commands to the channel just because there's some space at > the beginnning. Please don't make that the default. I hate this "feature" with a passion. (I often use spaces in front to show people what to type etc.) Greetings, -- Jorgen -- ((email . "fo...@fo...") (www . "http://www.forcix.cx/") (gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet")) |
From: Pascal J.B. <pj...@in...> - 2004-10-17 16:55:18
|
Brian Palmer writes: > I believe that the current behaviour dealing with sending whitespace > only lines is broken when dealing with sending input that contains > newlines. This has been fairly embarrassing in the past when pasting > code into irc, for example, and I know it's struck some other people > :-) > > I'm proposing the following patch, which will change the behaviour to > allow switching between sending no whitespace-only lines, sending only > whitespace-only lines that are not the beginning or ending, and > sending every whitespace-only line, with it defaulting to the second > case. (I suppose ideally it would collapse together multiple leading > or trailing lines, but the code does not currently do so ). > > I'm asking for opinions as to whether all three of those options > should be present, whether more should be added, and if so, what the > default would be. (I don't foresee a tremendous use for the 'middle > behaviour myself (I plan on setting it to nil and keeping it there), > but some others on the channel thought it'd be useful, and be a > reasonable default). > > Depending on feedback, I'll probably commit this tomorrow. While you're at it, trim spaces on the left (and right) to avoid sending /commands to the channel just because there's some space at the beginnning. But don't space-trim pasted multi-lines. An option for pasted lines would be to prefix the lines with a "quote" string such as "| " or "> " (to avoid problems when pasting //comments for example). -- __Pascal Bourguignon__ http://www.informatimago.com/ Voting Democrat or Republican is like choosing a cabin in the Titanic. |
From: Jorgen S. <fo...@fo...> - 2004-10-17 12:34:00
|
Brian Palmer <bp...@re...> writes: > I believe that the current behaviour dealing with sending whitespace > only lines is broken when dealing with sending input that contains > newlines. This has been fairly embarrassing in the past when pasting > code into irc, for example, and I know it's struck some other people > :-) I like your change, but be warned, people will torment you for this loop construct :-) Greetings, -- Jorgen -- ((email . "fo...@fo...") (www . "http://www.forcix.cx/") (gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet")) |