From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Aaron S. Hawley" Newsgroups: gmane.emacs.devel Subject: Re: locate-file-completion-table: Fixed point from lexical-binding? Date: Wed, 22 Feb 2012 12:38:55 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1329938370 24340 80.91.229.3 (22 Feb 2012 19:19:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Feb 2012 19:19:30 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 22 20:19:29 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0Hiq-0005t9-LQ for ged-emacs-devel@m.gmane.org; Wed, 22 Feb 2012 20:19:28 +0100 Original-Received: from localhost ([::1]:54002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0Hip-0001nY-Ev for ged-emacs-devel@m.gmane.org; Wed, 22 Feb 2012 14:19:27 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0G9e-0006gd-8H for emacs-devel@gnu.org; Wed, 22 Feb 2012 12:39:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0G9Z-0004SS-0V for emacs-devel@gnu.org; Wed, 22 Feb 2012 12:39:02 -0500 Original-Received: from mail-bk0-f41.google.com ([209.85.214.41]:36275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0G9Y-0004SI-OR for emacs-devel@gnu.org; Wed, 22 Feb 2012 12:38:56 -0500 Original-Received: by bkty12 with SMTP id y12so395422bkt.0 for ; Wed, 22 Feb 2012 09:38:55 -0800 (PST) Received-SPF: pass (google.com: domain of aaron.s.hawley@gmail.com designates 10.205.124.142 as permitted sender) client-ip=10.205.124.142; Authentication-Results: mr.google.com; spf=pass (google.com: domain of aaron.s.hawley@gmail.com designates 10.205.124.142 as permitted sender) smtp.mail=aaron.s.hawley@gmail.com; dkim=pass header.i=aaron.s.hawley@gmail.com Original-Received: from mr.google.com ([10.205.124.142]) by 10.205.124.142 with SMTP id go14mr15961106bkc.79.1329932335175 (num_hops = 1); Wed, 22 Feb 2012 09:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=huoYqTrF8eIr95vPgYkNVEbtemUoVSINaNL05btnqPE=; b=hOABDpM9YR7li7czaQ2LguS7L+P7xPRmKm4irLte9L2Xgld0IkkERKwIzMk1jEiLXu 7HrK2BZRY+PjkSd1h9KYiaJfrWrKcvW462Yt48nGuusP0TvlO9WazTIZ6bnR9aJqvW1n fylRNANW9aipYDbBHE5+LopNtuf89y/Gw9fhk= Original-Received: by 10.205.124.142 with SMTP id go14mr12851226bkc.79.1329932335056; Wed, 22 Feb 2012 09:38:55 -0800 (PST) Original-Received: by 10.204.248.147 with HTTP; Wed, 22 Feb 2012 09:38:55 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.41 X-Mailman-Approved-At: Wed, 22 Feb 2012 14:19:25 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148710 Archived-At: On 2/20/12, Aaron S. Hawley 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))))