From f50e56f0e13eedd1a75214e680a5066fb77ee05d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 21 Apr 2008 21:16:13 +0000 Subject: [PATCH] (completion--file-name-table): Accept both the old `dir' or the new `pred' arg. --- lisp/ChangeLog | 3 +++ lisp/minibuffer.el | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 00cddb6f17d..5a77a8e7c72 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 65b420bd992..e170e3c8a14 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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)) -- 2.39.2