diff options
| author | Stefan Monnier | 2008-04-21 21:16:13 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-04-21 21:16:13 +0000 |
| commit | f50e56f0e13eedd1a75214e680a5066fb77ee05d (patch) | |
| tree | b4d895a6203870c560c3c95f0eabaed563e62200 | |
| parent | 984ddcbcef9ca63d62eeec38f8609b75723ff122 (diff) | |
| download | emacs-f50e56f0e13eedd1a75214e680a5066fb77ee05d.tar.gz emacs-f50e56f0e13eedd1a75214e680a5066fb77ee05d.zip | |
(completion--file-name-table): Accept both the old `dir' or the new `pred' arg.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2008-04-21 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-04-21 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * minibuffer.el (completion--file-name-table): Accept both the old | ||
| 4 | `dir' arg or the new `pred' arg. | ||
| 5 | |||
| 3 | * ffap.el (ffap-read-file-or-url): Do not abuse completing-read's | 6 | * ffap.el (ffap-read-file-or-url): Do not abuse completing-read's |
| 4 | `predicate' argument to pass non-predicate data. | 7 | `predicate' argument to pass non-predicate data. |
| 5 | (ffap-read-url-internal, ffap-read-file-or-url-internal): | 8 | (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'." | |||
| 693 | (substring string beg) | 693 | (substring string beg) |
| 694 | pred action)))) | 694 | pred action)))) |
| 695 | 695 | ||
| 696 | (defun completion--file-name-table (string dir action) | 696 | (defun completion--file-name-table (string pred action) |
| 697 | "Internal subroutine for `read-file-name'. Do not call this." | 697 | "Internal subroutine for `read-file-name'. Do not call this." |
| 698 | (setq dir (expand-file-name dir)) | ||
| 699 | (if (and (zerop (length string)) (eq 'lambda action)) | 698 | (if (and (zerop (length string)) (eq 'lambda action)) |
| 700 | nil ; FIXME: why? | 699 | nil ; FIXME: why? |
| 701 | (let* ((str (condition-case nil | 700 | (let* ((dir (if (stringp pred) |
| 701 | ;; It used to be that `pred' was abused to pass `dir' | ||
| 702 | ;; as an argument. | ||
| 703 | (prog1 (expand-file-name pred) (setq pred nil)) | ||
| 704 | default-directory)) | ||
| 705 | (str (condition-case nil | ||
| 702 | (substitute-in-file-name string) | 706 | (substitute-in-file-name string) |
| 703 | (error string))) | 707 | (error string))) |
| 704 | (name (file-name-nondirectory str)) | 708 | (name (file-name-nondirectory str)) |