]> git.eshelyaron.com Git - emacs.git/commitdiff
(completion--file-name-table): Accept both the old `dir' or the new `pred' arg.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 21 Apr 2008 21:16:13 +0000 (21:16 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 21 Apr 2008 21:16:13 +0000 (21:16 +0000)
lisp/ChangeLog
lisp/minibuffer.el

index 00cddb6f17d27f4110daa49794697779bb263be1..5a77a8e7c722b17ce7797387f4af4b8cddb9dc54 100644 (file)
@@ -1,5 +1,8 @@
 2008-04-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * minibuffer.el (completion--file-name-table): Accept both the old
+       `dir' arg or the new `pred' arg.
+
        * ffap.el (ffap-read-file-or-url): Do not abuse completing-read's
        `predicate' argument to pass non-predicate data.
        (ffap-read-url-internal, ffap-read-file-or-url-internal):
index 65b420bd9925af453158a7a977ea08aca404469b..e170e3c8a14adcb67ec4a26cd6f124eb9c64a799 100644 (file)
@@ -693,12 +693,16 @@ during running `completion-setup-hook'."
                                      (substring string beg)
                                      pred action))))
 
-(defun completion--file-name-table (string dir action)
+(defun completion--file-name-table (string pred action)
   "Internal subroutine for `read-file-name'.  Do not call this."
-  (setq dir (expand-file-name dir))
   (if (and (zerop (length string)) (eq 'lambda action))
       nil                               ; FIXME: why?
-    (let* ((str (condition-case nil
+    (let* ((dir (if (stringp pred)
+                    ;; It used to be that `pred' was abused to pass `dir'
+                    ;; as an argument.
+                    (prog1 (expand-file-name pred) (setq pred nil))
+                  default-directory))
+           (str (condition-case nil
                     (substitute-in-file-name string)
                   (error string)))
            (name (file-name-nondirectory str))