emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/erc/erc-identd.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/erc/erc-identd.el,v
Date: Sun, 01 Apr 2007 13:36:43 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/04/01 13:36:38

Index: lisp/erc/erc-identd.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/erc/erc-identd.el,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- lisp/erc/erc-identd.el      21 Jan 2007 02:47:36 -0000      1.5
+++ lisp/erc/erc-identd.el      1 Apr 2007 13:36:37 -0000       1.6
@@ -42,12 +42,26 @@
 
 (defvar erc-identd-process nil)
 
+(defgroup erc-identd nil
+  "Run a local identd server."
+  :group 'erc)
+
+(defcustom erc-identd-port 8113
+  "Port to run the identd server on if not specified in the argument for
+`erc-identd-start'.
+
+This can be either a string or a number."
+  :group 'erc-identd
+  :type '(choice (const :tag "None" nil)
+                (integer :tag "Port number")
+                (string :tag "Port string")))
+
 ;;;###autoload (autoload 'erc-identd-mode "erc-identd")
 (define-erc-module identd nil
   "This mode launches an identd server on port 8113."
-  ((add-hook 'erc-connect-pre-hook 'erc-identd-start)
+  ((add-hook 'erc-connect-pre-hook 'erc-identd-quickstart)
    (add-hook 'erc-disconnected-hook 'erc-identd-stop))
-  ((remove-hook 'erc-connect-pre-hook 'erc-identd-start)
+  ((remove-hook 'erc-connect-pre-hook 'erc-identd-quickstart)
    (remove-hook 'erc-disconnected-hook 'erc-identd-stop)))
 
 (defun erc-identd-filter (proc string)
@@ -71,11 +85,10 @@
 when you need one, without having to install one globally on your
 system."
   (interactive (list (read-string "Serve identd requests on port: " "8113")))
-  (if (null port)
-      (setq port 8113)
-    (if (stringp port)
-       (setq port (string-to-number port))))
-  (if erc-identd-process
+  (unless port (setq port erc-identd-port))
+  (when (stringp port)
+    (setq port (string-to-number port)))
+  (when erc-identd-process
       (delete-process erc-identd-process))
   (setq erc-identd-process
        (make-network-process :name "identd"
@@ -85,6 +98,11 @@
                              :filter 'erc-identd-filter))
   (set-process-query-on-exit-flag erc-identd-process nil))
 
+(defun erc-identd-quickstart (&rest ignored)
+  "Start the identd server with the default port.
+The default port is specified by `erc-identd-port'."
+  (erc-identd-start))
+
 ;;;###autoload
 (defun erc-identd-stop (&rest ignore)
   (interactive)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]