From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jari.aalto@poboxes.com (Jari Aalto+mail.linux) Newsgroups: gmane.emacs.bugs Subject: Re: [patch] 21.3 executable.find - Use cache in `executable-find' Date: Tue, 10 Feb 2004 23:21:17 +0200 Organization: Private Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <8yja1vhu.fsf@blue.sea.net> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1076447541 2126 80.91.224.253 (10 Feb 2004 21:12:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2004 21:12:21 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 10 22:12:06 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AqfAr-0006Gw-00 for ; Tue, 10 Feb 2004 22:12:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aqf9V-00034l-D2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Feb 2004 16:10:41 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aqf9T-00034Q-Ri for bug-gnu-emacs@prep.ai.mit.edu; Tue, 10 Feb 2004 16:10:39 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aqf8x-0002tv-HF for bug-gnu-emacs@prep.ai.mit.edu; Tue, 10 Feb 2004 16:10:38 -0500 Original-Received: from [193.4.58.12] (helo=horus.isnic.is) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1Aqf8s-0002su-SV for bug-gnu-emacs@prep.ai.mit.edu; Tue, 10 Feb 2004 16:10:07 -0500 Original-Received: from smtp33.kolumbus.fi (smtp33.kolumbus.fi [193.229.0.33]) by horus.isnic.is (8.12.9p2/8.12.9/isnic) with ESMTP id i1AL9tgi082841 for ; Tue, 10 Feb 2004 21:09:56 GMT (envelope-from news@phys-news1.kolumbus.fi) Original-Received: from news.kolumbus.fi (news.kolumbus.fi [193.229.0.31]) by smtp33.kolumbus.fi (8.12.10/8.12.4) with ESMTP id i1AL9sWT010100 for ; Tue, 10 Feb 2004 23:09:54 +0200 (EET) Original-Received: (from news@localhost) by news.kolumbus.fi (8.11.6+Sun/8.11.6) id i1AL9r429022 for gnu-emacs-bug@moderators.isc.org; Tue, 10 Feb 2004 23:09:53 +0200 (EET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 39 Original-NNTP-Posting-Host: a110t7.elisa.omakaista.fi Original-X-Trace: phys-news1.kolumbus.fi 1076447393 28676 81.197.3.110 (10 Feb 2004 21:09:53 GMT) Original-X-Complaints-To: abuse@kolumbus.fi Original-NNTP-Posting-Date: Tue, 10 Feb 2004 21:09:53 +0000 (UTC) User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (windows-nt) (i386-msvc-nt5.0.2195) Cancel-Lock: sha1:hM4hHLHz/dF8KfKv20dW8NmbC8o= X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6923 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6923 * Sun 2004-02-08 jari.aalto poboxes.com (Jari Aalto+mail.linux) gnu.emacs.bug * | It is common that searches for programs are done multiple times, so it | would be good if the precious values were cached just like bash does. | Here is patch to make this happen. | | This patch supposes that my other patches have been applied | (See patch to implement `executable-command-find-unix-p') | One small fix needed to get it working. 2004-02-10 Tue Jari Aalto poboxes.com> * progmodes/executable.el (executable-find-cache): Returned (command path), when should have returned path. fixed. Index: executable.el =================================================================== RCS file: /cygdrive/h/data/version-control/cvsroot/emacs/gnu-emacs/lisp213/progmodes/executable.el,v retrieving revision 1.6 retrieving revision 1.7 diff -u -IId: -u -r1.6 -r1.7 --- executable.el 8 Feb 2004 11:30:11 -0000 1.6 +++ executable.el 10 Feb 2004 21:19:06 -0000 1.7 @@ -219,7 +219,9 @@ (defsubst executable-find-cache (command) "Look up COMMAND from `executable-find-cache'." - (assoc command executable-find-cache)) + (let ((elt (assoc command executable-find-cache))) + (when elt + (nth 1 elt)))) ;;;###autoload (defun executable-find-path (command)