From: Chong Yidong Date: Mon, 17 Sep 2012 14:45:51 +0000 (+0800) Subject: Make pcomplete less eager to add an extra space. X-Git-Tag: emacs-24.2.90~269^2~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=580bd8683bd69caaf131137d977dc189ed822134;p=emacs.git 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 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e89320a3c9a..9f964cd6647 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-09-17 Chong Yidong + + * 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 (Bug#12092). + + * pcomplete.el (pcomplete-completions-at-point): Likewise. + 2012-09-17 Richard Stallman * 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'.") (complete-with-action action table string pred)))) (unless (zerop (length filesuffix)) (list :exit-function - (lambda (_s finished) - (when (memq finished '(sole finished)) + (lambda (_s status) + (when (eq status 'finished) (if (looking-at (regexp-quote filesuffix)) (goto-char (match-end 0)) (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." (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))