• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/textmodes/

Lines Matching +defs:file +defs:name +defs:directory

9 ;; This file is part of GNU Emacs.
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
58 ;; pages-directory C-x C-p C-d
59 ;; pages-directory-for-addresses C-x C-p d
60 ;; pages-directory-goto C-c C-c
68 ;; `page-delimiter'; you can use the `pages-directory' command to list
79 ;; The `pages-directory-buffer-narrowing-p' variable causes the
80 ;; `pages-directory-goto' command to narrow to the destination page.
82 ;; The `pages-directory-for-adding-page-narrowing-p' variable, causes the
85 ;; The `pages-directory-for-adding-new-page-before-current-page-p' variable
92 ;; of this file.
101 ;; the `pages-directory' or `pages-directory-for-addresses' command.
109 ;; will appear in the pages-directory-buffer which is constructed
110 ;; using the `C-x C-p C-d' (pages-directory) command or the `C-x
111 ;; C-p d' (pages-directory-for-addresses) command.
123 ;; For example, a file might look like this:
173 ;; You may use either the `C-x C-p d' (pages-directory-for-addresses)
174 ;; or the `C-x C-p C-d' (pages-directory) command to construct and
175 ;; display a directory of all the heading lines.
177 ;; In the directory, you may position the cursor over a heading line
178 ;; and type `C-c C-c' (pages-directory-goto) to go to the entry to
182 ;; pages buffer or address file. This is the same command you use to
183 ;; add a new entry when you are in the pages buffer or address file.
188 ;; `pages-directory-for-addresses' in detail
190 ;; The `pages-directory-for-addresses' assumes a default addresses
191 ;; file. You do not need to specify the addresses file but merely type
192 ;; `C-x C-p d' from any buffer. The command finds the file, constructs
193 ;; a directory for it, and switches you to the directory. If you call
195 ;; file name.
199 ;; The `pages-addresses-file-name' variable determines the name of
200 ;; the addresses file; by default it is "~/addresses".
202 ;; The `pages-directory-for-addresses-goto-narrowing-p' variable
203 ;; determines whether `pages-directory-goto' narrows the addresses
206 ;; The `pages-directory-for-addresses-buffer-keep-windows-p' variable
207 ;; determines whether `pages-directory-for-addresses' deletes other
212 ;; The `pages-directory-for-adding-addresses-narrowing-p' variable
213 ;; determines whether `pages-directory-for-addresses' narrows the
218 ;; `pages-directory' in detail
220 ;; Call the `pages-directory' command from the buffer for which you
221 ;; want a directory created; it creates a directory for the buffer and
222 ;; pops you to the directory.
224 ;; The `pages-directory' command has several options:
226 ;; Called with a prefix arg, `C-u C-x C-p C-d', the `pages-directory'
232 ;; pages-directory-buffer.
234 ;; Called with a numeric argument, the `pages-directory' command
238 ;; Called with a negative numeric argument, the `pages-directory'
252 (defcustom pages-directory-buffer-narrowing-p t
253 "*If non-nil, `pages-directory-goto' narrows pages buffer to entry."
257 (defcustom pages-directory-for-adding-page-narrowing-p t
262 (defcustom pages-directory-for-adding-new-page-before-current-page-p t
271 (defcustom pages-addresses-file-name "~/addresses"
272 "*Standard name for file of addresses. Entries separated by page-delimiter.
273 Used by `pages-directory-for-addresses' function."
274 :type 'file
277 (defcustom pages-directory-for-addresses-goto-narrowing-p t
278 "*If non-nil, `pages-directory-goto' narrows addresses buffer to entry."
282 (defcustom pages-directory-for-addresses-buffer-keep-windows-p t
283 "*If nil, `pages-directory-for-addresses' deletes other windows."
287 (defcustom pages-directory-for-adding-addresses-narrowing-p t
311 (define-key ctl-x-ctl-p-map "\C-d" 'pages-directory)
312 (define-key ctl-x-ctl-p-map "d" 'pages-directory-for-addresses)
356 If point is in the pages directory buffer, insert the new page in the
357 buffer associated with the directory.
360 pages-directory-for-adding-new-page-before-current-page-p variable
364 pages-directory-for-adding-page-narrowing-p variable
372 ;; If in pages directory buffer
373 (if (eq major-mode 'pages-directory-mode)
376 (if pages-directory-for-adding-new-page-before-current-page-p
377 (pages-directory-goto)
378 (pages-directory-goto)
383 (and pages-directory-for-adding-new-page-before-current-page-p
386 ;; If going to beginning of file, insert a page-delimiter
402 (and pages-directory-for-adding-page-narrowing-p (narrow-to-page)))
474 ;;; Pages directory ancillary definitions
476 (defvar pages-directory-previous-regexp nil
477 "Value of previous regexp used by `pages-directory'.
482 "The buffer for which the pages-directory function creates the directory.")
484 (defvar pages-directory-prefix "*Directory for:"
485 "Prefix of name of temporary buffer for pages-directory.")
492 (defvar pages-directory-mode-map
494 (define-key map "\C-c\C-c" 'pages-directory-goto)
496 (define-key map [mouse-2] 'pages-directory-goto-with-mouse)
498 "Keymap for the pages-directory-buffer.")
499 (defvaralias 'pages-directory-map 'pages-directory-mode-map)
529 ;;; Pages directory main definitions
531 (defun pages-directory
533 "Display a directory of the page headers in a temporary buffer.
535 \\[pages-directory-mode]
537 then use \\<pages-directory-goto> to go to the same line in the pages buffer.
558 If the buffer is narrowed, the `pages-directory' command creates a
559 directory for only the accessible portion of the buffer."
569 (or pages-directory-previous-regexp "regexp")))))
577 (or pages-directory-previous-regexp "regexp")))))))
580 (setq regexp pages-directory-previous-regexp)
581 (setq pages-directory-previous-regexp regexp))
584 (message "Creating directory for: %s "
585 (buffer-name)))
588 (pages-directory-buffer
589 (concat pages-directory-prefix " " (buffer-name)))
597 (with-output-to-temp-buffer pages-directory-buffer
600 (pages-directory-mode)
653 (length pages-pos-list) (buffer-name pages-target-buffer))))
654 (pop-to-buffer pages-directory-buffer)
667 Used by `pages-directory' function."
686 ;; `pages-directory-goto' command will go
692 ;; change to directory buffer
712 (defun pages-directory-mode ()
713 "Mode for handling the pages-directory buffer.
715 Move point to one of the lines in this buffer, then use \\[pages-directory-goto] to go
719 (use-local-map pages-directory-mode-map)
720 (setq major-mode 'pages-directory-mode)
721 (setq mode-name "Pages-Directory")
724 (make-local-variable 'pages-directory-buffer-narrowing-p)
725 (run-mode-hooks 'pages-directory-mode-hook))
727 (defun pages-directory-goto ()
734 (not (buffer-name pages-buffer)))
742 (end-of-directory-p (eobp))
743 (narrowing-p pages-directory-buffer-narrowing-p))
746 (if end-of-directory-p
751 (defun pages-directory-goto-with-mouse (event)
758 (pages-directory-goto))))
761 ;;; The `pages-directory-for-addresses' function and ancillary code
763 (defun pages-directory-for-addresses (&optional filename)
764 "Find addresses file and display its directory.
765 By default, create and display directory of `pages-addresses-file-name'.
767 argument, prompt for file name and provide completion.
769 Move point to one of the lines in the displayed directory,
770 then use \\[pages-directory-goto] to go to the same line
773 If pages-directory-for-addresses-goto-narrowing-p is non-nil,
774 `pages-directory-goto' narrows addresses buffer to entry.
776 If pages-directory-for-addresses-buffer-keep-windows-p is nil,
778 directory."
782 (read-file-name "Filename: " pages-addresses-file-name))))
785 (message "Creating directory for: %s "
786 (or filename pages-addresses-file-name)))
787 (if (file-exists-p (or filename pages-addresses-file-name))
790 (find-file-noselect
791 (expand-file-name
792 (or filename pages-addresses-file-name))))
794 (pages-directory t nil nil)
797 ;; (pages-directory-address-mode)
798 (setq pages-directory-buffer-narrowing-p
799 pages-directory-for-addresses-goto-narrowing-p)
800 (or pages-directory-for-addresses-buffer-keep-windows-p
809 (error "No addresses file found!")))
811 (define-derived-mode pages-directory-address-mode pages-directory-mode
816 then use \\[pages-directory-goto] to go