]> code.delx.au - gnu-emacs/commitdiff
* lisp/net/rcirc.el: New customizable nick completion format.
authorDeniz Dogan <deniz.a.m.dogan@gmail.com>
Mon, 31 Jan 2011 20:44:45 +0000 (21:44 +0100)
committerDeniz Dogan <deniz.a.m.dogan@gmail.com>
Mon, 31 Jan 2011 20:44:45 +0000 (21:44 +0100)
(rcirc-nick-completion-format): New defcustom.
(rcirc-complete): Use it.

lisp/ChangeLog
lisp/net/rcirc.el

index 584bf71c7440f46e5876ac3a509ea189a4a58665..00460741961abf4978c7d2a2c2e8dcdd7477f93f 100644 (file)
        2011-01-28T22:12:05Z!monnier@iro.umontreal.ca optional.
        (compilation-parse-errors, compilation--flush-parse): Use it.
 
+2011-01-31  Deniz Dogan  <deniz.a.m.dogan@gmail.com>
+
+       * net/rcirc.el: New customizable nick completion format.
+       (rcirc-nick-completion-format): New defcustom.
+       (rcirc-complete): Use it.
+
 2011-01-31  Deniz Dogan  <deniz.a.m.dogan@gmail.com>
 
        * net/rcirc.el: Clean log filenames (Bug#7933).
index 59a7b176088fa2ffd854f11e6004ee0bd59dcfff..678aba598b79c0509e80f67be04719678c1b34cf 100644 (file)
@@ -322,6 +322,15 @@ and the cdr part is used for encoding."
   :type 'function
   :group 'rcirc)
 
+(defcustom rcirc-nick-completion-format "%s: "
+  "Format string to use in nick completions.
+
+The format string is only used when completing at the beginning
+of a line.  The string is passed as the first argument to
+`format' with the nickname as the second argument."
+  :type 'string
+  :group 'rcirc)
+
 (defvar rcirc-nick nil)
 
 (defvar rcirc-prompt-start-marker nil)
@@ -827,11 +836,11 @@ IRC command completion is performed only if '/' is the first input char."
     (when completion
       (delete-region rcirc-completion-start (point))
       (insert
-       (concat completion
-              (cond
-               ((= (aref completion 0) ?/) " ")
-               ((= rcirc-completion-start rcirc-prompt-end-marker) ": ")
-               (t "")))))))
+       (cond
+        ((= (aref completion 0) ?/) (concat completion " "))
+        ((= rcirc-completion-start rcirc-prompt-end-marker)
+         (format rcirc-nick-completion-format completion))
+        (t completion))))))
 
 (defun set-rcirc-decode-coding-system (coding-system)
   "Set the decode coding system used in this channel."