* textmodes/two-column.el (2C-split):
[bpt/emacs.git] / lisp / textmodes / reftex-ref.el
index 0cdc781..0a62027 100644 (file)
@@ -1,7 +1,7 @@
 ;;; reftex-ref.el --- code to create labels and references with RefTeX
 
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -9,10 +9,10 @@
 
 ;; 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 3, 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
@@ -20,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:
 
@@ -80,8 +78,7 @@ If optional BOUND is an integer, limit backward searches to that point."
                file (not (eq t reftex-keep-temporary-buffers)))))
     (if (not buf)
         (list label typekey "" file comment "LOST LABEL.  RESCAN TO FIX.")
-      (save-excursion
-        (set-buffer buf)
+      (with-current-buffer buf
         (save-restriction
           (widen)
           (goto-char 1)
@@ -538,14 +535,12 @@ When called with 2 C-u prefix args, disable magic word recognition."
               (delete-other-windows)
               (setq reftex-call-back-to-this-buffer buf
                     reftex-latex-syntax-table (syntax-table))
-              (let ((default-major-mode 'reftex-select-label-mode))
-                (if reftex-use-multiple-selection-buffers
-                    (switch-to-buffer-other-window
-                     (save-excursion
-                       (set-buffer buf)
-                       (reftex-make-selection-buffer-name typekey)))
-                  (switch-to-buffer-other-window "*RefTeX Select*")
-                  (reftex-erase-buffer)))
+              (if reftex-use-multiple-selection-buffers
+                  (switch-to-buffer-other-window
+                   (with-current-buffer buf
+                     (reftex-make-selection-buffer-name typekey)))
+                (switch-to-buffer-other-window "*RefTeX Select*")
+                (reftex-erase-buffer))
               (unless (eq major-mode 'reftex-select-label-mode)
                 (reftex-select-label-mode))
               (add-to-list 'selection-buffers (current-buffer))
@@ -848,5 +843,5 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window."
 
 
 
-;;; arch-tag: 52f14032-fb76-4d31-954f-750c72415675
+;; arch-tag: 52f14032-fb76-4d31-954f-750c72415675
 ;;; reftex-ref.el ends here