:type 'boolean)
(defcustom dired-initial-position-hook nil
- "This hook is used to position the point.
+ "Hook used to position point in a new Dired listing display.
It is run by the function `dired-initial-position'."
:group 'dired
:type 'hook
;; FIXME document whatever dired-x is doing.
(defun dired-initial-position (dirname)
- "Where point should go in a new listing of DIRNAME.
-Point is assumed to be at the beginning of new subdir line.
-It runs the hook `dired-initial-position-hook'."
+ "Return position of point in a new listing of DIRNAME.
+Point is assumed to be at the beginning of a new subdir line.
+Runs the hook `dired-initial-position-hook'."
(end-of-line)
(and (featurep 'dired-x) dired-find-subdir
(dired-goto-subdir dirname))
Each element looks like (FILENAME . POSITION);
visiting file FILENAME goes automatically to position POSITION
rather than the beginning of the buffer.
+A list element can also have the form
+
+ (DIRECTORY (dired-filename . FILENAME))
+
+where DIRECTORY is the name of a directory ending in a slash,
+and FILENAME is the name of a file in that directory. This
+format is used for saving places in Dired buffers, see the
+function `save-place-dired-hook'; the FILENAME is the file
+where point was located in the Dired listing of DIRECTORY
+when the place in that buffer was recorded.
+
This alist is saved between Emacs sessions.")
(defcustom save-place-file (locate-user-emacs-file "places" ".emacs-places")
(declare-function dired-goto-file "dired" (file))
(defun save-place-dired-hook ()
- "Position the point in a Dired buffer."
+ "Position point in a Dired buffer according to its saved place.
+This is run via `dired-initial-position-hook', which see."
(or save-place-loaded (save-place-load-alist-from-file))
(let* ((directory (and (derived-mode-p 'dired-mode)
(boundp 'dired-subdir-alist)