# HG changeset patch # User Stefan Monnier # Date 1208812573 0 # Node ID 701d10a19a8ff831c927db97aa1d5f991850fcf1 # Parent 3a71d408918bae55ad257378e730d32995dbcab4 (completion--file-name-table): Accept both the old `dir' or the new `pred' arg. diff -r 3a71d408918b -r 701d10a19a8f lisp/ChangeLog --- a/lisp/ChangeLog Mon Apr 21 21:01:38 2008 +0000 +++ b/lisp/ChangeLog Mon Apr 21 21:16:13 2008 +0000 @@ -1,5 +1,8 @@ 2008-04-21 Stefan Monnier + * 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): diff -r 3a71d408918b -r 701d10a19a8f lisp/minibuffer.el --- a/lisp/minibuffer.el Mon Apr 21 21:01:38 2008 +0000 +++ b/lisp/minibuffer.el Mon Apr 21 21:16:13 2008 +0000 @@ -693,12 +693,16 @@ (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))