emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-global.el


From: Carsten Dominik
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/reftex-global.el
Date: Fri, 16 Sep 2005 06:01:36 -0400

Index: emacs/lisp/textmodes/reftex-global.el
diff -c emacs/lisp/textmodes/reftex-global.el:1.23 
emacs/lisp/textmodes/reftex-global.el:1.24
*** emacs/lisp/textmodes/reftex-global.el:1.23  Wed Aug 31 10:29:27 2005
--- emacs/lisp/textmodes/reftex-global.el       Fri Sep 16 10:01:33 2005
***************
*** 1,10 ****
  ;;; reftex-global.el --- operations on entire documents with RefTeX
! 
! ;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004,
! ;;   2005 Free Software Foundation, Inc.
  
  ;; Author: Carsten Dominik <address@hidden>
! ;; Version: 4.28
  
  ;; This file is part of GNU Emacs.
  
--- 1,9 ----
  ;;; reftex-global.el --- operations on entire documents with RefTeX
! ;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004, 2005
! ;;  Free Software Foundation, Inc.
  
  ;; Author: Carsten Dominik <address@hidden>
! ;; Version: VERSIONTAG
  
  ;; This file is part of GNU Emacs.
  
***************
*** 20,27 ****
  
  ;; 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.
  
  ;;; Commentary:
  
--- 19,26 ----
  
  ;; 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.
  
  ;;; Commentary:
  
***************
*** 32,40 ****
  (require 'reftex)
  ;;;
  
- (defvar isearch-next-buffer-function)
- (defvar TeX-master)
- 
  (defun reftex-create-tags-file ()
    "Create TAGS file by running `etags' on the current document.
  The TAGS file is also immediately visited with `visit-tags-table'."
--- 31,36 ----
***************
*** 103,108 ****
--- 99,108 ----
      (tags-query-replace from to (or delimited current-prefix-arg)
                          (list 'reftex-all-document-files))))
  
+ (eval-when-compile
+   (defvar TeX-master)
+   (defvar isearch-next-buffer-function))
+ 
  (defun reftex-find-duplicate-labels ()
    "Produce a list of all duplicate labels in the document."
  
***************
*** 140,146 ****
      (set (make-local-variable 'TeX-master) master)
      (erase-buffer)
      (insert "                MULTIPLE LABELS IN CURRENT DOCUMENT:\n")
!     (insert
       " Move point to label and type `r' to run a query-replace on the label\n"
       " and its references.  Type `q' to exit this buffer.\n\n")
      (insert " LABEL               FILE\n")
--- 140,146 ----
      (set (make-local-variable 'TeX-master) master)
      (erase-buffer)
      (insert "                MULTIPLE LABELS IN CURRENT DOCUMENT:\n")
!     (insert 
       " Move point to label and type `r' to run a query-replace on the label\n"
       " and its references.  Type `q' to exit this buffer.\n\n")
      (insert " LABEL               FILE\n")
***************
*** 198,205 ****
             (not (yes-or-no-p "Replacing all simple labels in multiple files 
is risky.  Continue? ")))
        (error "Abort"))
    ;; Make the translation list
!   (let* ((re-core (concat "\\("
!                           (mapconcat 'cdr reftex-typekey-to-prefix-alist 
"\\|")
                            "\\)"))
           (label-re (concat "\\`" re-core "\\([0-9]+\\)\\'"))
           (search-re (concat "[{,]\\(" re-core "\\([0-9]+\\)\\)[,}]"))
--- 198,205 ----
             (not (yes-or-no-p "Replacing all simple labels in multiple files 
is risky.  Continue? ")))
        (error "Abort"))
    ;; Make the translation list
!   (let* ((re-core (concat "\\(" 
!                           (mapconcat 'cdr reftex-typekey-to-prefix-alist 
"\\|") 
                            "\\)"))
           (label-re (concat "\\`" re-core "\\([0-9]+\\)\\'"))
           (search-re (concat "[{,]\\(" re-core "\\([0-9]+\\)\\)[,}]"))
***************
*** 232,242 ****
      (reftex-save-all-document-buffers)
  
      ;; First test to check for erros
!     (setq n (reftex-translate
               files search-re translate-alist error-fmt 'test))
  
      ;; Now the real thing.
!     (if (yes-or-no-p
           (format "Replace %d items at %d places in %d files? "
                   (length translate-alist) n (length files)))
          (progn
--- 232,242 ----
      (reftex-save-all-document-buffers)
  
      ;; First test to check for erros
!     (setq n (reftex-translate 
               files search-re translate-alist error-fmt 'test))
  
      ;; Now the real thing.
!     (if (yes-or-no-p 
           (format "Replace %d items at %d places in %d files? "
                   (length translate-alist) n (length files)))
          (progn
***************
*** 254,262 ****
  
  (defun reftex-translate (files search-re translate-alist error-fmt test)
    ;; In FILES, look for SEARCH-RE and replace match 1 of it with
!   ;; its association in TRANSLATE-ALSIT.
    ;; If we do not find an association and TEST is non-nil, query
!   ;; to ignore the problematic string.
    ;; If TEST is nil, it is ignored without query.
    ;; Return the number of replacements.
    (let ((n 0) file label match-data buf macro pos cell)
--- 254,262 ----
  
  (defun reftex-translate (files search-re translate-alist error-fmt test)
    ;; In FILES, look for SEARCH-RE and replace match 1 of it with
!   ;; its association in TRANSLATE-ALSIT.  
    ;; If we do not find an association and TEST is non-nil, query
!   ;; to ignore the problematic string.  
    ;; If TEST is nil, it is ignored without query.
    ;; Return the number of replacements.
    (let ((n 0) file label match-data buf macro pos cell)
***************
*** 282,288 ****
                           (or (looking-at "\\\\ref")
                               (looking-at 
"\\\\[a-zA-Z]*ref\\(range\\)?[^a-zA-Z]")
                               (looking-at "\\\\ref[a-zA-Z]*[^a-zA-Z]")
!                              (looking-at (format
                                            reftex-find-label-regexp-format
                                            (regexp-quote label)))))
                  ;; OK, we should replace it.
--- 282,288 ----
                           (or (looking-at "\\\\ref")
                               (looking-at 
"\\\\[a-zA-Z]*ref\\(range\\)?[^a-zA-Z]")
                               (looking-at "\\\\ref[a-zA-Z]*[^a-zA-Z]")
!                              (looking-at (format 
                                            reftex-find-label-regexp-format
                                            (regexp-quote label)))))
                  ;; OK, we should replace it.
***************
*** 345,351 ****
  
  (defun reftex-isearch-wrap-function ()
    (if (not isearch-word)
!       (switch-to-buffer
         (funcall isearch-next-buffer-function (current-buffer) t)))
    (goto-char (if isearch-forward (point-min) (point-max))))
  
--- 345,351 ----
  
  (defun reftex-isearch-wrap-function ()
    (if (not isearch-word)
!       (switch-to-buffer 
         (funcall isearch-next-buffer-function (current-buffer) t)))
    (goto-char (if isearch-forward (point-min) (point-max))))
  
***************
*** 431,437 ****
  `reftex-isearch-minor-mode' on iff ARG is positive."
    (interactive "P")
    (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode))
!     (setq reftex-isearch-minor-mode
          (not (or (and (null arg) reftex-isearch-minor-mode)
                   (<= (prefix-numeric-value arg) 0))))
      (unless (eq reftex-isearch-minor-mode old-reftex-isearch-minor-mode)
--- 431,437 ----
  `reftex-isearch-minor-mode' on iff ARG is positive."
    (interactive "P")
    (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode))
!     (setq reftex-isearch-minor-mode 
          (not (or (and (null arg) reftex-isearch-minor-mode)
                   (<= (prefix-numeric-value arg) 0))))
      (unless (eq reftex-isearch-minor-mode old-reftex-isearch-minor-mode)
***************
*** 462,468 ****
      ;; Force modeline redisplay.
      (set-buffer-modified-p (buffer-modified-p))))
  
! (add-minor-mode 'reftex-isearch-minor-mode "/I" nil nil
                'reftex-isearch-minor-mode)
  
  ;;; arch-tag: 2dbf7633-92c8-4340-8656-7aa019d0f80d
--- 462,468 ----
      ;; Force modeline redisplay.
      (set-buffer-modified-p (buffer-modified-p))))
  
! (add-minor-mode 'reftex-isearch-minor-mode "/I" nil nil 
                'reftex-isearch-minor-mode)
  
  ;;; arch-tag: 2dbf7633-92c8-4340-8656-7aa019d0f80d




reply via email to

[Prev in Thread] Current Thread [Next in Thread]