From 2a4466ca2001c29fd654420b081b780981333dc5 Mon Sep 17 00:00:00 2001 From: Deniz Dogan Date: Mon, 31 Jan 2011 21:44:45 +0100 Subject: [PATCH] * lisp/net/rcirc.el: New customizable nick completion format. (rcirc-nick-completion-format): New defcustom. (rcirc-complete): Use it. --- lisp/ChangeLog | 6 ++++++ lisp/net/rcirc.el | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 584bf71c744..00460741961 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -15,6 +15,12 @@ 2011-01-28T22:12:05Z!monnier@iro.umontreal.ca optional. (compilation-parse-errors, compilation--flush-parse): Use it. +2011-01-31 Deniz Dogan + + * net/rcirc.el: New customizable nick completion format. + (rcirc-nick-completion-format): New defcustom. + (rcirc-complete): Use it. + 2011-01-31 Deniz Dogan * net/rcirc.el: Clean log filenames (Bug#7933). diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 59a7b176088..678aba598b7 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -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." -- 2.39.5