]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/reftex-toc.el
Add 2008 to copyright years.
[gnu-emacs] / lisp / textmodes / reftex-toc.el
index 8d2287b51cb183a0c14aefadb7ec5198f380d6f0..0e501fdf23ee1b9ec1d90f0032b79f0833de8342 100644 (file)
@@ -1,6 +1,6 @@
 ;;; reftex-toc.el --- RefTeX's table of contents mode
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005,
-;;   2006, 2007 Free Software Foundation, Inc.
+;;   2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -10,7 +10,7 @@
 
 ;; 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)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -618,7 +618,7 @@ point."
                 nil              ; we have permission, do nothing
               (error "Abort"))   ; abort, we don't have permission
             ;; Do the changes
-            (mapcar 'reftex-toc-promote-action entries)
+            (mapc 'reftex-toc-promote-action entries)
             ;; Rescan the document and rebuilt the toc buffer
             (save-window-excursion
               (reftex-toc-Rescan))
@@ -626,7 +626,7 @@ point."
             (message "%d section%s %smoted" 
                      nsec (if (= 1 nsec) "" "s") pro-or-de)
             nil))
-    (if msg (progn (ding) (message msg)))))
+    (if msg (progn (ding) (message "%s" msg)))))
 
 
 (defun reftex-toc-restore-region (point-line &optional mark-line)
@@ -833,7 +833,7 @@ label prefix determines the wording of a reference."
                     (switch-to-buffer-other-window 
                      (reftex-get-file-buffer-force file nil))
                     (goto-char (if (eq where 'bof) (point-min) (point-max))))
-                (message reftex-no-follow-message) nil))))
+                (message "%s" reftex-no-follow-message) nil))))
 
      ((stringp (car toc))
       ;; a label
@@ -900,7 +900,7 @@ label prefix determines the wording of a reference."
                        (reftex-make-regexp-allow-for-ctrl-m literal) len)
                       (reftex-nearest-match
                        (reftex-make-desperate-section-regexp literal) len)))))
-           (t (message reftex-no-follow-message) nil))))
+           (t (message "%s" reftex-no-follow-message) nil))))
     (when match
       (goto-char (match-beginning 0))
       (if (not (= (point) (point-max))) (recenter 1))
@@ -995,8 +995,11 @@ always show the current section in connection with the option
       (select-frame current-toc-frame)
       (switch-to-buffer "*toc*")
       (select-frame current-frame)
-      (if (fboundp 'focus-frame) (focus-frame current-frame)
-        (if (fboundp 'x-focus-frame) (x-focus-frame current-frame)))
+      (cond ((fboundp 'x-focus-frame)
+             (x-focus-frame current-frame))
+            ((and (featurep 'xemacs) ; `focus-frame' is a nop in Emacs.
+                  (fboundp 'focus-frame))
+             (focus-frame current-frame)))
       (select-window current-window)
       (when (eq reftex-auto-recenter-toc 'frame)
         (unless reftex-toc-auto-recenter-timer