Mercurial > emacs
comparison lisp/minibuffer.el @ 94218:701d10a19a8f
(completion--file-name-table): Accept both the old `dir' or the new `pred' arg.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 21 Apr 2008 21:16:13 +0000 |
parents | 81b6ecd7be01 |
children | 3530bf3c1687 |
comparison
equal
deleted
inserted
replaced
94217:3a71d408918b | 94218:701d10a19a8f |
---|---|
691 "}" table))) | 691 "}" table))) |
692 (completion-table-with-context prefix table | 692 (completion-table-with-context prefix table |
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)) |
705 (specdir (file-name-directory str)) | 709 (specdir (file-name-directory str)) |
706 (realdir (if specdir (expand-file-name specdir dir) | 710 (realdir (if specdir (expand-file-name specdir dir) |