(copyright-update-year): Fix subexpression numbering for the case when
[bpt/emacs.git] / lisp / textmodes / reftex-sel.el
index 3074e83..aadef03 100644 (file)
@@ -1,14 +1,17 @@
 ;;; reftex-sel.el --- the selection modes for RefTeX
-;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
-;; Version: 4.21
+;; Maintainer: auctex-devel@gnu.org
+;; Version: 4.31
 
 ;; This file is part of GNU Emacs.
 
 ;; 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,
@@ -18,8 +21,8 @@
 
 ;; 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., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -415,11 +418,11 @@ During a selection process, these are the local bindings.
           (set-buffer selection-buffer)
           (use-local-map nil)
           (remove-hook 'pre-command-hook 'reftex-select-pre-command-hook t)
-          (remove-hook 'post-command-hook 
+          (remove-hook 'post-command-hook
                        'reftex-select-post-command-hook t))
         ;; Kill the mark overlays
-        (mapcar (lambda (c) (delete-overlay (nth 1 c)))
-                reftex-select-marked)))))
+        (mapc (lambda (c) (reftex-delete-overlay (nth 1 c)))
+              reftex-select-marked)))))
 
     (set (make-local-variable 'reftex-last-line)
          (+ (count-lines (point-min) (point)) (if (bolp) 1 0)))
@@ -604,16 +607,14 @@ Useful for large TOC's."
     (setq boe (or (previous-single-property-change (1+ (point)) :data)
                   (point-min))
           eoe (or (next-single-property-change (point) :data) (point-max)))
-    (setq ovl (make-overlay boe eoe))
+    (setq ovl (reftex-make-overlay boe eoe))
     (push (list data ovl separator) reftex-select-marked)
-    (overlay-put ovl 'face reftex-select-mark-face)
-    (if (featurep 'xemacs)
-        ;; before-string property is broken in Emacs
-        (overlay-put ovl 'before-string
-                     (if separator
-                         (format "*%c%d* " separator
-                                 (length reftex-select-marked))
-                       (format "*%d*  " (length reftex-select-marked)))))
+    (reftex-overlay-put ovl 'face reftex-select-mark-face)
+    (reftex-overlay-put ovl 'before-string
+                        (if separator
+                            (format "*%c%d* " separator
+                                    (length reftex-select-marked))
+                          (format "*%d*  " (length reftex-select-marked))))
     (message "Entry has mark no. %d" (length reftex-select-marked))))
 
 (defun reftex-select-mark-comma ()
@@ -639,19 +640,16 @@ Useful for large TOC's."
          sep)
     (unless cell
       (error "No marked entry at point"))
-    (and ovl (delete-overlay ovl))
+    (and ovl (reftex-delete-overlay ovl))
     (setq reftex-select-marked (delq cell reftex-select-marked))
-    (if (featurep 'xemacs)
-        ;; before-string property is broken in Emacs
-        (progn
-          (setq cnt (1+ (length reftex-select-marked)))
-          (mapcar (lambda (c)
-                    (setq sep (nth 2 c))
-                    (overlay-put (nth 1 c) 'before-string
-                                 (if sep
-                                     (format "*%c%d* " sep (decf cnt))
-                                   (format "*%d*  " (decf cnt)))))
-                  reftex-select-marked)))
+    (setq cnt (1+ (length reftex-select-marked)))
+    (mapc (lambda (c)
+            (setq sep (nth 2 c))
+            (reftex-overlay-put (nth 1 c) 'before-string
+                                (if sep
+                                    (format "*%c%d* " sep (decf cnt))
+                                  (format "*%d*  " (decf cnt)))))
+            reftex-select-marked)
     (message "Entry no longer marked")))
 
 (defun reftex-select-help ()
@@ -689,7 +687,9 @@ Useful for large TOC's."
   ;; The mouse-2 binding
   (if (featurep 'xemacs)
       (define-key map [(button2)] 'reftex-select-mouse-accept)
-    (define-key map [(mouse-2)] 'reftex-select-mouse-accept))
+    (define-key map [(mouse-2)] 'reftex-select-mouse-accept)
+    (define-key map [follow-link] 'mouse-face))
+    
 
   ;; Digit arguments
   (loop for key across "0123456789" do
@@ -725,7 +725,7 @@ Useful for large TOC's."
       (define-key reftex-select-label-map (car x) (cdr x)))
 
 ;; Specific bindings in reftex-select-bib-map
-(loop for key across "grRaA" do
+(loop for key across "grRaAeE" do
       (define-key reftex-select-bib-map (vector (list key))
         (list 'lambda '() 
               "Press `?' during selection to find out about this key."