aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-09-17 22:45:51 +0800
committerChong Yidong2012-09-17 22:45:51 +0800
commit580bd8683bd69caaf131137d977dc189ed822134 (patch)
tree767daf91e6fe12e3331b3227801172bd044bfe6c
parentcaf4040f9efbad61940651fc19cd8f931a007ffc (diff)
downloademacs-580bd8683bd69caaf131137d977dc189ed822134.tar.gz
emacs-580bd8683bd69caaf131137d977dc189ed822134.zip
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
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/comint.el4
-rw-r--r--lisp/pcomplete.el7
3 files changed, 15 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e89320a3c9a..9f964cd6647 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12012-09-17 Chong Yidong <cyd@gnu.org>
2
3 * comint.el (comint--complete-file-name-data): Don't add a space
4 if the status is `sole'; that adds a gratuitous space in the
5 completion-cycling case (Bug#12092).
6
7 * pcomplete.el (pcomplete-completions-at-point): Likewise.
8
12012-09-17 Richard Stallman <rms@gnu.org> 92012-09-17 Richard Stallman <rms@gnu.org>
2 10
3 * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert 11 * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert
diff --git a/lisp/comint.el b/lisp/comint.el
index 638ef73d53d..994d81a375a 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3161,8 +3161,8 @@ See `completion-table-with-quoting' and `comint-unquote-function'.")
3161 (complete-with-action action table string pred)))) 3161 (complete-with-action action table string pred))))
3162 (unless (zerop (length filesuffix)) 3162 (unless (zerop (length filesuffix))
3163 (list :exit-function 3163 (list :exit-function
3164 (lambda (_s finished) 3164 (lambda (_s status)
3165 (when (memq finished '(sole finished)) 3165 (when (eq status 'finished)
3166 (if (looking-at (regexp-quote filesuffix)) 3166 (if (looking-at (regexp-quote filesuffix))
3167 (goto-char (match-end 0)) 3167 (goto-char (match-end 0))
3168 (insert filesuffix))))))))) 3168 (insert filesuffix)))))))))
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."
451 (list beg (point) table 451 (list beg (point) table
452 :predicate pred 452 :predicate pred
453 :exit-function 453 :exit-function
454 ;; If completion is finished, add a terminating space.
455 ;; We used to also do this if STATUS is `sole', but
456 ;; that does not work right when completion cycling.
454 (unless (zerop (length pcomplete-termination-string)) 457 (unless (zerop (length pcomplete-termination-string))
455 (lambda (_s finished) 458 (lambda (_s status)
456 (when (memq finished '(sole finished)) 459 (when (eq status 'finished)
457 (if (looking-at 460 (if (looking-at
458 (regexp-quote pcomplete-termination-string)) 461 (regexp-quote pcomplete-termination-string))
459 (goto-char (match-end 0)) 462 (goto-char (match-end 0))