emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106099: * lisp/comint.el (comint--ta


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106099: * lisp/comint.el (comint--table-subvert): Quote the all-completions output.
Date: Mon, 17 Oct 2011 09:43:40 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106099
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9160
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2011-10-17 09:43:40 -0400
message:
  * lisp/comint.el (comint--table-subvert): Quote the all-completions output.
modified:
  lisp/ChangeLog
  lisp/comint.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-17 13:27:53 +0000
+++ b/lisp/ChangeLog    2011-10-17 13:43:40 +0000
@@ -1,7 +1,11 @@
+2011-10-17  Stefan Monnier  <address@hidden>
+
+       * comint.el (comint--table-subvert): Quote the all-completions output
+       (bug#9160).
+
 2011-10-17  Martin Rudalics  <address@hidden>
 
-       * ido.el (ido-default-buffer-method): Remove redundant :type
-       entry.
+       * ido.el (ido-default-buffer-method): Remove redundant :type entry.
 
        * menu-bar.el (menu-bar-file-menu): Add entry for making new
        window on right of selected.  (Bug#9350) Reword other window
@@ -14,8 +18,8 @@
 
 2011-10-15  Chong Yidong  <address@hidden>
 
-       * net/network-stream.el (network-stream-open-starttls): Improve
-       detection of failure due to lack of TLS support.
+       * net/network-stream.el (network-stream-open-starttls):
+       Improve detection of failure due to lack of TLS support.
 
        * mail/sendmail.el (sendmail-query-once): Tweak prompt message,
        putting the input text in front and in bold.

=== modified file 'lisp/comint.el'
--- a/lisp/comint.el    2011-10-03 16:49:56 +0000
+++ b/lisp/comint.el    2011-10-17 13:43:40 +0000
@@ -3079,9 +3079,9 @@
 
 (defun comint--table-subvert (table s1 s2 &optional quote-fun unquote-fun)
   "Completion table that replaces the prefix S1 with S2 in STRING.
-When TABLE, S1 and S2 are provided by `apply-partially', the result
-is a completion table which completes strings of the form (concat S1 S)
-in the same way as TABLE completes strings of the form (concat S2 S)."
+The result is a completion table which completes strings of the
+form (concat S1 S) in the same way as TABLE completes strings of
+the form (concat S2 S)."
   (lambda (string pred action)
     (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil
                                            completion-ignore-case))
@@ -3106,13 +3106,15 @@
          ((eq action t)
           (let ((bounds (completion-boundaries str table pred "")))
             (if (>= (car bounds) (length s2))
-                res
+                (if quote-fun (mapcar quote-fun res) res)
               (let ((re (concat "\\`"
                                 (regexp-quote (substring s2 (car bounds))))))
                 (delq nil
                       (mapcar (lambda (c)
                                 (if (string-match re c)
-                                    (substring c (match-end 0))))
+                                    (let ((str (substring c (match-end 0))))
+                                      (if quote-fun
+                                          (funcall quote-fun str) str))))
                               res))))))
          ;; E.g. action=nil and it's the only completion.
          (res))))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]