aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2005-08-31 10:29:27 +0000
committerJuanma Barranquero2005-08-31 10:29:27 +0000
commit8ac77839c7d5246d6ea93c3f28a98473d1907f9b (patch)
tree328aa83e55d94a18e57229e1f80d84460e18ef04
parentae48944514a529eb78caff789171393fa6c82287 (diff)
downloademacs-8ac77839c7d5246d6ea93c3f28a98473d1907f9b.tar.gz
emacs-8ac77839c7d5246d6ea93c3f28a98473d1907f9b.zip
(isearch-next-buffer-function, TeX-master): Add defvars.
-rw-r--r--lisp/textmodes/reftex-global.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index 281e852a40d..3b5c51d2c9d 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -32,6 +32,9 @@
32(require 'reftex) 32(require 'reftex)
33;;; 33;;;
34 34
35(defvar isearch-next-buffer-function)
36(defvar TeX-master)
37
35(defun reftex-create-tags-file () 38(defun reftex-create-tags-file ()
36 "Create TAGS file by running `etags' on the current document. 39 "Create TAGS file by running `etags' on the current document.
37The TAGS file is also immediately visited with `visit-tags-table'." 40The TAGS file is also immediately visited with `visit-tags-table'."
@@ -137,7 +140,7 @@ No active TAGS table is required."
137 (set (make-local-variable 'TeX-master) master) 140 (set (make-local-variable 'TeX-master) master)
138 (erase-buffer) 141 (erase-buffer)
139 (insert " MULTIPLE LABELS IN CURRENT DOCUMENT:\n") 142 (insert " MULTIPLE LABELS IN CURRENT DOCUMENT:\n")
140 (insert 143 (insert
141 " Move point to label and type `r' to run a query-replace on the label\n" 144 " Move point to label and type `r' to run a query-replace on the label\n"
142 " and its references. Type `q' to exit this buffer.\n\n") 145 " and its references. Type `q' to exit this buffer.\n\n")
143 (insert " LABEL FILE\n") 146 (insert " LABEL FILE\n")
@@ -195,8 +198,8 @@ one with the `xr' package."
195 (not (yes-or-no-p "Replacing all simple labels in multiple files is risky. Continue? "))) 198 (not (yes-or-no-p "Replacing all simple labels in multiple files is risky. Continue? ")))
196 (error "Abort")) 199 (error "Abort"))
197 ;; Make the translation list 200 ;; Make the translation list
198 (let* ((re-core (concat "\\(" 201 (let* ((re-core (concat "\\("
199 (mapconcat 'cdr reftex-typekey-to-prefix-alist "\\|") 202 (mapconcat 'cdr reftex-typekey-to-prefix-alist "\\|")
200 "\\)")) 203 "\\)"))
201 (label-re (concat "\\`" re-core "\\([0-9]+\\)\\'")) 204 (label-re (concat "\\`" re-core "\\([0-9]+\\)\\'"))
202 (search-re (concat "[{,]\\(" re-core "\\([0-9]+\\)\\)[,}]")) 205 (search-re (concat "[{,]\\(" re-core "\\([0-9]+\\)\\)[,}]"))
@@ -229,11 +232,11 @@ one with the `xr' package."
229 (reftex-save-all-document-buffers) 232 (reftex-save-all-document-buffers)
230 233
231 ;; First test to check for erros 234 ;; First test to check for erros
232 (setq n (reftex-translate 235 (setq n (reftex-translate
233 files search-re translate-alist error-fmt 'test)) 236 files search-re translate-alist error-fmt 'test))
234 237
235 ;; Now the real thing. 238 ;; Now the real thing.
236 (if (yes-or-no-p 239 (if (yes-or-no-p
237 (format "Replace %d items at %d places in %d files? " 240 (format "Replace %d items at %d places in %d files? "
238 (length translate-alist) n (length files))) 241 (length translate-alist) n (length files)))
239 (progn 242 (progn
@@ -251,9 +254,9 @@ one with the `xr' package."
251 254
252(defun reftex-translate (files search-re translate-alist error-fmt test) 255(defun reftex-translate (files search-re translate-alist error-fmt test)
253 ;; In FILES, look for SEARCH-RE and replace match 1 of it with 256 ;; In FILES, look for SEARCH-RE and replace match 1 of it with
254 ;; its association in TRANSLATE-ALSIT. 257 ;; its association in TRANSLATE-ALSIT.
255 ;; If we do not find an association and TEST is non-nil, query 258 ;; If we do not find an association and TEST is non-nil, query
256 ;; to ignore the problematic string. 259 ;; to ignore the problematic string.
257 ;; If TEST is nil, it is ignored without query. 260 ;; If TEST is nil, it is ignored without query.
258 ;; Return the number of replacements. 261 ;; Return the number of replacements.
259 (let ((n 0) file label match-data buf macro pos cell) 262 (let ((n 0) file label match-data buf macro pos cell)
@@ -279,7 +282,7 @@ one with the `xr' package."
279 (or (looking-at "\\\\ref") 282 (or (looking-at "\\\\ref")
280 (looking-at "\\\\[a-zA-Z]*ref\\(range\\)?[^a-zA-Z]") 283 (looking-at "\\\\[a-zA-Z]*ref\\(range\\)?[^a-zA-Z]")
281 (looking-at "\\\\ref[a-zA-Z]*[^a-zA-Z]") 284 (looking-at "\\\\ref[a-zA-Z]*[^a-zA-Z]")
282 (looking-at (format 285 (looking-at (format
283 reftex-find-label-regexp-format 286 reftex-find-label-regexp-format
284 (regexp-quote label))))) 287 (regexp-quote label)))))
285 ;; OK, we should replace it. 288 ;; OK, we should replace it.
@@ -342,7 +345,7 @@ Also checks if buffers visiting the files are in read-only mode."
342 345
343(defun reftex-isearch-wrap-function () 346(defun reftex-isearch-wrap-function ()
344 (if (not isearch-word) 347 (if (not isearch-word)
345 (switch-to-buffer 348 (switch-to-buffer
346 (funcall isearch-next-buffer-function (current-buffer) t))) 349 (funcall isearch-next-buffer-function (current-buffer) t)))
347 (goto-char (if isearch-forward (point-min) (point-max)))) 350 (goto-char (if isearch-forward (point-min) (point-max))))
348 351
@@ -428,7 +431,7 @@ With no argument, this command toggles
428`reftex-isearch-minor-mode' on iff ARG is positive." 431`reftex-isearch-minor-mode' on iff ARG is positive."
429 (interactive "P") 432 (interactive "P")
430 (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode)) 433 (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode))
431 (setq reftex-isearch-minor-mode 434 (setq reftex-isearch-minor-mode
432 (not (or (and (null arg) reftex-isearch-minor-mode) 435 (not (or (and (null arg) reftex-isearch-minor-mode)
433 (<= (prefix-numeric-value arg) 0)))) 436 (<= (prefix-numeric-value arg) 0))))
434 (unless (eq reftex-isearch-minor-mode old-reftex-isearch-minor-mode) 437 (unless (eq reftex-isearch-minor-mode old-reftex-isearch-minor-mode)
@@ -459,7 +462,7 @@ With no argument, this command toggles
459 ;; Force modeline redisplay. 462 ;; Force modeline redisplay.
460 (set-buffer-modified-p (buffer-modified-p)))) 463 (set-buffer-modified-p (buffer-modified-p))))
461 464
462(add-minor-mode 'reftex-isearch-minor-mode "/I" nil nil 465(add-minor-mode 'reftex-isearch-minor-mode "/I" nil nil
463 'reftex-isearch-minor-mode) 466 'reftex-isearch-minor-mode)
464 467
465;;; arch-tag: 2dbf7633-92c8-4340-8656-7aa019d0f80d 468;;; arch-tag: 2dbf7633-92c8-4340-8656-7aa019d0f80d