1 ;;; page-ext.el --- extended page handling commands
3 ;; Copyright (C) 1990, 1991, 1993, 1994 Free Software Foundation
5 ;; Maintainer: Robert J. Chassell <bob@gnu.ai.mit.edu>
7 ;; This file is part of XEmacs.
9 ;; XEmacs is free software; you can redistribute it and/or modify it
10 ;; under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; XEmacs is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free
21 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 ;;; Synched up with: FSF 19.34.
28 ;; You may use these commands to handle an address list or other
34 ;; The current page commands are:
37 ;; backward-page C-x [
38 ;; narrow-to-page C-x p
39 ;; count-lines-page C-x l
40 ;; mark-page C-x C-p (change this to C-x C-p C-m)
41 ;; sort-pages not bound
42 ;; what-page not bound
44 ;; The new page handling commands all use `C-x C-p' as a prefix. This
45 ;; means that the key binding for `mark-page' must be changed.
46 ;; Otherwise, no other changes are made to the current commands or
49 ;; New page handling commands:
51 ;; next-page C-x C-p C-n
52 ;; previous-page C-x C-p C-p
53 ;; search-pages C-x C-p C-s
54 ;; add-new-page C-x C-p C-a
55 ;; sort-pages-buffer C-x C-p s
56 ;; set-page-delimiter C-x C-p C-l
57 ;; pages-directory C-x C-p C-d
58 ;; pages-directory-for-addresses C-x C-p d
59 ;; pages-directory-goto C-c C-c
62 ;;; Using the page commands
64 ;; The page commands are helpful in several different contexts. For
65 ;; example, programmers often divide source files into sections using the
66 ;; `page-delimiter'; you can use the `pages-directory' command to list
69 ;; You may change the buffer local value of the `page-delimiter' with
70 ;; the `set-page-delimiter' command. This command is bound to `C-x C-p
71 ;; C-l' The command prompts you for a new value for the page-delimiter.
72 ;; Called with a prefix-arg, the command resets the value of the
73 ;; page-delimiter to its original value.
75 ;; You may set several user options:
77 ;; The `pages-directory-buffer-narrowing-p' variable causes the
78 ;; `pages-directory-goto' command to narrow to the destination page.
80 ;; The `pages-directory-for-adding-page-narrowing-p' variable, causes the
81 ;; `add-new-page' command to narrow to the new entry.
83 ;; The `pages-directory-for-adding-new-page-before-current-page-p' variable
84 ;; causes the `add-new-page' command to insert a new page before current
87 ;; These variables are true by default.
89 ;; Additional, addresses-related user options are described in the next page
93 ;;; Handling an address list or small data base
95 ;; You may use the page commands to handle an address list or other
96 ;; small data base. Put each address or entry on its own page. The
97 ;; first line of text in each page is a `header line' and is listed by
98 ;; the `pages-directory' or `pages-directory-for-addresses' command.
102 ;; 1. Begin each entry with a `page-delimiter' (which is, by default,
103 ;; `^L' at the beginning of the line).
105 ;; 2. The first line of text in each entry is the `heading line'; it
106 ;; will appear in the pages-directory-buffer which is constructed
107 ;; using the `C-x C-p C-d' (pages-directory) command or the `C-x
108 ;; C-p d' (pages-directory-for-addresses) command.
110 ;; The heading line may be on the same line as the page-delimiter
111 ;; or it may follow after. It is the first non-blank line on the
112 ;; page. Conventionally, the heading line is placed on the line
113 ;; immediately following the line containing page-delimiter.
115 ;; 3. Follow the heading line with the body of the entry. The body
116 ;; extends up to the next `page-delimiter'. The body may be of any
117 ;; length. It is conventional to place a blank line after the last
120 ;; For example, a file might look like this:
123 ;; Free Software Foundation
124 ;; 59 Temple Place - Suite 330
125 ;; Boston, MA 02111-1307 USA.
127 ;; gnu@prep.ai.mit.edu
130 ;; House Subcommittee on Intellectual Property,
131 ;; U.S. House of Representatives,
132 ;; Washington, DC 20515
134 ;; Congressional committee concerned with permitting or preventing
135 ;; monopolistic restrictions on the use of software technology.
139 ;; ``Women, Fire, and Dangerous Things:
140 ;; What Categories Reveal about the Mind''
141 ;; 1987, Univ. of Chicago Press
143 ;; About philosophy, Whorfian effects, and linguistics.
146 ;; OBI (On line text collection.)
147 ;; Open Book Initiative
148 ;; c/o Software Tool & Die
149 ;; 1330 Beacon St, Brookline, MA 02146 USA
153 ;; In this example, the heading lines are:
156 ;; House Subcommittee on Intellectual Property
158 ;; OBI (On line text collection.)
160 ;; The `C-x C-p s' (sort-pages-buffer) command sorts the entries in the
161 ;; buffer alphabetically.
163 ;; You may use any of the page commands, including the `next-page',
164 ;; `previous-page', `add-new-page', `mark-page', and `search-pages'
167 ;; You may use either the `C-x C-p d' (pages-directory-for-addresses)
168 ;; or the `C-x C-p C-d' (pages-directory) command to construct and
169 ;; display a directory of all the heading lines.
171 ;; In the directory, you may position the cursor over a heading line
172 ;; and type `C-c C-c' (pages-directory-goto) to go to the entry to
173 ;; which it refers in the pages buffer.
175 ;; You can type `C-c C-p C-a' (add-new-page) to add a new entry in the
176 ;; pages buffer or address file. This is the same command you use to
177 ;; add a new entry when you are in the pages buffer or address file.
179 ;; If you wish, you may create several different directories,
180 ;; one for each different buffer.
182 ;; `pages-directory-for-addresses' in detail
184 ;; The `pages-directory-for-addresses' assumes a default addresses
185 ;; file. You do not need to specify the addresses file but merely type
186 ;; `C-x C-p d' from any buffer. The command finds the file, constructs
187 ;; a directory for it, and switches you to the directory. If you call
188 ;; the command with a prefix arg, `C-u C-x C-p d', it prompts you for a
191 ;; You may customize the addresses commands:
193 ;; The `pages-addresses-file-name' variable determines the name of
194 ;; the addresses file; by default it is "~/addresses".
196 ;; The `pages-directory-for-addresses-goto-narrowing-p' variable
197 ;; determines whether `pages-directory-goto' narrows the addresses
198 ;; buffer to the entry, which it does by default.
200 ;; The `pages-directory-for-addresses-buffer-keep-windows-p' variable
201 ;; determines whether `pages-directory-for-addresses' deletes other
202 ;; windows to show as many lines as possible on the screen or works
203 ;; in the usual Emacs manner and keeps other windows. Default is to
204 ;; keep other windows.
206 ;; The `pages-directory-for-adding-addresses-narrowing-p' variable
207 ;; determines whether `pages-directory-for-addresses' narrows the
208 ;; addresses buffer to a new entry when you are adding that entry.
209 ;; Default is to narrow to new entry, which means you see a blank
210 ;; screen before you write the new entry.
212 ;; `pages-directory' in detail
214 ;; Call the `pages-directory' command from the buffer for which you
215 ;; want a directory created; it creates a directory for the buffer and
216 ;; pops you to the directory.
218 ;; The `pages-directory' command has several options:
220 ;; Called with a prefix arg, `C-u C-x C-p C-d', the `pages-directory'
221 ;; prompts you for a regular expression and only lists only those
222 ;; header lines that are part of pages that contain matches to the
223 ;; regexp. In the example above, `C-u C-x C-p C-d 617 RET' would
224 ;; match the telephone area code of the first and fourth entries, so
225 ;; only the header lines of those two entries would appear in the
226 ;; pages-directory-buffer.
228 ;; Called with a numeric argument, the `pages-directory' command
229 ;; lists the number of lines in each page. This is helpful when you
230 ;; are printing hardcopy.
232 ;; Called with a negative numeric argument, the `pages-directory'
233 ;; command lists the lengths of pages whose contents match a regexp.
238 ;;; Customarily customizable variable definitions
241 "Extended page-handling commands."
245 (defcustom pages-directory-buffer-narrowing-p t
246 "*If non-nil, `pages-directory-goto' narrows pages buffer to entry."
250 (defcustom pages-directory-for-adding-page-narrowing-p t
251 "*If non-nil, `add-new-page' narrows page buffer to new entry."
255 (defcustom pages-directory-for-adding-new-page-before-current-page-p t
256 "*If non-nil, `add-new-page' inserts new page before current page."
261 ;;; Addresses related variables
263 (defcustom pages-addresses-file-name "~/addresses"
264 "*Standard name for file of addresses. Entries separated by page-delimiter.
265 Used by `pages-directory-for-addresses' function."
269 (defcustom pages-directory-for-addresses-goto-narrowing-p t
270 "*If non-nil, `pages-directory-goto' narrows addresses buffer to entry."
274 (defcustom pages-directory-for-addresses-buffer-keep-windows-p t
275 "*If nil, `pages-directory-for-addresses' deletes other windows."
279 (defcustom pages-directory-for-adding-addresses-narrowing-p t
280 "*If non-nil, `add-new-page' narrows addresses buffer to new entry."
285 ;;; Key bindings for page handling functions
287 (global-unset-key "\C-x\C-p")
289 (defvar ctl-x-ctl-p-map (make-sparse-keymap)
290 "Keymap for subcommands of C-x C-p, which are for page handling.")
292 (define-key ctl-x-map "\C-p" 'ctl-x-ctl-p-prefix)
293 (fset 'ctl-x-ctl-p-prefix ctl-x-ctl-p-map)
295 (define-key ctl-x-ctl-p-map "\C-n" 'next-page)
296 (define-key ctl-x-ctl-p-map "\C-p" 'previous-page)
297 (define-key ctl-x-ctl-p-map "\C-a" 'add-new-page)
298 (define-key ctl-x-ctl-p-map "\C-m" 'mark-page)
299 (define-key ctl-x-ctl-p-map "\C-s" 'search-pages)
300 (define-key ctl-x-ctl-p-map "s" 'sort-pages-buffer)
301 (define-key ctl-x-ctl-p-map "\C-l" 'set-page-delimiter)
302 (define-key ctl-x-ctl-p-map "\C-d" 'pages-directory)
303 (define-key ctl-x-ctl-p-map "d" 'pages-directory-for-addresses)
306 ;;; Page movement function definitions
308 (defun next-page (&optional count)
309 "Move to the next page bounded by the `page-delimiter' variable.
310 With arg (prefix if interactive), move that many pages."
312 (or count (setq count 1))
314 ;; Cannot use forward-page because of problems at page boundaries.
315 (while (and (> count 0) (not (eobp)))
316 (if (re-search-forward page-delimiter nil t)
318 (goto-char (point-max)))
319 (setq count (1- count)))
320 ;; If COUNT is negative, we want to go back -COUNT + 1 page boundaries.
321 ;; The first page boundary we reach is the top of the current page,
322 ;; which doesn't count.
323 (while (and (< count 1) (not (bobp)))
324 (if (re-search-backward page-delimiter nil t)
325 (goto-char (match-beginning 0))
326 (goto-char (point-min)))
327 (setq count (1+ count)))
329 (goto-char (point-min))
332 (defun previous-page (&optional count)
333 "Move to the previous page bounded by the `page-delimiter' variable.
334 With arg (prefix if interactive), move that many pages."
336 (or count (setq count 1))
337 (next-page (- count)))
340 ;;; Adding and searching pages
342 (defun add-new-page (header-line)
343 "Insert new page. Prompt for header line.
345 If point is in the pages directory buffer, insert the new page in the
346 buffer associated with the directory.
348 Insert the new page just before current page if
349 pages-directory-for-adding-new-page-before-current-page-p variable
350 is non-nil. Else insert at exact location of point.
352 Narrow to new page if
353 pages-directory-for-adding-page-narrowing-p variable
356 Page begins with a `^L' as the default page-delimiter.
357 Use \\[set-page-delimiter] to change the page-delimiter.
358 Point is left in the body of page."
359 (interactive "sHeader line: ")
361 ;; If in pages directory buffer
362 (if (eq major-mode 'pages-directory-mode)
364 ;; Add new page before or after current page?
365 (if pages-directory-for-adding-new-page-before-current-page-p
366 (pages-directory-goto)
367 (pages-directory-goto)
369 (or (eobp) (forward-line -1)))))
371 ;; Move point before current delimiter if desired.
372 (and pages-directory-for-adding-new-page-before-current-page-p
373 (if (re-search-backward page-delimiter nil t)
374 (goto-char (match-beginning 0))
375 ;; If going to beginning of file, insert a page-delimiter
376 ;; before current first page.
377 (goto-char (point-min))
380 ;; Remove leading `^' from page-delimiter string
381 (if (eq '^ (car (read-from-string page-delimiter)))
382 (substring page-delimiter 1))))
383 (goto-char (point-min))))
384 ;; Insert page delimiter at beginning of line.
385 (if (not (looking-at "^.")) (forward-line 1))
386 (insert (format "%s\n%s\n\n\n"
387 (if (eq '^ (car (read-from-string page-delimiter)))
388 (substring page-delimiter 1))
391 (and pages-directory-for-adding-page-narrowing-p (narrow-to-page)))
393 (defvar pages-last-search nil
394 "Value of last regexp searched for. Initially, nil.")
396 (defun search-pages (regexp)
397 "Search for REGEXP, starting from point, and narrow to page it is in."
400 (format "Search for `%s' (end with RET): "
401 (or pages-last-search "regexp")))))
402 (if (equal regexp "")
403 (setq regexp pages-last-search)
404 (setq pages-last-search regexp))
406 (re-search-forward regexp)
412 (autoload 'sort-subr "sort" "Primary function for sorting." t nil)
414 (defun sort-pages-in-region (reverse beg end)
415 "Sort pages in region alphabetically. Prefix arg means reverse order.
417 Called from a program, there are three arguments:
418 REVERSE (non-nil means reverse order), BEG and END (region to sort)."
420 ;;; This sort function handles ends of pages differently than
421 ;;; `sort-pages' and works better with lists of addresses and similar
426 (narrow-to-region beg end)
427 (goto-char (point-min))
428 ;;; `sort-subr' takes three arguments
431 ;; NEXTRECFUN is called with point at the end of the
432 ;; previous record. It moves point to the start of the
435 (re-search-forward page-delimiter nil t)
436 (skip-chars-forward " \t\n")
439 ;; ENDRECFUN is called with point within the record.
440 ;; It should move point to the end of the record.
442 (if (re-search-forward
446 (goto-char (match-beginning 0))
447 (goto-char (point-max))))))))
449 (defun sort-pages-buffer (&optional reverse)
450 "Sort pages alphabetically in buffer. Prefix arg means reverse order.
451 \(Non-nil arg if not interactive.\)"
454 (or reverse (setq reverse nil))
456 (let ((beginning (point-min))
458 (sort-pages-in-region reverse beginning end)))
461 ;;; Pages directory ancillary definitions
463 (defvar pages-directory-previous-regexp nil
464 "Value of previous regexp used by `pages-directory'.
465 \(This regular expression may be used to select only those pages that
466 contain matches to the regexp.\)")
468 (defvar pages-buffer nil
469 "The buffer for which the pages-directory function creates the directory.")
471 (defvar pages-directory-prefix "*Directory for:"
472 "Prefix of name of temporary buffer for pages-directory.")
474 (defvar pages-pos-list nil
475 "List containing the positions of the pages in the pages-buffer.")
477 (defvar pages-directory-map nil
478 "Keymap for the pages-directory-buffer.")
480 (if pages-directory-map
482 (setq pages-directory-map (make-sparse-keymap))
483 (define-key pages-directory-map "\C-c\C-c"
484 'pages-directory-goto)
485 (define-key pages-directory-map "\C-c\C-p\C-a" 'add-new-page))
487 (defvar original-page-delimiter "^\f"
488 "Default page delimiter.")
490 (defun set-page-delimiter (regexp reset-p)
491 "Set buffer local value of page-delimiter to REGEXP.
492 Called interactively with a prefix argument, reset `page-delimiter' to
495 In a program, non-nil second arg causes first arg to be ignored and
496 resets the page-delimiter to the original value."
499 (if current-prefix-arg
500 (list original-page-delimiter "^\f")
501 (list (read-string "Set page-delimiter to regexp: " page-delimiter)
503 (make-local-variable 'original-page-delimiter)
504 (make-local-variable 'page-delimiter)
505 (setq original-page-delimiter
506 (or original-page-delimiter page-delimiter))
508 (setq page-delimiter regexp)
509 (setq page-delimiter original-page-delimiter))
511 (message "The value of `page-delimiter' is now: %s" page-delimiter)))
514 ;;; Pages directory main definitions
516 (defun pages-directory
517 (pages-list-all-headers-p count-lines-p &optional regexp)
518 "Display a directory of the page headers in a temporary buffer.
519 A header is the first non-blank line after the page-delimiter.
520 \\[pages-directory-mode]
521 You may move point to one of the lines in the temporary buffer,
522 then use \\<pages-directory-goto> to go to the same line in the pages buffer.
526 1. With no prefix arg, display all headers.
528 2. With prefix arg, display the headers of only those pages that
529 contain matches to a regular expression for which you are
532 3. With numeric prefix arg, for every page, print the number of
533 lines within each page.
535 4. With negative numeric prefix arg, for only those pages that
536 match a regular expression, print the number of lines within
539 When called from a program, non-nil first arg means list all headers;
540 non-nil second arg means print numbers of lines in each page; if first
541 arg is nil, optional third arg is regular expression.
543 If the buffer is narrowed, the `pages-directory' command creates a
544 directory for only the accessible portion of the buffer."
547 (cond ((not current-prefix-arg)
549 ((listp current-prefix-arg)
553 (format "Select according to `%s' (end with RET): "
554 (or pages-directory-previous-regexp "regexp")))))
555 ((> (prefix-numeric-value current-prefix-arg) 0)
557 ((< (prefix-numeric-value current-prefix-arg) 0)
561 (format "Select according to `%s' (end with RET): "
562 (or pages-directory-previous-regexp "regexp")))))))
564 (if (equal regexp "")
565 (setq regexp pages-directory-previous-regexp)
566 (setq pages-directory-previous-regexp regexp))
569 (message "Creating directory for: %s "
572 (let ((target-buffer (current-buffer))
573 (pages-directory-buffer
574 (concat pages-directory-prefix " " (buffer-name)))
576 (pages-buffer-original-position (point))
577 (pages-buffer-original-page 0))
579 ;; `with-output-to-temp-buffer' binds the value of the variable
580 ;; `standard-output' to the buffer named as its first argument,
581 ;; but does not switch to that buffer.
582 (with-output-to-temp-buffer pages-directory-buffer
584 (set-buffer standard-output)
585 (pages-directory-mode)
587 "==== Pages Directory: use `C-c C-c' to go to page under cursor. ====" ?\n)
588 (setq pages-buffer target-buffer)
589 (setq pages-pos-list nil))
591 (if pages-list-all-headers-p
593 ;; 1. If no prefix argument, list all headers
595 (goto-char (point-min))
597 ;; (a) Point is at beginning of buffer; but the first
598 ;; page may not begin with a page-delimiter
600 ;; If page delimiter is at beginning of buffer, skip it
601 (if (and (save-excursion
602 (re-search-forward page-delimiter nil t))
603 (= 1 (match-beginning 0)))
604 (goto-char (match-end 0)))
606 (pages-copy-header-and-position count-lines-p))
608 ;; (b) Search within pages buffer for next page-delimiter
609 (while (re-search-forward page-delimiter nil t)
610 (pages-copy-header-and-position count-lines-p)))
612 ;; 2. Else list headers whose pages match regexp.
614 ;; REMOVED save-restriction AND widen FROM HERE
615 (goto-char (point-min))
617 ;; (a) Handle first page
620 ;; search for selection regexp
621 (if (save-excursion (re-search-forward regexp nil t))
622 (pages-copy-header-and-position count-lines-p)))
624 ;; (b) Search for next page-delimiter
625 (while (re-search-forward page-delimiter nil t)
628 ;; search for selection regexp
629 (if (save-excursion (re-search-forward regexp nil t))
630 (pages-copy-header-and-position count-lines-p)
633 (set-buffer standard-output)
634 ;; Put positions in increasing order to go with buffer.
635 (setq pages-pos-list (nreverse pages-pos-list))
637 (message "%d matching lines in: %s"
638 (length pages-pos-list) (buffer-name target-buffer))))
639 (pop-to-buffer pages-directory-buffer)
640 (sit-for 0) ; otherwise forward-line fails if N > window height.
641 (forward-line (if (= 0 pages-buffer-original-page)
643 pages-buffer-original-page))))
645 (defun pages-copy-header-and-position (count-lines-p)
646 "Copy page header and its position to the Pages Directory.
647 Only arg non-nil, count lines in page and insert before header.
648 Used by `pages-directory' function."
650 (let (position line-count)
656 (setq line-count (count-lines (point-min) (point-max))))))
658 ;; Keep track of page for later cursor positioning
659 (if (<= (point) pages-buffer-original-position)
660 (setq pages-buffer-original-page
661 (1+ pages-buffer-original-page)))
664 ;; go to first non-blank char after the page-delimiter
665 (skip-chars-forward " \t\n")
666 ;; set the marker here; this the place to which the
667 ;; `pages-directory-goto' command will go
668 (setq position (make-marker))
669 (set-marker position (point))
670 (let ((start (point))
671 (end (save-excursion (end-of-line) (point))))
672 ;; change to directory buffer
673 (set-buffer standard-output)
674 ;; record page position
675 (setq pages-pos-list (cons position pages-pos-list))
676 ;; insert page header
677 (insert-buffer-substring target-buffer start end))
682 (insert (format "%3d: " line-count))))
687 (defun pages-directory-mode ()
688 "Mode for handling the pages-directory buffer.
690 Move point to one of the lines in this buffer, then use \\[pages-directory-goto] to go
691 to the same line in the pages buffer."
693 (kill-all-local-variables)
694 (use-local-map pages-directory-map)
695 (setq major-mode 'pages-directory-mode)
696 (setq mode-name "Pages-Directory")
697 (make-local-variable 'pages-buffer)
698 (make-local-variable 'pages-pos-list)
699 (make-local-variable 'pages-directory-buffer-narrowing-p))
701 (defun pages-directory-goto ()
702 "Go to the corresponding line in the pages buffer."
704 ;;; This function is mostly a copy of `occur-mode-goto-occurrence'
707 (if (or (not pages-buffer)
708 (not (buffer-name pages-buffer)))
710 (setq pages-buffer nil
712 (error "Buffer in which pages were found is deleted.")))
714 (let* ((pages-number (1- (count-lines (point-min) (point))))
715 (pos (nth pages-number pages-pos-list))
716 (end-of-directory-p (eobp))
717 (narrowing-p pages-directory-buffer-narrowing-p))
718 (pop-to-buffer pages-buffer)
720 (if end-of-directory-p
721 (goto-char (point-max))
722 (goto-char (marker-position pos)))
723 (if narrowing-p (narrow-to-page))))
726 ;;; The `pages-directory-for-addresses' function and ancillary code
728 (defun pages-directory-for-addresses (&optional filename)
729 "Find addresses file and display its directory.
730 By default, create and display directory of `pages-addresses-file-name'.
731 Optional argument is FILENAME. In interactive use, with prefix
732 argument, prompt for file name and provide completion.
734 Move point to one of the lines in the displayed directory,
735 then use \\[pages-directory-goto] to go to the same line
736 in the addresses buffer.
738 If pages-directory-for-addresses-goto-narrowing-p is non-nil,
739 `pages-directory-goto' narrows addresses buffer to entry.
741 If pages-directory-for-addresses-buffer-keep-windows-p is nil,
742 this command deletes other windows when it displays the addresses
746 (list (if current-prefix-arg
747 (read-file-name "Filename: " pages-addresses-file-name))))
750 (message "Creating directory for: %s "
751 (or filename pages-addresses-file-name)))
752 (if (file-exists-p (or filename pages-addresses-file-name))
757 (or filename pages-addresses-file-name))))
759 (pages-directory t nil nil)
760 (pages-directory-address-mode)
761 (setq pages-directory-buffer-narrowing-p
762 pages-directory-for-addresses-goto-narrowing-p)
763 (or pages-directory-for-addresses-buffer-keep-windows-p
764 (delete-other-windows))
766 (goto-char (point-min))
767 (delete-region (point) (save-excursion (end-of-line) (point)))
769 "=== Address List Directory: use `C-c C-c' to go to page under cursor. ===")
770 (set-buffer-modified-p nil)
772 (error "No addresses file found!")))
774 (defun pages-directory-address-mode ()
775 "Mode for handling the Addresses Directory buffer.
777 Move point to one of the lines in this buffer,
778 then use \\[pages-directory-goto] to go
779 to the same line in the pages buffer."
781 (use-local-map pages-directory-map)
782 (setq major-mode 'pages-directory-address-mode)
783 (setq mode-name "Addresses Directory")
784 (make-local-variable 'pages-buffer)
785 (make-local-variable 'pages-pos-list)
786 (make-local-variable 'pages-directory-buffer-narrowing-p))
789 ;;; Place `provide' at end of file.
792 ;;;;;;;;;;;;;;;; end of page-ext.el ;;;;;;;;;;;;;;;;