diff options
| author | Stefan Monnier | 2011-10-17 09:43:40 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-10-17 09:43:40 -0400 |
| commit | 8b79f3e0ed805d86dcb0e74572e61da2cd2d8ffc (patch) | |
| tree | c41715088099ab1db86e0f45c2dd6d933395125e | |
| parent | 4e5c3d2bf143a9925a2f52e9ec8613977fd0bc8a (diff) | |
| download | emacs-8b79f3e0ed805d86dcb0e74572e61da2cd2d8ffc.tar.gz emacs-8b79f3e0ed805d86dcb0e74572e61da2cd2d8ffc.zip | |
* lisp/comint.el (comint--table-subvert): Quote the all-completions output.
Fixes: debbugs:9160
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/comint.el | 12 |
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c29a93950d..1ebca8675ce 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,11 @@ | |||
| 1 | 2011-10-17 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * comint.el (comint--table-subvert): Quote the all-completions output | ||
| 4 | (bug#9160). | ||
| 5 | |||
| 1 | 2011-10-17 Martin Rudalics <rudalics@gmx.at> | 6 | 2011-10-17 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * ido.el (ido-default-buffer-method): Remove redundant :type | 8 | * ido.el (ido-default-buffer-method): Remove redundant :type entry. |
| 4 | entry. | ||
| 5 | 9 | ||
| 6 | * menu-bar.el (menu-bar-file-menu): Add entry for making new | 10 | * menu-bar.el (menu-bar-file-menu): Add entry for making new |
| 7 | window on right of selected. (Bug#9350) Reword other window | 11 | window on right of selected. (Bug#9350) Reword other window |
| @@ -14,8 +18,8 @@ | |||
| 14 | 18 | ||
| 15 | 2011-10-15 Chong Yidong <cyd@stupidchicken.com> | 19 | 2011-10-15 Chong Yidong <cyd@stupidchicken.com> |
| 16 | 20 | ||
| 17 | * net/network-stream.el (network-stream-open-starttls): Improve | 21 | * net/network-stream.el (network-stream-open-starttls): |
| 18 | detection of failure due to lack of TLS support. | 22 | Improve detection of failure due to lack of TLS support. |
| 19 | 23 | ||
| 20 | * mail/sendmail.el (sendmail-query-once): Tweak prompt message, | 24 | * mail/sendmail.el (sendmail-query-once): Tweak prompt message, |
| 21 | putting the input text in front and in bold. | 25 | putting the input text in front and in bold. |
diff --git a/lisp/comint.el b/lisp/comint.el index 52580db6186..c3ec17b02f4 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -3079,9 +3079,9 @@ SS1 = (unquote SS2)." | |||
| 3079 | 3079 | ||
| 3080 | (defun comint--table-subvert (table s1 s2 &optional quote-fun unquote-fun) | 3080 | (defun comint--table-subvert (table s1 s2 &optional quote-fun unquote-fun) |
| 3081 | "Completion table that replaces the prefix S1 with S2 in STRING. | 3081 | "Completion table that replaces the prefix S1 with S2 in STRING. |
| 3082 | When TABLE, S1 and S2 are provided by `apply-partially', the result | 3082 | The result is a completion table which completes strings of the |
| 3083 | is a completion table which completes strings of the form (concat S1 S) | 3083 | form (concat S1 S) in the same way as TABLE completes strings of |
| 3084 | in the same way as TABLE completes strings of the form (concat S2 S)." | 3084 | the form (concat S2 S)." |
| 3085 | (lambda (string pred action) | 3085 | (lambda (string pred action) |
| 3086 | (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil | 3086 | (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil |
| 3087 | completion-ignore-case)) | 3087 | completion-ignore-case)) |
| @@ -3106,13 +3106,15 @@ in the same way as TABLE completes strings of the form (concat S2 S)." | |||
| 3106 | ((eq action t) | 3106 | ((eq action t) |
| 3107 | (let ((bounds (completion-boundaries str table pred ""))) | 3107 | (let ((bounds (completion-boundaries str table pred ""))) |
| 3108 | (if (>= (car bounds) (length s2)) | 3108 | (if (>= (car bounds) (length s2)) |
| 3109 | res | 3109 | (if quote-fun (mapcar quote-fun res) res) |
| 3110 | (let ((re (concat "\\`" | 3110 | (let ((re (concat "\\`" |
| 3111 | (regexp-quote (substring s2 (car bounds)))))) | 3111 | (regexp-quote (substring s2 (car bounds)))))) |
| 3112 | (delq nil | 3112 | (delq nil |
| 3113 | (mapcar (lambda (c) | 3113 | (mapcar (lambda (c) |
| 3114 | (if (string-match re c) | 3114 | (if (string-match re c) |
| 3115 | (substring c (match-end 0)))) | 3115 | (let ((str (substring c (match-end 0)))) |
| 3116 | (if quote-fun | ||
| 3117 | (funcall quote-fun str) str)))) | ||
| 3116 | res)))))) | 3118 | res)))))) |
| 3117 | ;; E.g. action=nil and it's the only completion. | 3119 | ;; E.g. action=nil and it's the only completion. |
| 3118 | (res)))))) | 3120 | (res)))))) |