Mercurial > emacs
comparison lisp/textmodes/reftex.el @ 90317:34c8b755296d
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-23
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 113-118)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 38-39)
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 24 Feb 2006 08:08:56 +0000 |
parents | c5406394f567 6fd277476931 |
children | 95d0cdf160ea |
comparison
equal
deleted
inserted
replaced
90316:458ed0c8c4c3 | 90317:34c8b755296d |
---|---|
1 ;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX | 1 ;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX |
2 ;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, | 2 ;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, |
3 ;; 2006 Free Software Foundation, Inc. | 3 ;; 2006 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 ;; Author: Carsten Dominik <dominik@science.uva.nl> |
6 ;; Version: VERSIONTAG | 6 ;; Version: 4.31 |
7 ;; Keywords: tex | 7 ;; Keywords: tex |
8 | 8 |
9 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
10 | 10 |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | 11 ;; GNU Emacs is free software; you can redistribute it and/or modify |
299 ;;; ========================================================================= | 299 ;;; ========================================================================= |
300 ;;; | 300 ;;; |
301 ;;; Define the formal stuff for a minor mode named RefTeX. | 301 ;;; Define the formal stuff for a minor mode named RefTeX. |
302 ;;; | 302 ;;; |
303 | 303 |
304 (defconst reftex-version "RefTeX version VERSIONTAG" | 304 (defconst reftex-version "RefTeX version 4.31" |
305 "Version string for RefTeX.") | 305 "Version string for RefTeX.") |
306 | 306 |
307 (defvar reftex-mode nil | 307 (defvar reftex-mode nil |
308 "Determines if RefTeX mode is active.") | 308 "Determines if RefTeX mode is active.") |
309 (make-variable-buffer-local 'reftex-mode) | 309 (make-variable-buffer-local 'reftex-mode) |
1435 (ext-re (concat "\\(" | 1435 (ext-re (concat "\\(" |
1436 (mapconcat 'regexp-quote extensions "\\|") | 1436 (mapconcat 'regexp-quote extensions "\\|") |
1437 "\\)\\'")) | 1437 "\\)\\'")) |
1438 (files (if (string-match ext-re file) | 1438 (files (if (string-match ext-re file) |
1439 (cons file nil) | 1439 (cons file nil) |
1440 (cons (concat file def-ext) file))) | 1440 (if reftex-try-all-extensions |
1441 path old-path file1) | 1441 (append (mapcar (lambda (x) (concat file x)) |
1442 extensions) | |
1443 (list file)) | |
1444 (list (concat file def-ext) file)))) | |
1445 path old-path file1 f fs) | |
1442 (cond | 1446 (cond |
1443 ((file-name-absolute-p file) | 1447 ((file-name-absolute-p file) |
1444 (setq file1 | 1448 (while (setq f (pop files)) |
1445 (or | 1449 (if (file-regular-p f) |
1446 (and (car files) (file-regular-p (car files)) (car files)) | 1450 (setq file1 f files nil)))) |
1447 (and (cdr files) (file-regular-p (cdr files)) (cdr files))))) | |
1448 ((and reftex-use-external-file-finders | 1451 ((and reftex-use-external-file-finders |
1449 (assoc type reftex-external-file-finders)) | 1452 (assoc type reftex-external-file-finders)) |
1450 (setq file1 (reftex-find-file-externally file type master-dir))) | 1453 (setq file1 (reftex-find-file-externally file type master-dir))) |
1451 (t | 1454 (t |
1452 (while (and (null file1) rec-values) | 1455 (while (and (null file1) rec-values) |
1453 (setq path (reftex-access-search-path | 1456 (setq path (reftex-access-search-path |
1454 type (pop rec-values) master-dir file)) | 1457 type (pop rec-values) master-dir file)) |
1455 (if (or (null old-path) | 1458 (setq fs files) |
1456 (not (eq old-path path))) | 1459 (while (and (null file1) (setq f (pop fs))) |
1457 (setq old-path path | 1460 (when (or (null old-path) |
1458 path (cons master-dir path) | 1461 (not (eq old-path path))) |
1459 file1 (or (and (car files) | 1462 (setq old-path path |
1460 (reftex-find-file-on-path | 1463 path (cons master-dir path)) |
1461 (car files) path master-dir)) | 1464 (setq file1 (reftex-find-file-on-path f path master-dir))))))) |
1462 (and (cdr files) | |
1463 (reftex-find-file-on-path | |
1464 (cdr files) path master-dir)))))))) | |
1465 (cond (file1 file1) | 1465 (cond (file1 file1) |
1466 (die (error "No such file: %s" file) nil) | 1466 (die (error "No such file: %s" file) nil) |
1467 (t (message "No such file: %s (ignored)" file) nil)))) | 1467 (t (message "No such file: %s (ignored)" file) nil)))) |
1468 | 1468 |
1469 (defun reftex-find-file-externally (file type &optional master-dir) | 1469 (defun reftex-find-file-externally (file type &optional master-dir) |