aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2002-06-21 08:35:50 +0000
committerAndreas Schwab2002-06-21 08:35:50 +0000
commit05a7cb3dca8adfce64e07f875680b8e15642b22d (patch)
tree45de371df47362382dba006176b2009702579cf2
parent02d709c0e563d6f505f576548422c7912007df8f (diff)
downloademacs-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.el16
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,
819expand wildcards (if any) and visit multiple files. Wildcard expansion 819expand wildcards (if any) and visit multiple files. Wildcard expansion
820can be suppressed by setting `find-file-wildcards'." 820can 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
837Interactively, or if WILDCARDS is non-nil in a call from Lisp, 837Interactively, or if WILDCARDS is non-nil in a call from Lisp,
838expand wildcards (if any) and visit multiple files." 838expand 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
857Interactively, or if WILDCARDS is non-nil in a call from Lisp, 857Interactively, or if WILDCARDS is non-nil in a call from Lisp,
858expand wildcards (if any) and visit multiple files." 858expand 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.
870Like \\[find-file] but marks buffer as read-only. 870Like \\[find-file] but marks buffer as read-only.
871Use \\[toggle-read-only] to permit editing." 871Use \\[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.
879Like \\[find-file-other-window] but marks buffer as read-only. 879Like \\[find-file-other-window] but marks buffer as read-only.
880Use \\[toggle-read-only] to permit editing." 880Use \\[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.
888Like \\[find-file-other-frame] but marks buffer as read-only. 888Like \\[find-file-other-frame] but marks buffer as read-only.
889Use \\[toggle-read-only] to permit editing." 889Use \\[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))