From: Lawrence M. <we...@gm...> - 2005-01-14 19:19:45
|
luis fernandes wrote: > I would like to request that m-x erc RET should be an additional way > that erc can be started because m-x erc-select RET is a non-obvious > (at least to me who has been using emacs for 12 years) way to start > ERC-- I had to ask on #emacs via chatzilla how to start ERC after > installing it. I too think this is a good idea, here's a fix which I'll commit along with modifications to the wiki, etc... if no-one has major objections. As backward compatibility, we defalias erc-select to erc. Note this patch also changes erc-select-ssl to erc-ssl, for similar reasons. Index: erc.el =================================================================== RCS file: /cvsroot/erc/erc/erc.el,v retrieving revision 1.730 diff -u -r1.730 erc.el --- erc.el 13 Jan 2005 22:32:46 -0000 1.730 +++ erc.el 14 Jan 2005 19:17:22 -0000 @@ -66,7 +66,7 @@ ;; To connect to an IRC server, do ;; -;; M-x erc-select RET +;; M-x erc RET ;; ;; After you are connected to a server, you can use C-h m or have a look at ;; the IRC menu. @@ -1929,7 +1929,7 @@ "Variable used to cache partially received lines.") (make-variable-buffer-local 'erc-previous-read) -(defun erc (&optional server port nick full-name +(defun erc-1 (&optional server port nick full-name connect passwd tgt-list channel process) "Run the Emacs Internet Relay Chat Client. @@ -2070,7 +2070,7 @@ (defcustom erc-before-connect nil "Hook called before connecting to a server. -This hook gets executed before `erc-select' actually invokes `erc-mode' +This hook gets executed before `erc' actually invokes `erc-mode' with your input data. The functions in here get called with three parameters, SERVER, PORT and NICK." :group 'erc-hooks @@ -2132,11 +2132,11 @@ (list :server server :port port :nick nick :password passwd))) ;;;###autoload -(defun* erc-select (&key (server (erc-compute-server)) - (port (erc-compute-port)) - (nick (erc-compute-nick)) - password - (full-name (erc-compute-full-name))) +(defun* erc (&key (server (erc-compute-server)) + (port (erc-compute-port)) + (nick (erc-compute-nick)) + password + (full-name (erc-compute-full-name))) "Select connection parameters and run ERC. Non-interactively, it takes keyword arguments (server (erc-compute-server)) @@ -2144,21 +2144,24 @@ (nick (erc-compute-nick)) password (full-name (erc-compute-full-name))) -That is, if called with (erc-select :server \"irc.freenode.net\" :full-name \"Harry S Truman\") , +That is, if called with (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\") , server and full-name will be set to those values, whereas erc-compute-port, erc-compute-nick and erc-compute-full-name will be invoked for those parameters' values" (interactive (erc-select-read-args)) (run-hook-with-args 'erc-before-connect server port nick) - (erc server port nick erc-user-full-name t password)) + (erc-1 server port nick erc-user-full-name t password)) +(defalias 'erc-select 'erc) -(defun erc-select-ssl (&rest r) +(defun erc-ssl (&rest r) "Interactively select SSL connection parameters and run ERC. -Arguments are as to erc-select." +Arguments are as to erc." (interactive (erc-select-read-args)) (let ((erc-connect-function 'erc-open-ssl-stream)) - (apply 'erc-select r))) + (apply 'erc r))) + +(defalias 'erc-select-ssl 'erc-ssl) (defun erc-open-ssl-stream (name buffer host port) "Open an SSL stream to an IRC server. @@ -2357,8 +2360,8 @@ (setq erc-lines-sent 0) (if (and erc-auto-reconnect (not (string= event "deleted\n"))) - (erc erc-session-server erc-session-port current-nick - erc-session-user-full-name t erc-session-password) + (erc-1 erc-session-server erc-session-port current-nick + erc-session-user-full-name t erc-session-password) ;; terminate, do not reconnect (let ((string (concat "\n\n*** ERC terminated: " event "\n")) @@ -3612,7 +3615,7 @@ "Connect to SERVER, leaving existing connection intact." (erc-log (format "cmd: SERVER: %s" server)) (condition-case nil - (erc-select :server server :nick (erc-current-nick)) + (erc :server server :nick (erc-current-nick)) (error (message "Cannot find host %s." server) (beep))) @@ -4176,15 +4179,15 @@ (buffer-live-p server) (set-buffer server)) (error "Couldn't switch to server buffer")) - (let ((buf (erc erc-session-server - erc-session-port - (erc-current-nick) - erc-session-user-full-name - nil - nil - (list target) - target - erc-process))) + (let ((buf (erc-1 erc-session-server + erc-session-port + (erc-current-nick) + erc-session-user-full-name + nil + nil + (list target) + target + erc-process))) (unless buf (error "Couldn't open query window")) (erc-update-mode-line) -- Lawrence Mitchell <we...@gm...> |