aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2003-01-10 07:01:14 +0000
committerJohn Wiegley2003-01-10 07:01:14 +0000
commit150158c498e76704f603b2da26e6cbe30d1fa012 (patch)
treef99d7ca28496dd9e33feb4271e8d201280ebcd65
parent3c65ae0ab4dce68b50a31e24b7a8aa00c671c253 (diff)
downloademacs-150158c498e76704f603b2da26e6cbe30d1fa012.tar.gz
emacs-150158c498e76704f603b2da26e6cbe30d1fa012.zip
(pcomplete-termination-string): Added a variable for modifying the
string which is inserted after a completion or expansion using pcomplete.
-rw-r--r--lisp/pcomplete.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index cde0f07064f..7a3f7aaae3a 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -311,6 +311,16 @@ command arguments."
311 :type 'boolean 311 :type 'boolean
312 :group 'pcomplete) 312 :group 'pcomplete)
313 313
314(defcustom pcomplete-termination-string " "
315 "*A string that is inserted after any completion or expansion.
316This is usually a space character, useful when completing lists of
317words separated by spaces. However, if your list uses a different
318separator character, or if the completion occurs in a word that is
319already terminated by a character, this variable should be locally
320modified to be an empty string, or the desired separation string."
321 :type 'string
322 :group 'pcomplete)
323
314;;; Internal Variables: 324;;; Internal Variables:
315 325
316;; for cycling completion support 326;; for cycling completion support
@@ -418,7 +428,7 @@ This will modify the current buffer."
418 (unless (pcomplete-insert-entry 428 (unless (pcomplete-insert-entry
419 "" (car pcomplete-current-completions) t 429 "" (car pcomplete-current-completions) t
420 pcomplete-last-completion-raw) 430 pcomplete-last-completion-raw)
421 (insert-and-inherit " ")) 431 (insert-and-inherit pcomplete-termination-string))
422 (setq pcomplete-current-completions 432 (setq pcomplete-current-completions
423 (cdr pcomplete-current-completions)))))) 433 (cdr pcomplete-current-completions))))))
424 434
@@ -1006,7 +1016,7 @@ Returns non-nil if a space was appended at the end."
1006 (let (space-added) 1016 (let (space-added)
1007 (when (and (not (memq (char-before) pcomplete-suffix-list)) 1017 (when (and (not (memq (char-before) pcomplete-suffix-list))
1008 addsuffix) 1018 addsuffix)
1009 (insert-and-inherit " ") 1019 (insert-and-inherit pcomplete-termination-string)
1010 (setq space-added t)) 1020 (setq space-added t))
1011 (setq pcomplete-last-completion-length (- (point) here) 1021 (setq pcomplete-last-completion-length (- (point) here)
1012 pcomplete-last-completion-stub stub) 1022 pcomplete-last-completion-stub stub)