From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Yeske Newsgroups: gmane.emacs.devel Subject: Re: rcirc update Date: Wed, 20 Jun 2007 12:53:36 -0700 Message-ID: <877ipyl7wf.fsf@owie.lan> References: <871wgld7nz.fsf@owie.lan> <87r6ofppg7.fsf@stupidchicken.com> <87r6oca9fh.fsf@owie.lan> <87sl8ssg81.fsf@catnip.gol.com> <87odjga3le.fsf@owie.lan> <87myyzsi91.fsf@catnip.gol.com> <87ir9m9mxb.fsf@owie.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182369259 22702 80.91.229.12 (20 Jun 2007 19:54:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Jun 2007 19:54:19 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, miles@gnu.org To: Ryan Yeske Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 20 21:54:17 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I16Fs-0006Yj-O9 for ged-emacs-devel@m.gmane.org; Wed, 20 Jun 2007 21:54:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I16Fs-0000Bu-1b for ged-emacs-devel@m.gmane.org; Wed, 20 Jun 2007 15:54:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I16Fo-0000AZ-Kq for emacs-devel@gnu.org; Wed, 20 Jun 2007 15:54:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I16Fn-0000AN-3Z for emacs-devel@gnu.org; Wed, 20 Jun 2007 15:54:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I16Fm-0000AK-Tk for emacs-devel@gnu.org; Wed, 20 Jun 2007 15:54:10 -0400 Original-Received: from mail.tor.primus.ca ([216.254.136.21] helo=mail-07.primus.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I16Fl-0007Cr-1m; Wed, 20 Jun 2007 15:54:09 -0400 Original-Received: from [209.90.176.154] (helo=owie.lan) by mail-07.primus.ca with esmtp (Exim 4.63) (envelope-from ) id 1I16Fk-0005CX-0Y; Wed, 20 Jun 2007 15:54:08 -0400 In-Reply-To: <87ir9m9mxb.fsf@owie.lan> (message from Ryan Yeske on Sun, 17 Jun 2007 16:33:04 -0700) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:73469 Archived-At: Ryan Yeske writes: > Miles Bader writes: > >> Ryan Yeske writes: >>>> Note that Elisp is case-sensitive... >>> >>> Hmm, that is true. I was following the convention that function >>> arguments are capitalized like that... but for these keywords it >>> probably is not the right thing. The way it was written before was >>> difficult to read, this is probably not much better. >> >> I think the convention is to quote symbols like `blargh' (which can look >> slightly ugly sometimes, but at least it gets the point across). >> >> E.g., see the docstring for `set-face-attribute'. > > Thanks for the pointer, that looks much better. > > Seeing that docstring got me thinking, should I use `:symbol' or just > `symbol' for the symbols in `rcirc-connections'? Resending last patch, with changes. I renamed rcirc-connections, use :symbols, and improved the documentation. 2007-06-20 Ryan Yeske * rcirc.el (rcirc-server-alist): Rename from rcirc-connections. (rcirc-default-full-name): Rename from rcirc-default-user-full-name. (rcirc-clear-activity): Make sure RCIRC-ACTIVITY isn't modified. (rcirc-print): Never ignore messages from ourself. Index: rcirc.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/net/rcirc.el,v retrieving revision 1.35 diff -c -r1.35 rcirc.el *** rcirc.el 13 Jun 2007 21:17:16 -0000 1.35 --- rcirc.el 20 Jun 2007 19:05:30 -0000 *************** *** 55,61 **** :link '(custom-manual "(rcirc)") :group 'applications) ! (defcustom rcirc-connections '(("irc.freenode.net" :channels ("#rcirc"))) "An alist of IRC connections to establish when running `rcirc'. Each element looks like (SERVER-NAME PARAMETERS). --- 55,61 ---- :link '(custom-manual "(rcirc)") :group 'applications) ! (defcustom rcirc-server-alist '(("irc.freenode.net" :channels ("#rcirc"))) "An alist of IRC connections to establish when running `rcirc'. Each element looks like (SERVER-NAME PARAMETERS). *************** *** 63,72 **** SERVER-NAME is a string describing the server to connect to. ! PARAMETERS is a plist of optional connection parameters. Valid ! properties are: nick (a string), port (number or string), ! user-name (string), full-name (string), and channels (list of ! strings)." :type '(alist :key-type string :value-type (plist :options ((nick string) (port integer) --- 63,97 ---- SERVER-NAME is a string describing the server to connect to. ! The optional PARAMETERS come in pairs PARAMETER VALUE. ! ! The following parameters are recognized: ! ! `:nick' ! ! VALUE must be a string. If absent, `rcirc-default-nick' is used ! for this connection. ! ! `:port' ! ! VALUE must be a number or string. If absent, ! `rcirc-default-port' is used. ! ! `:user-name' ! ! VALUE must be a string. If absent, `rcirc-default-user-name' is ! used. ! ! `:full-name' ! ! VALUE must be a string. If absent, `rcirc-default-full-name' is ! used. ! ! `:channels' ! ! VALUE must be a list of strings describing which channels to join ! when connecting to this server. If absent, no channels will be ! connected to automatically." :type '(alist :key-type string :value-type (plist :options ((nick string) (port integer) *************** *** 90,98 **** :type 'string :group 'rcirc) ! (defcustom rcirc-default-user-full-name (if (string= (user-full-name) "") ! rcirc-default-user-name ! (user-full-name)) "The full name sent to the server when connecting." :type 'string :group 'rcirc) --- 115,123 ---- :type 'string :group 'rcirc) ! (defcustom rcirc-default-full-name (if (string= (user-full-name) "") ! rcirc-default-user-name ! (user-full-name)) "The full name sent to the server when connecting." :type 'string :group 'rcirc) *************** *** 335,341 **** ;;;###autoload (defun rcirc (arg) ! "Connect to all servers in `rcirc-connections'. Do not connect to a server if it is already connected. --- 360,366 ---- ;;;###autoload (defun rcirc (arg) ! "Connect to all servers in `rcirc-server-alist'. Do not connect to a server if it is already connected. *************** *** 343,352 **** (interactive "P") (if arg (let* ((server (completing-read "IRC Server: " ! rcirc-connections nil nil ! (caar rcirc-connections))) ! (server-plist (cdr (assoc-string server rcirc-connections))) (port (read-string "IRC Port: " (number-to-string (or (plist-get server-plist 'port) --- 368,377 ---- (interactive "P") (if arg (let* ((server (completing-read "IRC Server: " ! rcirc-server-alist nil nil ! (caar rcirc-server-alist))) ! (server-plist (cdr (assoc-string server rcirc-server-alist))) (port (read-string "IRC Port: " (number-to-string (or (plist-get server-plist 'port) *************** *** 362,380 **** " ")) "[, ]+" t))) (rcirc-connect server port nick rcirc-default-user-name ! rcirc-default-user-full-name channels)) ! ;; connect to servers in `rcirc-connections' (let (connected-servers) ! (dolist (c rcirc-connections) (let ((server (car c)) ! (port (or (plist-get (cdr c) 'port) rcirc-default-port)) ! (nick (or (plist-get (cdr c) 'nick) rcirc-default-nick)) ! (user-name (or (plist-get (cdr c) 'user-name) rcirc-default-user-name)) ! (full-name (or (plist-get (cdr c) 'full-name) ! rcirc-default-user-full-name)) ! (channels (plist-get (cdr c) 'channels))) (when server (let (connected) (dolist (p (rcirc-process-list)) --- 387,405 ---- " ")) "[, ]+" t))) (rcirc-connect server port nick rcirc-default-user-name ! rcirc-default-full-name channels)) ! ;; connect to servers in `rcirc-server-alist' (let (connected-servers) ! (dolist (c rcirc-server-alist) (let ((server (car c)) ! (nick (or (plist-get (cdr c) :nick) rcirc-default-nick)) ! (port (or (plist-get (cdr c) :port) rcirc-default-port)) ! (user-name (or (plist-get (cdr c) :user-name) rcirc-default-user-name)) ! (full-name (or (plist-get (cdr c) :full-name) ! rcirc-default-full-name)) ! (channels (plist-get (cdr c) :channels))) (when server (let (connected) (dolist (p (rcirc-process-list)) *************** *** 423,429 **** rcirc-default-port)) (nick (or nick rcirc-default-nick)) (user-name (or user-name rcirc-default-user-name)) ! (full-name (or full-name rcirc-default-user-full-name)) (startup-channels startup-channels) (process (make-network-process :name server :host server :service port-number))) ;; set up process --- 448,454 ---- rcirc-default-port)) (nick (or nick rcirc-default-nick)) (user-name (or user-name rcirc-default-user-name)) ! (full-name (or full-name rcirc-default-full-name)) (startup-channels startup-channels) (process (make-network-process :name server :host server :service port-number))) ;; set up process *************** *** 590,596 **** process)))))) (defun rcirc-delete-process (process) - (message "delete process %S" process) (delete-process process)) (defvar rcirc-trap-errors-flag t) --- 615,620 ---- *************** *** 1262,1272 **** Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, record activity." (or text (setq text "")) ! (unless (or (member sender rcirc-ignore-list) ! (member (with-syntax-table rcirc-nick-syntax-table ! (when (string-match "^\\([^/]\\w*\\)[:,]" text) ! (match-string 1 text))) ! rcirc-ignore-list)) (let* ((buffer (rcirc-target-buffer process sender response target text)) (inhibit-read-only t)) (with-current-buffer buffer --- 1286,1297 ---- Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, record activity." (or text (setq text "")) ! (unless (and (or (member sender rcirc-ignore-list) ! (member (with-syntax-table rcirc-nick-syntax-table ! (when (string-match "^\\([^/]\\w*\\)[:,]" text) ! (match-string 1 text))) ! rcirc-ignore-list)) ! (not (string= sender (rcirc-nick process)))) (let* ((buffer (rcirc-target-buffer process sender response target text)) (inhibit-read-only t)) (with-current-buffer buffer *************** *** 1635,1641 **** (defun rcirc-clear-activity (buffer) "Clear the BUFFER activity." ! (setq rcirc-activity (delete buffer rcirc-activity)) (with-current-buffer buffer (setq rcirc-activity-types nil))) --- 1660,1666 ---- (defun rcirc-clear-activity (buffer) "Clear the BUFFER activity." ! (setq rcirc-activity (remove buffer rcirc-activity)) (with-current-buffer buffer (setq rcirc-activity-types nil)))