From: Stefan Monnier Date: Wed, 22 Mar 2000 03:10:07 +0000 (+0000) Subject: (find-file-run-dired): Update docstring. X-Git-Tag: emacs-pretest-21.0.90~4544 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bfb857d81e8f3c7a1d26202c305bce7ad16dc486;p=emacs.git (find-file-run-dired): Update docstring. (find-directory-functions): New hook. (find-file-noselect): Run find-directory-functions rather than calling dired directly. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4ed3ceeac94..5cd03840fe7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2000-03-21 Stefan Monnier + * files.el (find-file-run-dired): Update docstring. + (find-directory-functions): New hook. + (find-file-noselect): Run find-directory-functions rather than + calling dired directly. + + * menu-bar.el (pcl-cvs): Add an entry for PCL-CVS' global menu. + * pcvs.el: Add a minimal leading commentary. (cvs-make-cvs-buffer): Change the header part by removing the startup 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." :group 'abbrev) (defcustom find-file-run-dired t - "*Non-nil says run dired if `find-file' is given the name of a directory." + "*Non-nil means allow `find-file' to visit directories. +To visit the directory, `find-file' runs `find-directory-functions'." :type 'boolean :group 'find-file) +(defcustom find-directory-functions '(cvs-dired-noselect dired-noselect) + "*List of functions to try in sequence to visit a directory. +Each function is called with the directory name as the sole argument +and should return either a buffer or nil." + :type '(hook :options (cvs-dired-noselect dired-noselect)) + :group 'find-file) + ;;;It is not useful to make this a local variable. ;;;(put 'find-file-not-found-hooks 'permanent-local t) (defvar find-file-not-found-hooks nil @@ -936,11 +944,13 @@ that are visiting the various files." (abbreviate-file-name (expand-file-name filename))) (if (file-directory-p filename) - (if find-file-run-dired - (dired-noselect (if find-file-visit-truename - (abbreviate-file-name (file-truename filename)) - filename)) - (error "%s is a directory" filename)) + (or (and find-file-run-dired + (run-hook-with-args-until-success + 'find-directory-functions + (if find-file-visit-truename + (abbreviate-file-name (file-truename filename)) + filename))) + (error "%s is a directory" filename)) (if (and wildcards find-file-wildcards (not (string-match "\\`/:" filename))