emacs-devel
[Top][All Lists]
Advanced

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

Re: locate-file-completion-table: Fixed point from lexical-binding?


From: Stefan Monnier
Subject: Re: locate-file-completion-table: Fixed point from lexical-binding?
Date: Thu, 23 Feb 2012 01:27:06 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

> The problem started after revision 103798.  This patch seems to fix
> the issue for me.

Good catch, thank you.  Once again, `setq' bites.

I installed the fix below which should work as well but avoids the use
of setq instead.


        Stefan


=== modified file 'lisp/minibuffer.el'
--- lisp/minibuffer.el  2012-02-15 13:45:02 +0000
+++ lisp/minibuffer.el  2012-02-23 04:31:34 +0000
@@ -226,9 +226,10 @@
 
 (defun completion-table-with-context (prefix table string pred action)
   ;; TODO: add `suffix' maybe?
+  (let ((pred
+         (if (not (functionp pred))
   ;; Notice that `pred' may not be a function in some abusive cases.
-  (when (functionp pred)
-    (setq pred
+             pred
           ;; Predicates are called differently depending on the nature of
           ;; the completion table :-(
           (cond
@@ -240,7 +241,7 @@
             (lambda (s) (funcall pred (concat prefix s))))
            (t                           ;Lists and alists.
             (lambda (s)
-              (funcall pred (concat prefix (if (consp s) (car s) s))))))))
+               (funcall pred (concat prefix (if (consp s) (car s) s)))))))))
   (if (eq (car-safe action) 'boundaries)
       (let* ((len (length prefix))
              (bound (completion-boundaries string table pred (cdr action))))
@@ -249,7 +250,7 @@
       (cond
        ;; In case of try-completion, add the prefix.
        ((stringp comp) (concat prefix comp))
-       (t comp)))))
+         (t comp))))))
 
 (defun completion-table-with-terminator (terminator table string pred action)
   "Construct a completion table like TABLE but with an extra TERMINATOR.




reply via email to

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