summaryrefslogtreecommitdiff
path: root/lisp/pcomplete.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-09-17 22:45:51 +0800
committerChong Yidong <cyd@gnu.org>2012-09-17 22:45:51 +0800
commit580bd8683bd69caaf131137d977dc189ed822134 (patch)
tree767daf91e6fe12e3331b3227801172bd044bfe6c /lisp/pcomplete.el
parentcaf4040f9efbad61940651fc19cd8f931a007ffc (diff)
downloademacs-580bd8683bd69caaf131137d977dc189ed822134.tar.gz
Make pcomplete less eager to add an extra space.
* comint.el (comint--complete-file-name-data): Don't add a space if the status is `sole'; that adds a gratuitous space in the completion-cycling case. * pcomplete.el (pcomplete-completions-at-point): Likewise. Fixes: debbugs:12092
Diffstat (limited to 'lisp/pcomplete.el')
-rw-r--r--lisp/pcomplete.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 97d8b4652a9..3f120961486 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -451,9 +451,12 @@ Same as `pcomplete' but using the standard completion UI."
(list beg (point) table
:predicate pred
:exit-function
+ ;; If completion is finished, add a terminating space.
+ ;; We used to also do this if STATUS is `sole', but
+ ;; that does not work right when completion cycling.
(unless (zerop (length pcomplete-termination-string))
- (lambda (_s finished)
- (when (memq finished '(sole finished))
+ (lambda (_s status)
+ (when (eq status 'finished)
(if (looking-at
(regexp-quote pcomplete-termination-string))
(goto-char (match-end 0))