diff options
| author | Richard M. Stallman | 2002-05-19 15:55:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-05-19 15:55:04 +0000 |
| commit | e6f0ff923303e71a0db0306f403fc507a5608ef7 (patch) | |
| tree | 05d22df9c59bba06513a96c60e9b0077f4aa325d | |
| parent | 4e391653c0184800015f33cda477dc6156c89126 (diff) | |
| download | emacs-e6f0ff923303e71a0db0306f403fc507a5608ef7.tar.gz emacs-e6f0ff923303e71a0db0306f403fc507a5608ef7.zip | |
(locate-file): Doc fix.
| -rw-r--r-- | lisp/files.el | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/lisp/files.el b/lisp/files.el index 3cde660a4b4..2feadc8c121 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -551,11 +551,12 @@ colon-separated list of directories when resolving a relative directory name." | |||
| 551 | If SUFFIXES is non-nil, it should be a list of suffixes to append to | 551 | If SUFFIXES is non-nil, it should be a list of suffixes to append to |
| 552 | file name when searching. If SUFFIXES is nil, it is equivalent to '(\"\"). | 552 | file name when searching. If SUFFIXES is nil, it is equivalent to '(\"\"). |
| 553 | If non-nil, PREDICATE is used instead of `file-readable-p'. | 553 | If non-nil, PREDICATE is used instead of `file-readable-p'. |
| 554 | PREDICATE can also be an integer to pass to the access(2) function, | 554 | PREDICATE can also be an integer to pass to the `access' system call, |
| 555 | in which case file-name-handlers are ignored (this use is deprecated). | 555 | in which case file-name handlers are ignored. This usage is deprecated. |
| 556 | For compatibility with XEmacs, PREDICATE can also be a symbol among | 556 | |
| 557 | `executable', `readable', `writable', or `exists' or a list of one | 557 | For compatibility, PREDICATE can also be one of the symbols |
| 558 | of those symbols." | 558 | `executable', `readable', `writable', or `exists', or a list of |
| 559 | one or more of those symbols." | ||
| 559 | (if (and predicate (symbolp predicate) (not (functionp predicate))) | 560 | (if (and predicate (symbolp predicate) (not (functionp predicate))) |
| 560 | (setq predicate (list predicate))) | 561 | (setq predicate (list predicate))) |
| 561 | (when (and (consp predicate) (not (functionp predicate))) | 562 | (when (and (consp predicate) (not (functionp predicate))) |
| @@ -768,14 +769,32 @@ documentation for additional customization information." | |||
| 768 | (pop-to-buffer buffer t norecord) | 769 | (pop-to-buffer buffer t norecord) |
| 769 | (raise-frame (window-frame (selected-window))))) | 770 | (raise-frame (window-frame (selected-window))))) |
| 770 | 771 | ||
| 772 | (defun find-file-read-args (prompt) | ||
| 773 | (list (let ((find-file-default | ||
| 774 | (and buffer-file-name | ||
| 775 | (abbreviate-file-name buffer-file-name))) | ||
| 776 | (minibuffer-setup-hook | ||
| 777 | '((lambda () | ||
| 778 | (setq minibuffer-default find-file-default) | ||
| 779 | ;; Clear out this hook so it does not interfere | ||
| 780 | ;; with any recursive minibuffer usage. | ||
| 781 | (setq minibuffer-setup-hook nil))))) | ||
| 782 | (read-file-name prompt nil default-directory)) | ||
| 783 | current-prefix-arg)) | ||
| 784 | |||
| 771 | (defun find-file (filename &optional wildcards) | 785 | (defun find-file (filename &optional wildcards) |
| 772 | "Edit file FILENAME. | 786 | "Edit file FILENAME. |
| 773 | Switch to a buffer visiting file FILENAME, | 787 | Switch to a buffer visiting file FILENAME, |
| 774 | creating one if none already exists. | 788 | creating one if none already exists. |
| 789 | Interactively, the default if you just type RET is the current directory, | ||
| 790 | but the visited file name is available through the minibuffer history: | ||
| 791 | type M-n to pull it into the minibuffer. | ||
| 792 | |||
| 775 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, | 793 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, |
| 776 | expand wildcards (if any) and visit multiple files. Wildcard expansion | 794 | expand wildcards (if any) and visit multiple files. Wildcard expansion |
| 777 | can be suppressed by setting `find-file-wildcards'." | 795 | can be suppressed by setting `find-file-wildcards'." |
| 778 | (interactive "FFind file: \np") | 796 | (interactive |
| 797 | (find-file-read-args "Find file: ")) | ||
| 779 | (let ((value (find-file-noselect filename nil nil wildcards))) | 798 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 780 | (if (listp value) | 799 | (if (listp value) |
| 781 | (mapcar 'switch-to-buffer (nreverse value)) | 800 | (mapcar 'switch-to-buffer (nreverse value)) |
| @@ -785,9 +804,14 @@ can be suppressed by setting `find-file-wildcards'." | |||
| 785 | "Edit file FILENAME, in another window. | 804 | "Edit file FILENAME, in another window. |
| 786 | May create a new window, or reuse an existing one. | 805 | May create a new window, or reuse an existing one. |
| 787 | See the function `display-buffer'. | 806 | See the function `display-buffer'. |
| 807 | |||
| 808 | Interactively, the default if you just type RET is the current directory, | ||
| 809 | but the visited file name is available through the minibuffer history: | ||
| 810 | type M-n to pull it into the minibuffer. | ||
| 811 | |||
| 788 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, | 812 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, |
| 789 | expand wildcards (if any) and visit multiple files." | 813 | expand wildcards (if any) and visit multiple files." |
| 790 | (interactive "FFind file in other window: \np") | 814 | (interactive (find-file-read-args "FFind file in other window: ")) |
| 791 | (let ((value (find-file-noselect filename nil nil wildcards))) | 815 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 792 | (if (listp value) | 816 | (if (listp value) |
| 793 | (progn | 817 | (progn |
| @@ -800,9 +824,14 @@ expand wildcards (if any) and visit multiple files." | |||
| 800 | "Edit file FILENAME, in another frame. | 824 | "Edit file FILENAME, in another frame. |
| 801 | May create a new frame, or reuse an existing one. | 825 | May create a new frame, or reuse an existing one. |
| 802 | See the function `display-buffer'. | 826 | See the function `display-buffer'. |
| 827 | |||
| 828 | Interactively, the default if you just type RET is the current directory, | ||
| 829 | but the visited file name is available through the minibuffer history: | ||
| 830 | type M-n to pull it into the minibuffer. | ||
| 831 | |||
| 803 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, | 832 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, |
| 804 | expand wildcards (if any) and visit multiple files." | 833 | expand wildcards (if any) and visit multiple files." |
| 805 | (interactive "FFind file in other frame: \np") | 834 | (interactive (find-file-read-args "FFind file in other frame: ")) |
| 806 | (let ((value (find-file-noselect filename nil nil wildcards))) | 835 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 807 | (if (listp value) | 836 | (if (listp value) |
| 808 | (progn | 837 | (progn |
| @@ -813,9 +842,9 @@ expand wildcards (if any) and visit multiple files." | |||
| 813 | 842 | ||
| 814 | (defun find-file-read-only (filename &optional wildcards) | 843 | (defun find-file-read-only (filename &optional wildcards) |
| 815 | "Edit file FILENAME but don't allow changes. | 844 | "Edit file FILENAME but don't allow changes. |
| 816 | Like `find-file' but marks buffer as read-only. | 845 | Like \\[find-file] but marks buffer as read-only. |
| 817 | Use \\[toggle-read-only] to permit editing." | 846 | Use \\[toggle-read-only] to permit editing." |
| 818 | (interactive "fFind file read-only: \np") | 847 | (interactive (find-file-read-args "fFind file read-only: ")) |
| 819 | (find-file filename wildcards) | 848 | (find-file filename wildcards) |
| 820 | (toggle-read-only 1) | 849 | (toggle-read-only 1) |
| 821 | (current-buffer)) | 850 | (current-buffer)) |
| @@ -824,7 +853,7 @@ Use \\[toggle-read-only] to permit editing." | |||
| 824 | "Edit file FILENAME in another window but don't allow changes. | 853 | "Edit file FILENAME in another window but don't allow changes. |
| 825 | Like \\[find-file-other-window] but marks buffer as read-only. | 854 | Like \\[find-file-other-window] but marks buffer as read-only. |
| 826 | Use \\[toggle-read-only] to permit editing." | 855 | Use \\[toggle-read-only] to permit editing." |
| 827 | (interactive "fFind file read-only other window: \np") | 856 | (interactive (find-file-read-args "fFind file read-only other window: ")) |
| 828 | (find-file-other-window filename wildcards) | 857 | (find-file-other-window filename wildcards) |
| 829 | (toggle-read-only 1) | 858 | (toggle-read-only 1) |
| 830 | (current-buffer)) | 859 | (current-buffer)) |
| @@ -833,7 +862,7 @@ Use \\[toggle-read-only] to permit editing." | |||
| 833 | "Edit file FILENAME in another frame but don't allow changes. | 862 | "Edit file FILENAME in another frame but don't allow changes. |
| 834 | Like \\[find-file-other-frame] but marks buffer as read-only. | 863 | Like \\[find-file-other-frame] but marks buffer as read-only. |
| 835 | Use \\[toggle-read-only] to permit editing." | 864 | Use \\[toggle-read-only] to permit editing." |
| 836 | (interactive "fFind file read-only other frame: \np") | 865 | (interactive (find-file-read-args "fFind file read-only other frame: ")) |
| 837 | (find-file-other-frame filename wildcards) | 866 | (find-file-other-frame filename wildcards) |
| 838 | (toggle-read-only 1) | 867 | (toggle-read-only 1) |
| 839 | (current-buffer)) | 868 | (current-buffer)) |