]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-file-run-dired): Update docstring.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 22 Mar 2000 03:10:07 +0000 (03:10 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 22 Mar 2000 03:10:07 +0000 (03:10 +0000)
(find-directory-functions): New hook.
(find-file-noselect): Run find-directory-functions rather than
calling dired directly.

lisp/ChangeLog
lisp/files.el

index 4ed3ceeac94a4211a1aa4e3de785d8a8a7190bc4..5cd03840fe78e57749f35a9ac05f78ca5b8447ff 100644 (file)
@@ -1,5 +1,12 @@
 2000-03-21  Stefan Monnier  <monnier@cs.yale.edu>
 
+       * 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
index 8c2d7806e86c421b6298e82963d504b045ddf76f..5170bcd11e302dfb259d9dadf5d8a996dc9c80a7 100644 (file)
@@ -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))