diff options
| author | Andreas Schwab | 2002-06-21 08:35:50 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2002-06-21 08:35:50 +0000 |
| commit | 05a7cb3dca8adfce64e07f875680b8e15642b22d (patch) | |
| tree | 45de371df47362382dba006176b2009702579cf2 | |
| parent | 02d709c0e563d6f505f576548422c7912007df8f (diff) | |
| download | emacs-05a7cb3dca8adfce64e07f875680b8e15642b22d.tar.gz emacs-05a7cb3dca8adfce64e07f875680b8e15642b22d.zip | |
(find-file-read-args): Add new argument `mustmatch' and
pass it down to read-file-name.
(find-file, find-file-other-window, find-file-other-frame)
(find-file-read-only, find-file-read-only-other-window)
(find-file-read-only-other-frame): Use it and fix prompts.
| -rw-r--r-- | lisp/files.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/files.el b/lisp/files.el index 3a6ace430c9..fc92d94825c 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -791,7 +791,7 @@ documentation for additional customization information." | |||
| 791 | (defvar find-file-default nil | 791 | (defvar find-file-default nil |
| 792 | "Used within `find-file-read-args'.") | 792 | "Used within `find-file-read-args'.") |
| 793 | 793 | ||
| 794 | (defun find-file-read-args (prompt) | 794 | (defun find-file-read-args (prompt mustmatch) |
| 795 | (list (let ((find-file-default | 795 | (list (let ((find-file-default |
| 796 | (and buffer-file-name | 796 | (and buffer-file-name |
| 797 | (abbreviate-file-name buffer-file-name))) | 797 | (abbreviate-file-name buffer-file-name))) |
| @@ -804,7 +804,7 @@ documentation for additional customization information." | |||
| 804 | (minibuffer-setup-hook | 804 | (minibuffer-setup-hook |
| 805 | minibuffer-setup-hook)) | 805 | minibuffer-setup-hook)) |
| 806 | (add-hook 'minibuffer-setup-hook munge-default-fun) | 806 | (add-hook 'minibuffer-setup-hook munge-default-fun) |
| 807 | (read-file-name prompt nil default-directory)) | 807 | (read-file-name prompt nil default-directory mustmatch)) |
| 808 | current-prefix-arg)) | 808 | current-prefix-arg)) |
| 809 | 809 | ||
| 810 | (defun find-file (filename &optional wildcards) | 810 | (defun find-file (filename &optional wildcards) |
| @@ -819,7 +819,7 @@ Interactively, or if WILDCARDS is non-nil in a call from Lisp, | |||
| 819 | expand wildcards (if any) and visit multiple files. Wildcard expansion | 819 | expand wildcards (if any) and visit multiple files. Wildcard expansion |
| 820 | can be suppressed by setting `find-file-wildcards'." | 820 | can be suppressed by setting `find-file-wildcards'." |
| 821 | (interactive | 821 | (interactive |
| 822 | (find-file-read-args "Find file: ")) | 822 | (find-file-read-args "Find file: " nil)) |
| 823 | (let ((value (find-file-noselect filename nil nil wildcards))) | 823 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 824 | (if (listp value) | 824 | (if (listp value) |
| 825 | (mapcar 'switch-to-buffer (nreverse value)) | 825 | (mapcar 'switch-to-buffer (nreverse value)) |
| @@ -836,7 +836,7 @@ type M-n to pull it into the minibuffer. | |||
| 836 | 836 | ||
| 837 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, | 837 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, |
| 838 | expand wildcards (if any) and visit multiple files." | 838 | expand wildcards (if any) and visit multiple files." |
| 839 | (interactive (find-file-read-args "FFind file in other window: ")) | 839 | (interactive (find-file-read-args "Find file in other window: " nil)) |
| 840 | (let ((value (find-file-noselect filename nil nil wildcards))) | 840 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 841 | (if (listp value) | 841 | (if (listp value) |
| 842 | (progn | 842 | (progn |
| @@ -856,7 +856,7 @@ type M-n to pull it into the minibuffer. | |||
| 856 | 856 | ||
| 857 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, | 857 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, |
| 858 | expand wildcards (if any) and visit multiple files." | 858 | expand wildcards (if any) and visit multiple files." |
| 859 | (interactive (find-file-read-args "FFind file in other frame: ")) | 859 | (interactive (find-file-read-args "Find file in other frame: " nil)) |
| 860 | (let ((value (find-file-noselect filename nil nil wildcards))) | 860 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 861 | (if (listp value) | 861 | (if (listp value) |
| 862 | (progn | 862 | (progn |
| @@ -869,7 +869,7 @@ expand wildcards (if any) and visit multiple files." | |||
| 869 | "Edit file FILENAME but don't allow changes. | 869 | "Edit file FILENAME but don't allow changes. |
| 870 | Like \\[find-file] but marks buffer as read-only. | 870 | Like \\[find-file] but marks buffer as read-only. |
| 871 | Use \\[toggle-read-only] to permit editing." | 871 | Use \\[toggle-read-only] to permit editing." |
| 872 | (interactive (find-file-read-args "fFind file read-only: ")) | 872 | (interactive (find-file-read-args "Find file read-only: " t)) |
| 873 | (find-file filename wildcards) | 873 | (find-file filename wildcards) |
| 874 | (toggle-read-only 1) | 874 | (toggle-read-only 1) |
| 875 | (current-buffer)) | 875 | (current-buffer)) |
| @@ -878,7 +878,7 @@ Use \\[toggle-read-only] to permit editing." | |||
| 878 | "Edit file FILENAME in another window but don't allow changes. | 878 | "Edit file FILENAME in another window but don't allow changes. |
| 879 | Like \\[find-file-other-window] but marks buffer as read-only. | 879 | Like \\[find-file-other-window] but marks buffer as read-only. |
| 880 | Use \\[toggle-read-only] to permit editing." | 880 | Use \\[toggle-read-only] to permit editing." |
| 881 | (interactive (find-file-read-args "fFind file read-only other window: ")) | 881 | (interactive (find-file-read-args "Find file read-only other window: " t)) |
| 882 | (find-file-other-window filename wildcards) | 882 | (find-file-other-window filename wildcards) |
| 883 | (toggle-read-only 1) | 883 | (toggle-read-only 1) |
| 884 | (current-buffer)) | 884 | (current-buffer)) |
| @@ -887,7 +887,7 @@ Use \\[toggle-read-only] to permit editing." | |||
| 887 | "Edit file FILENAME in another frame but don't allow changes. | 887 | "Edit file FILENAME in another frame but don't allow changes. |
| 888 | Like \\[find-file-other-frame] but marks buffer as read-only. | 888 | Like \\[find-file-other-frame] but marks buffer as read-only. |
| 889 | Use \\[toggle-read-only] to permit editing." | 889 | Use \\[toggle-read-only] to permit editing." |
| 890 | (interactive (find-file-read-args "fFind file read-only other frame: ")) | 890 | (interactive (find-file-read-args "Find file read-only other frame: " t)) |
| 891 | (find-file-other-frame filename wildcards) | 891 | (find-file-other-frame filename wildcards) |
| 892 | (toggle-read-only 1) | 892 | (toggle-read-only 1) |
| 893 | (current-buffer)) | 893 | (current-buffer)) |