diff options
| author | Chong Yidong | 2012-09-17 22:45:51 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-09-17 22:45:51 +0800 |
| commit | 580bd8683bd69caaf131137d977dc189ed822134 (patch) | |
| tree | 767daf91e6fe12e3331b3227801172bd044bfe6c | |
| parent | caf4040f9efbad61940651fc19cd8f931a007ffc (diff) | |
| download | emacs-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/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/comint.el | 4 | ||||
| -rw-r--r-- | lisp/pcomplete.el | 7 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-09-17 Richard Stallman <rms@gnu.org> | 9 | 2012-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)) |