aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-03-22 03:10:07 +0000
committerStefan Monnier2000-03-22 03:10:07 +0000
commitbfb857d81e8f3c7a1d26202c305bce7ad16dc486 (patch)
tree954512653208c4478fb0ed365b4032d96cae303a
parenteccd9bd5a3de69e5752627a7e374bbb421e5d7fe (diff)
downloademacs-bfb857d81e8f3c7a1d26202c305bce7ad16dc486.tar.gz
emacs-bfb857d81e8f3c7a1d26202c305bce7ad16dc486.zip
(find-file-run-dired): Update docstring.
(find-directory-functions): New hook. (find-file-noselect): Run find-directory-functions rather than calling dired directly.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/files.el22
2 files changed, 23 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4ed3ceeac94..5cd03840fe7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
12000-03-21 Stefan Monnier <monnier@cs.yale.edu> 12000-03-21 Stefan Monnier <monnier@cs.yale.edu>
2 2
3 * files.el (find-file-run-dired): Update docstring.
4 (find-directory-functions): New hook.
5 (find-file-noselect): Run find-directory-functions rather than
6 calling dired directly.
7
8 * menu-bar.el (pcl-cvs): Add an entry for PCL-CVS' global menu.
9
3 * pcvs.el: Add a minimal leading commentary. 10 * pcvs.el: Add a minimal leading commentary.
4 (cvs-make-cvs-buffer): Change the header part by removing the startup 11 (cvs-make-cvs-buffer): Change the header part by removing the startup
5 message and adding a `Module' entry. Also replace the FOOTER and 12 message and adding a `Module' entry. Also replace the FOOTER and
diff --git a/lisp/files.el b/lisp/files.el
index 8c2d7806e86..5170bcd11e3 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -274,10 +274,18 @@ Loading an abbrev file sets this to t."
274 :group 'abbrev) 274 :group 'abbrev)
275 275
276(defcustom find-file-run-dired t 276(defcustom find-file-run-dired t
277 "*Non-nil says run dired if `find-file' is given the name of a directory." 277 "*Non-nil means allow `find-file' to visit directories.
278To visit the directory, `find-file' runs `find-directory-functions'."
278 :type 'boolean 279 :type 'boolean
279 :group 'find-file) 280 :group 'find-file)
280 281
282(defcustom find-directory-functions '(cvs-dired-noselect dired-noselect)
283 "*List of functions to try in sequence to visit a directory.
284Each function is called with the directory name as the sole argument
285and should return either a buffer or nil."
286 :type '(hook :options (cvs-dired-noselect dired-noselect))
287 :group 'find-file)
288
281;;;It is not useful to make this a local variable. 289;;;It is not useful to make this a local variable.
282;;;(put 'find-file-not-found-hooks 'permanent-local t) 290;;;(put 'find-file-not-found-hooks 'permanent-local t)
283(defvar find-file-not-found-hooks nil 291(defvar find-file-not-found-hooks nil
@@ -936,11 +944,13 @@ that are visiting the various files."
936 (abbreviate-file-name 944 (abbreviate-file-name
937 (expand-file-name filename))) 945 (expand-file-name filename)))
938 (if (file-directory-p filename) 946 (if (file-directory-p filename)
939 (if find-file-run-dired 947 (or (and find-file-run-dired
940 (dired-noselect (if find-file-visit-truename 948 (run-hook-with-args-until-success
941 (abbreviate-file-name (file-truename filename)) 949 'find-directory-functions
942 filename)) 950 (if find-file-visit-truename
943 (error "%s is a directory" filename)) 951 (abbreviate-file-name (file-truename filename))
952 filename)))
953 (error "%s is a directory" filename))
944 (if (and wildcards 954 (if (and wildcards
945 find-file-wildcards 955 find-file-wildcards
946 (not (string-match "\\`/:" filename)) 956 (not (string-match "\\`/:" filename))