emacs-devel
[Top][All Lists]
Advanced

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

patch for locate-file-completion?


From: Nic Ferrier
Subject: patch for locate-file-completion?
Date: 31 Mar 2004 23:31:16 +0100

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





reply via email to

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