[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: locate-file-completion-table: Fixed point from lexical-binding?
From: |
Aaron S. Hawley |
Subject: |
Re: locate-file-completion-table: Fixed point from lexical-binding? |
Date: |
Wed, 22 Feb 2012 12:38:55 -0500 |
On 2/20/12, Aaron S. Hawley <address@hidden> wrote:
> Using this function and passing a lambda results in a recursive loop
> that runs into the safety limit. It worked in 23.
>
> (locate-file-completion-table
> load-path '("\\.elc\\'" "\\.el\\'") ""
> (lambda (s) (string-match "\\.elc?\\'" s)) t)
> Lisp error: (error "Lisp nesting exceeds `max-lisp-eval-depth'")
The problem started after revision 103798. This patch seems to fix
the issue for me.
--- minibuffer.el
+++ minibuffer.el
@@ -229,6 +229,7 @@
;; Notice that `pred' may not be a function in some abusive cases.
(when (functionp pred)
(setq pred
+ (let ((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))))