Convert consecutive FSF copyright years to ranges.
[bpt/emacs.git] / lisp / textmodes / page-ext.el
index 2428287..ed4c598 100644 (file)
@@ -1,17 +1,17 @@
 ;;; page-ext.el --- extended page handling commands
 
-;; Copyright (C) 1990, 1991, 1993, 1994, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1991, 1993-1994, 2001-2011  Free Software Foundation, Inc.
 
-;; Maintainer: Robert J. Chassell <bob@gnu.org>
+;; Author: Robert J. Chassell <bob@gnu.org>
+;; (according to ack.texi)
 ;; Keywords: wp data
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 
 
 (defcustom pages-directory-buffer-narrowing-p t
-  "*If non-nil, `pages-directory-goto' narrows pages buffer to entry."
+  "If non-nil, `pages-directory-goto' narrows pages buffer to entry."
   :type 'boolean
   :group 'pages)
 
 (defcustom pages-directory-for-adding-page-narrowing-p t
-  "*If non-nil, `add-new-page' narrows page buffer to new entry."
+  "If non-nil, `add-new-page' narrows page buffer to new entry."
   :type 'boolean
   :group 'pages)
 
 (defcustom pages-directory-for-adding-new-page-before-current-page-p t
-  "*If non-nil, `add-new-page' inserts new page before current page."
+  "If non-nil, `add-new-page' inserts new page before current page."
   :type 'boolean
   :group 'pages)
 
 ;;; Addresses related variables
 
 (defcustom pages-addresses-file-name "~/addresses"
-  "*Standard name for file of addresses. Entries separated by page-delimiter.
+  "Standard name for file of addresses. Entries separated by page-delimiter.
 Used by `pages-directory-for-addresses' function."
   :type 'file
   :group 'pages)
 
 (defcustom pages-directory-for-addresses-goto-narrowing-p t
-  "*If non-nil, `pages-directory-goto' narrows addresses buffer to entry."
+  "If non-nil, `pages-directory-goto' narrows addresses buffer to entry."
   :type 'boolean
   :group 'pages)
 
 (defcustom pages-directory-for-addresses-buffer-keep-windows-p t
-  "*If nil, `pages-directory-for-addresses' deletes other windows."
+  "If nil, `pages-directory-for-addresses' deletes other windows."
   :type 'boolean
   :group 'pages)
 
 (defcustom pages-directory-for-adding-addresses-narrowing-p t
-  "*If non-nil, `add-new-page' narrows addresses buffer to new entry."
+  "If non-nil, `add-new-page' narrows addresses buffer to new entry."
   :type 'boolean
   :group 'pages)
 
@@ -508,7 +506,7 @@ resets the page-delimiter to the original value."
   (if (not reset-p)
       (setq page-delimiter regexp)
     (setq page-delimiter original-page-delimiter))
-  (if (interactive-p)
+  (if (called-interactively-p 'interactive)
       (message "The value of `page-delimiter' is now: %s" page-delimiter)))
 
 \f
@@ -566,7 +564,7 @@ directory for only the accessible portion of the buffer."
       (setq regexp pages-directory-previous-regexp)
     (setq pages-directory-previous-regexp regexp))
 
-  (if (interactive-p)
+  (if (called-interactively-p 'interactive)
       (message "Creating directory for: %s "
                (buffer-name)))
 
@@ -581,8 +579,7 @@ directory for only the accessible portion of the buffer."
     ;; `standard-output' to the buffer named as its first argument,
     ;; but does not switch to that buffer.
     (with-output-to-temp-buffer pages-directory-buffer
-      (save-excursion
-        (set-buffer standard-output)
+      (with-current-buffer standard-output
         (pages-directory-mode)
         (insert
          "==== Pages Directory: use `C-c C-c' to go to page under cursor. ====" ?\n)
@@ -634,7 +631,7 @@ directory for only the accessible portion of the buffer."
       (set-buffer standard-output)
       ;; Put positions in increasing order to go with buffer.
       (setq pages-pos-list (nreverse pages-pos-list))
-      (if (interactive-p)
+      (if (called-interactively-p 'interactive)
           (message "%d matching lines in: %s"
                    (length pages-pos-list) (buffer-name pages-target-buffer))))
     (pop-to-buffer pages-directory-buffer)
@@ -642,10 +639,10 @@ directory for only the accessible portion of the buffer."
     (forward-line (if (= 0 pages-buffer-original-page)
                       1
                     pages-buffer-original-page))))
-(eval-when-compile
-  (defvar pages-buffer-original-position)
-  (defvar pages-buffer-original-page)
-  (defvar pages-buffer-original-page))
+
+(defvar pages-buffer-original-position)
+(defvar pages-buffer-original-page)
+(defvar pages-buffer-original-page)
 
 (defun pages-copy-header-and-position (count-lines-p)
   "Copy page header and its position to the Pages Directory.
@@ -673,7 +670,7 @@ Used by `pages-directory' function."
       (setq position (make-marker))
       (set-marker position (point))
       (let ((start (point))
-            (end (save-excursion (end-of-line) (point)))
+            (end (line-end-position))
            inserted-at)
         ;; change to directory buffer
         (set-buffer standard-output)
@@ -737,8 +734,7 @@ to the same line in the pages buffer."
 (defun pages-directory-goto-with-mouse  (event)
   "Go to the corresponding line under the mouse pointer in the pages buffer."
   (interactive "e")
-  (save-excursion
-    (set-buffer (window-buffer (posn-window (event-end event))))
+  (with-current-buffer (window-buffer (posn-window (event-end event)))
     (save-excursion
       (goto-char (posn-point (event-end event)))
       (pages-directory-goto))))
@@ -766,7 +762,7 @@ directory."
    (list (if current-prefix-arg
              (read-file-name "Filename: " pages-addresses-file-name))))
 
-  (if (interactive-p)
+  (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))
@@ -786,7 +782,7 @@ directory."
             (delete-other-windows))
         (save-excursion
           (goto-char (point-min))
-          (delete-region (point) (save-excursion (end-of-line) (point)))
+          (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)
@@ -804,5 +800,4 @@ to the same line in the pages buffer."
 
 (provide 'page-ext)
 
-;;; arch-tag: 2f311550-c6e0-4458-9c12-7f039c058bdb
 ;;; page-ext.el ends here