From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.devel Subject: Re: rcirc update: allow sending a server password when connecting Date: Thu, 6 May 2010 08:51:03 +0200 Message-ID: References: <87ljbxg7vl.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273158681 5498 80.91.229.12 (6 May 2010 15:11:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 May 2010 15:11:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ryan Yeske Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 06 17:11:19 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1OA2jO-0006nN-53 for ged-emacs-devel@m.gmane.org; Thu, 06 May 2010 17:11:18 +0200 Original-Received: from localhost ([127.0.0.1]:55788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA2jM-0001bq-TK for ged-emacs-devel@m.gmane.org; Thu, 06 May 2010 11:11:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9uvo-0007gh-Oq for emacs-devel@gnu.org; Thu, 06 May 2010 02:51:36 -0400 Original-Received: from [140.186.70.92] (port=35983 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9uvk-0007gJ-Jk for emacs-devel@gnu.org; Thu, 06 May 2010 02:51:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9uvd-0005oh-W1 for emacs-devel@gnu.org; Thu, 06 May 2010 02:51:32 -0400 Original-Received: from mail-ww0-f41.google.com ([74.125.82.41]:63388) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9uvd-0005nu-8U for emacs-devel@gnu.org; Thu, 06 May 2010 02:51:25 -0400 Original-Received: by wwc33 with SMTP id 33so474289wwc.0 for ; Wed, 05 May 2010 23:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=m15+tjuLV24nTAJxfQOXILg0SMjLCMhkXnn1Pve6fIU=; b=Rqhyfigcn2RiDAFSGNyNnL+JlV0mGn83sd8YaCCArRuC+tGg3OmQsQbi/N974V6dxR SeF/9T/tY9gntyEOsX0IUmtW/lKm+DSK5jeujMfs7DhEvOV+g8ActYg0WjK8C2D1Zo/8 TqgcePla7letXzlkSsopXC6kkcjuaCoyppB8I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=Rcc4Ba0sg6cKsjhWF+gv/owNl1MVOjMnmj0sRGYYzZISetrzZIMINNzeCheLy1gpCO ekcC+O4So3TiPjUuxRsGbNuLnDseUTIInUFbGPgH0tTenICI5vM5Fw2pX+UmMVUr6qfs 8PDYwNjSpiCNAc3RTTYhVFEbYM4PL0uziILSU= Original-Received: by 10.216.157.134 with SMTP id o6mr2567933wek.201.1273128683128; Wed, 05 May 2010 23:51:23 -0700 (PDT) Original-Received: by 10.216.67.204 with HTTP; Wed, 5 May 2010 23:51:03 -0700 (PDT) In-Reply-To: <87ljbxg7vl.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:124587 Archived-At: 2010/5/6 Ryan Yeske : > > 2010-05-01 =A0Ryan Yeske =A0 > > =A0 =A0 =A0 =A0* net/rcirc.el (rcirc-default-user-name): Change to "user"= . > =A0 =A0 =A0 =A0(rcirc-default-full-name): Change to "unknown". > =A0 =A0 =A0 =A0(rcirc-user-name-history): Add variable. > =A0 =A0 =A0 =A0(rcirc): When prompting for connection paramaters, also pr= ompt for > =A0 =A0 =A0 =A0username and password. > =A0 =A0 =A0 =A0(rcirc-connect): Take a PASS argument. =A0If PASS is non-n= il, send > =A0 =A0 =A0 =A0value to server when connecting. > > > > > =3D=3D=3D modified file 'lisp/net/rcirc.el' > --- lisp/net/rcirc.el =A0 2010-01-13 08:35:10 +0000 > +++ lisp/net/rcirc.el =A0 2010-05-06 00:59:16 +0000 > @@ -85,6 +85,10 @@ > =A0VALUE must be a string. =A0If absent, `rcirc-default-full-name' is > =A0used. > > +`:pass' > + > +VALUE must be a string. > + > =A0`:channels' > > =A0VALUE must be a list of strings describing which channels to join > @@ -95,6 +99,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 (:port integer) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 (:user-name string) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 (:full-name string) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0(:pass string) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 (:channels (repeat string))))) > =A0 :group 'rcirc) > > @@ -108,14 +113,12 @@ > =A0 :type 'string > =A0 :group 'rcirc) > > -(defcustom rcirc-default-user-name (user-login-name) > +(defcustom rcirc-default-user-name "user" > =A0 "Your user name sent to the server when connecting." > =A0 :type 'string > =A0 :group 'rcirc) > > -(defcustom rcirc-default-full-name (if (string=3D (user-full-name) "") > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0rcirc-default-user-name > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= (user-full-name)) > +(defcustom rcirc-default-full-name "unknown" > =A0 "The full name sent to the server when connecting." > =A0 :type 'string > =A0 :group 'rcirc) > @@ -369,6 +372,9 @@ > =A0(defvar rcirc-nick-name-history nil > =A0 "History variable for \\[rcirc] call.") > > +(defvar rcirc-user-name-history nil > + =A0"History variable for \\[rcirc] call.") > + > =A0;;;###autoload > =A0(defun rcirc (arg) > =A0 "Connect to all servers in `rcirc-server-alist'. > @@ -393,6 +399,12 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(or (plist= -get server-plist :nick) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rc= irc-default-nick) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'rcirc-nic= k-name-history)) > + =A0 =A0 =A0 =A0 =A0 =A0(user-name (read-string "IRC Username: " > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= (or (plist-get server-plist :user-name) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 rcirc-default-user-name) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 'rcirc-user-name-history)) > + =A0 =A0 =A0 =A0 =A0 =A0(pass (read-passwd "IRC Password: " nil > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (plist-get = server-plist :pass))) > =A0 =A0 =A0 =A0 =A0 =A0 (channels (split-string > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(read-string "IRC Channels= : " > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (= mapconcat 'identity > @@ -400,7 +412,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 :channels) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0" ")) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"[, ]+" t))) > - =A0 =A0 =A0 (rcirc-connect server port nick rcirc-default-user-name > + =A0 =A0 =A0 (rcirc-connect server port nick user-name pass > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rcirc-default-full-name > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 channels)) > =A0 =A0 ;; connect to servers in `rcirc-server-alist' > @@ -411,6 +423,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0(port (or (plist-get (cdr c) :port) rcirc-defa= ult-port)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0(user-name (or (plist-get (cdr c) :user-name) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rcirc-default-use= r-name)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0(pass (plist-get (cdr c) :pass)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0(full-name (or (plist-get (cdr c) :full-name) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rcirc-default-ful= l-name)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0(channels (plist-get (cdr c) :channels))) > @@ -421,7 +434,7 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(setq connected p))) > =A0 =A0 =A0 =A0 =A0 =A0 =A0(if (not connected) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(condition-case e > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (rcirc-connect server port nick= user-name > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (rcirc-connect server port nick= user-name pass > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 f= ull-name channels) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(quit (message "Quit connecting to= %s" server))) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(with-current-buffer (process-buffer conne= cted) > @@ -453,8 +466,8 @@ > =A0(defvar rcirc-process nil) > > =A0;;;###autoload > -(defun rcirc-connect (server &optional port nick user-name full-name > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0startup-channels= ) > +(defun rcirc-connect (server &optional port nick user-name pass > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 full-name start= up-channels) > =A0 (save-excursion > =A0 =A0 (message "Connecting to %s..." server) > =A0 =A0 (let* ((inhibit-eol-conversion) > @@ -503,10 +516,11 @@ > =A0 =A0 =A0 (add-hook 'auto-save-hook 'rcirc-log-write) > > =A0 =A0 =A0 ;; identify > + =A0 =A0 =A0(when pass > + =A0 =A0 =A0 =A0(rcirc-send-string process (concat "PASS " pass))) > =A0 =A0 =A0 (rcirc-send-string process (concat "NICK " nick)) > =A0 =A0 =A0 (rcirc-send-string process (concat "USER " user-name > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0" hostname servername :" > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0full-name)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 " 0 * :" full-name)) > > =A0 =A0 =A0 ;; setup ping timer if necessary > =A0 =A0 =A0 (unless rcirc-keepalive-timer > > > > Finally, eh? :) --=20 Deniz Dogan