Function: pages-directory-for-addresses

pages-directory-for-addresses is an interactive and byte-compiled function defined in page-ext.el.gz.

Signature

(pages-directory-for-addresses &optional FILENAME)

Documentation

Find addresses file and display its directory.

By default, create and display directory of pages-addresses-file-name. Optional argument is FILENAME. In interactive use, with prefix argument, prompt for file name and provide completion.

Move point to one of the lines in the displayed directory, then use M-x pages-directory-goto (pages-directory-goto) to go to the same line in the addresses buffer.

If pages-directory-for-addresses-goto-narrowing-p is non-nil, pages-directory-goto narrows addresses buffer to entry.

If pages-directory-for-addresses-buffer-keep-windows-p is nil, this command deletes other windows when it displays the addresses directory.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/page-ext.el.gz
;;; The `pages-directory-for-addresses' function and ancillary code

(defun pages-directory-for-addresses (&optional filename)
  "Find addresses file and display its directory.
By default, create and display directory of `pages-addresses-file-name'.
Optional argument is FILENAME.  In interactive use, with prefix
argument, prompt for file name and provide completion.

Move point to one of the lines in the displayed directory,
then use \\[pages-directory-goto] to go to the same line
in the addresses buffer.

If `pages-directory-for-addresses-goto-narrowing-p' is non-nil,
`pages-directory-goto' narrows addresses buffer to entry.

If `pages-directory-for-addresses-buffer-keep-windows-p' is nil,
this command deletes other windows when it displays the addresses
directory."

  (interactive
   (list (if current-prefix-arg
             (read-file-name "Filename: " pages-addresses-file-name))))

  (if (called-interactively-p 'interactive)
      (message "Creating directory for: %s "
               (or filename pages-addresses-file-name)))
  (if (file-exists-p (or filename pages-addresses-file-name))
      (progn
        (set-buffer
         (find-file-noselect
          (expand-file-name
           (or filename pages-addresses-file-name))))
        (widen)
        (pages-directory t nil nil)
        ;; by RJC, 2006 Jun 11: including this causes failure; it results in
        ;;  the message "Buffer in which pages were found is deleted"
        ;;        (pages-directory-address-mode)
        (setq-local pages-directory-buffer-narrowing-p
                    pages-directory-for-addresses-goto-narrowing-p)
        (or pages-directory-for-addresses-buffer-keep-windows-p
            (delete-other-windows))
        (save-excursion
          (goto-char (point-min))
          (delete-region (point) (line-end-position))
          (insert
           "=== Address List Directory: use `C-c C-c' to go to page under cursor. ===")
          (set-buffer-modified-p nil)
          ))
    (error "No addresses file found!")))