]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/page-ext.el
Add 2010 to copyright years.
[gnu-emacs] / lisp / textmodes / page-ext.el
index 365ed19d9cecce4bddce18e1ef2e34ba4dc1cf54..a87e7942e9bc0bf27ac1e03ba1fcef36243cc711 100644 (file)
@@ -1,17 +1,18 @@
 ;;; page-ext.el --- extended page handling commands
 
-;; Copyright (C) 1990, 1991, 1993, 1994, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
+;;   2007, 2008, 2009, 2010  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 +20,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:
 
@@ -508,7 +507,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 +565,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 +580,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 +632,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 +640,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.
@@ -737,8 +735,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 +763,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))
@@ -777,7 +774,9 @@ directory."
            (or filename pages-addresses-file-name))))
         (widen)
         (pages-directory t nil nil)
-        (pages-directory-address-mode)
+        ;; 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 pages-directory-buffer-narrowing-p
               pages-directory-for-addresses-goto-narrowing-p)
         (or pages-directory-for-addresses-buffer-keep-windows-p
@@ -802,5 +801,5 @@ to the same line in the pages buffer."
 
 (provide 'page-ext)
 
-;;; arch-tag: 2f311550-c6e0-4458-9c12-7f039c058bdb
+;; arch-tag: 2f311550-c6e0-4458-9c12-7f039c058bdb
 ;;; page-ext.el ends here