From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nic Ferrier Newsgroups: gmane.emacs.devel Subject: patch for locate-file-completion? Date: 31 Mar 2004 23:31:16 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87k7107iob.fsf@tapsellferrier.co.uk> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080772966 24605 80.91.224.253 (31 Mar 2004 22:42:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Mar 2004 22:42:46 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Apr 01 00:42:35 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B8oPr-0002XE-00 for ; Thu, 01 Apr 2004 00:42:35 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B8oPq-00016l-00 for ; Thu, 01 Apr 2004 00:42:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B8oIL-0002nv-4m for emacs-devel@quimby.gnus.org; Wed, 31 Mar 2004 17:34:49 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B8oI8-0002mC-Gi for emacs-devel@gnu.org; Wed, 31 Mar 2004 17:34:36 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B8oFc-0001k1-9S for emacs-devel@gnu.org; Wed, 31 Mar 2004 17:32:38 -0500 Original-Received: from [80.168.156.73] (helo=tf1.tapsellferrier.co.uk) by monty-python.gnu.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1B8oFa-0001ex-8X for emacs-devel@gnu.org; Wed, 31 Mar 2004 17:31:58 -0500 Original-Received: from tf2.tapsellferrier.co.uk ([80.168.156.74] helo=kanga) by tf1.tapsellferrier.co.uk with esmtp (Exim 4.30 #1 (Debian)) id 1B8oF5-0001MM-CO for ; Wed, 31 Mar 2004 23:31:27 +0100 Original-Received: from [127.0.0.1] (helo=kanga ident=nferrier) by kanga with esmtp (Exim 4.30 #1 (Debian)) id 1B8oFH-0004lB-BY for ; Wed, 31 Mar 2004 23:31:39 +0100 Original-To: emacs-devel@gnu.org In-Reply-To: Original-Lines: 43 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21138 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21138 I think locate-file-completion is broken, here's how: M-x load-library somepath-that-should-complete TAB Mine causes an exception because of a nil path element in my load-path. I'm not sure why I've got a nil path element in my load-path but the docs for load-path say it is legal to have a nil element. Apologies if it's not really a problem, if there's some reason for the exception I'd like to know. If not, and there is a problem, here's a patch that fixes it: Index: files.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/files.el,v retrieving revision 1.686 diff -c -r1.686 files.el *** files.el 27 Mar 2004 04:05:23 -0000 1.686 --- files.el 31 Mar 2004 22:26:37 -0000 *************** *** 617,623 **** (string-dir (file-name-directory string))) (dolist (dir (car path-and-suffixes)) (if string-dir (setq dir (expand-file-name string-dir dir))) ! (when (file-directory-p dir) (dolist (file (file-name-all-completions (file-name-nondirectory string) dir)) (push (if string-dir (concat string-dir file) file) names) --- 617,623 ---- (string-dir (file-name-directory string))) (dolist (dir (car path-and-suffixes)) (if string-dir (setq dir (expand-file-name string-dir dir))) ! (when (and dir (file-directory-p dir)) (dolist (file (file-name-all-completions (file-name-nondirectory string) dir)) (push (if string-dir (concat string-dir file) file) names) -- Nic Ferrier http://www.tapsellferrier.co.uk