]> code.delx.au - gnu-emacs/commitdiff
Make pcomplete less eager to add an extra space.
authorChong Yidong <cyd@gnu.org>
Mon, 17 Sep 2012 14:45:51 +0000 (22:45 +0800)
committerChong Yidong <cyd@gnu.org>
Mon, 17 Sep 2012 14:45:51 +0000 (22:45 +0800)
* 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
lisp/ChangeLog
lisp/comint.el
lisp/pcomplete.el

index e89320a3c9ac57cfaccea0be1949c1330b43ed7d..9f964cd66477b6de6171252ea140a697f97baa8e 100644 (file)
@@ -1,3 +1,11 @@
+2012-09-17  Chong Yidong  <cyd@gnu.org>
+
+       * 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  <rms@gnu.org>
 
        * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert
index 638ef73d53de6797fe52c07e7d6509cc296d15e4..994d81a375aed28a556fecd4ed9ce90c28c46ce1 100644 (file)
@@ -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)))))))))
index 97d8b4652a9d22a8dedc92d01e319ca5dc37e595..3f1209614860d58b04889cd0ad16cdcb76e2e467 100644 (file)
@@ -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))