From: Stefan Monnier Date: Tue, 1 May 2012 00:21:23 +0000 (-0400) Subject: * lisp/minibuffer.el (completion-table-with-quoting): Fix compatibility X-Git-Tag: emacs-24.2.90~471^2~241 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6eac8dc9ac4a6478b88a397a876c272b16c0facc;p=emacs.git * lisp/minibuffer.el (completion-table-with-quoting): Fix compatibility all-completions code to not return a number in the last cdr. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e826aa69fa..7919a9607c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-05-01 Stefan Monnier + + * minibuffer.el (completion-table-with-quoting): Fix compatibility + all-completions code to not return a number in the last cdr. + 2012-04-30 Leo Liu * ibuf-ext.el (ibuffer-diff-buffer-with-file-1): Avoid buffer diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 59bd0d231dc..1d459b0db62 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -420,6 +420,13 @@ for use at QPOS." (length string)))))) (list* 'boundaries qlboundary qrboundary))) + ;; In "normal" use a c-t-with-quoting completion table should never be + ;; called with action in (t nil) because `completion--unquote' should have + ;; been called before and would have returned a different completion table + ;; to apply to the unquoted text. But there's still a lot of code around + ;; that likes to use all/try-completions directly, so we do our best to + ;; handle those calls as well as we can. + ((eq action nil) ;;try-completion (let* ((ustring (funcall unquote string)) (completion (try-completion ustring table pred))) @@ -447,10 +454,14 @@ for use at QPOS." (pcase-let* ((ustring (funcall unquote string)) (completions (all-completions ustring table pred)) - (boundary (car (completion-boundaries ustring table pred "")))) - (completion--twq-all - string ustring completions boundary unquote requote))) - + (boundary (car (completion-boundaries ustring table pred ""))) + (completions + (completion--twq-all + string ustring completions boundary unquote requote)) + (last (last completions))) + (when (consp last) (setcdr last nil)) + completions)) + ((eq action 'completion--unquote) (let ((ustring (funcall unquote string)) (uprefix (funcall unquote (substring string 0 pred))))