Mercurial > emacs
annotate lisp/textmodes/reftex-ref.el @ 107131:741ff2bdfe79
(Man-completion-table): Don't signal an error if we can't run
manual-program (bug#4056).
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 11 Feb 2010 11:00:01 -0500 |
parents | 1d1d5d9bd884 |
children | 280c8ae2476d 376148b31b5e |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
1 ;;; reftex-ref.el --- code to create labels and references with RefTeX |
74509 | 2 |
3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, | |
106815 | 4 ;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
27035 | 5 |
46612
7522419c4db0
Updated to reftex 4.17
Carsten Dominik <dominik@science.uva.nl>
parents:
38422
diff
changeset
|
6 ;; Author: Carsten Dominik <dominik@science.uva.nl> |
76672
690423f53b08
* textmodes/reftex.el: Add maintainer address.
David Kastrup <dak@gnu.org>
parents:
75347
diff
changeset
|
7 ;; Maintainer: auctex-devel@gnu.org |
69094
bfd5c5e60410
Version number change only
Carsten Dominik <dominik@science.uva.nl>
parents:
68648
diff
changeset
|
8 ;; Version: 4.31 |
27035 | 9 |
10 ;; This file is part of GNU Emacs. | |
11 | |
94670
f4a69fedbd46
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
27035 | 13 ;; it under the terms of the GNU General Public License as published by |
94670
f4a69fedbd46
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; the Free Software Foundation, either version 3 of the License, or |
f4a69fedbd46
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
15 ;; (at your option) any later version. |
27035 | 16 |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
94670
f4a69fedbd46
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
25280 | 24 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
25 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
26 |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
27 ;;; Code: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
28 |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
29 (eval-when-compile (require 'cl)) |
25280 | 30 (provide 'reftex-ref) |
31 (require 'reftex) | |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
60918
diff
changeset
|
32 (require 'reftex-parse) |
25280 | 33 ;;; |
34 | |
35 (defun reftex-label-location (&optional bound) | |
36 "Return the environment or macro which determines the label type at point. | |
37 If optional BOUND is an integer, limit backward searches to that point." | |
38 | |
39 (let* ((loc1 (reftex-what-macro reftex-label-mac-list bound)) | |
40 (loc2 (reftex-what-environment reftex-label-env-list bound)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
41 (loc3 (reftex-what-special-env 1 bound)) |
25280 | 42 (p1 (or (cdr loc1) 0)) |
43 (p2 (or (cdr loc2) 0)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
44 (p3 (or (cdr loc3) 0)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
45 (pmax (max p1 p2 p3))) |
25280 | 46 |
47 (setq reftex-location-start pmax) | |
48 (cond | |
49 ((= p1 pmax) | |
50 ;; A macro. Default context after macro name. | |
51 (setq reftex-default-context-position (+ p1 (length (car loc1)))) | |
52 (or (car loc1) "section")) | |
53 ((= p2 pmax) | |
54 ;; An environment. Default context after \begin{name}. | |
55 (setq reftex-default-context-position (+ p2 8 (length (car loc2)))) | |
56 (or (car loc2) "section")) | |
57 ((= p3 pmax) | |
58 ;; A special. Default context right there. | |
59 (setq reftex-default-context-position p3) | |
60 (setq loc3 (car loc3)) | |
61 (cond ((null loc3) "section") | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
62 ((symbolp loc3) (symbol-name loc3)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
63 ((stringp loc3) loc3) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
64 (t "section"))) |
25280 | 65 (t ;; This should not happen, I think? |
66 "section")))) | |
67 | |
68 (defun reftex-label-info-update (cell) | |
69 ;; Update information about just one label in a different file. | |
70 ;; CELL contains the old info list | |
71 (let* ((label (nth 0 cell)) | |
72 (typekey (nth 1 cell)) | |
73 ;; (text (nth 2 cell)) | |
74 (file (nth 3 cell)) | |
75 (comment (nth 4 cell)) | |
76 (note (nth 5 cell)) | |
77 (buf (reftex-get-file-buffer-force | |
78 file (not (eq t reftex-keep-temporary-buffers))))) | |
79 (if (not buf) | |
80 (list label typekey "" file comment "LOST LABEL. RESCAN TO FIX.") | |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104768
diff
changeset
|
81 (with-current-buffer buf |
25280 | 82 (save-restriction |
83 (widen) | |
84 (goto-char 1) | |
85 | |
86 (if (or (re-search-forward | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
87 (format reftex-find-label-regexp-format |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
88 (regexp-quote label)) nil t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
89 (re-search-forward |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
90 (format reftex-find-label-regexp-format2 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
91 (regexp-quote label)) nil t)) |
25280 | 92 |
93 (progn | |
94 (backward-char 1) | |
95 (append (reftex-label-info label file) (list note))) | |
96 (list label typekey "" file "LOST LABEL. RESCAN TO FIX."))))))) | |
97 | |
98 (defun reftex-label-info (label &optional file bound derive env-or-mac) | |
99 ;; Return info list on LABEL at point. | |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
100 (let* ((prefix (if (string-match "^[a-zA-Z0-9]+:" label) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
101 (match-string 0 label))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
102 (typekey (cdr (assoc prefix reftex-prefix-to-typekey-alist))) |
25280 | 103 (file (or file (buffer-file-name))) |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
104 (trust reftex-trust-label-prefix) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
105 (in-comment (reftex-in-comment))) |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
106 (if (and typekey |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
107 (cond ((eq trust t) t) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
108 ((null trust) nil) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
109 ((stringp trust) (string-match trust typekey)) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
110 ((listp trust) (member typekey trust)) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
111 (t nil))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
112 (list label typekey |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
113 (reftex-nicify-text (reftex-context-substring)) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
114 file in-comment) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
115 (let* ((env-or-mac (or env-or-mac (reftex-label-location bound))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
116 (typekey (nth 1 (assoc env-or-mac reftex-env-or-mac-alist))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
117 (parse (nth 2 (assoc env-or-mac reftex-env-or-mac-alist))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
118 (text (reftex-short-context env-or-mac parse reftex-location-start |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
119 derive))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
120 (list label typekey text file in-comment))))) |
25280 | 121 |
122 ;;; Creating labels --------------------------------------------------------- | |
123 | |
124 (defun reftex-label (&optional environment no-insert) | |
125 "Insert a unique label. Return the label. | |
126 If ENVIRONMENT is given, don't bother to find out yourself. | |
127 If NO-INSERT is non-nil, do not insert label into buffer. | |
128 With prefix arg, force to rescan document first. | |
129 When you are prompted to enter or confirm a label, and you reply with | |
130 just the prefix or an empty string, no label at all will be inserted. | |
131 A new label is also recorded into the label list. | |
132 This function is controlled by the settings of reftex-insert-label-flags." | |
133 | |
134 (interactive) | |
135 | |
136 ;; Ensure access to scanning info and rescan buffer if prefix are is '(4). | |
137 (reftex-access-scan-info current-prefix-arg) | |
138 | |
139 ;; Find out what kind of environment this is and abort if necessary. | |
140 (if (or (not environment) | |
141 (not (assoc environment reftex-env-or-mac-alist))) | |
142 (setq environment (reftex-label-location))) | |
143 (unless environment | |
144 (error "Can't figure out what kind of label should be inserted")) | |
145 | |
146 ;; Ok, go ahead. | |
147 (catch 'exit | |
148 (let* ((entry (assoc environment reftex-env-or-mac-alist)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
149 (typekey (nth 1 entry)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
150 (format (nth 3 entry)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
151 (macro-cell (reftex-what-macro 1)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
152 (entry1 (assoc (car macro-cell) reftex-env-or-mac-alist)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
153 label naked prefix valid default force-prompt rescan-is-useful) |
25280 | 154 (when (and (or (nth 5 entry) (nth 5 entry1)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
155 (memq (preceding-char) '(?\[ ?\{))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
156 ;; This is an argument of a label macro. Insert naked label. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
157 (setq naked t format "%s")) |
25280 | 158 |
159 (setq prefix (or (cdr (assoc typekey reftex-typekey-to-prefix-alist)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
160 (concat typekey "-"))) |
25280 | 161 ;; Replace any escapes in the prefix |
162 (setq prefix (reftex-replace-prefix-escapes prefix)) | |
163 | |
164 ;; Make a default label. | |
165 (cond | |
166 | |
167 ((reftex-typekey-check typekey (nth 0 reftex-insert-label-flags)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
168 ;; Derive a label from context. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
169 (setq reftex-active-toc (reftex-last-assoc-before-elt |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
170 'toc (car (reftex-where-am-I)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
171 (symbol-value reftex-docstruct-symbol))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
172 (setq default (reftex-no-props |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
173 (nth 2 (reftex-label-info " " nil nil t)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
174 ;; Catch the cases where the is actually no context available. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
175 (if (or (string-match "NO MATCH FOR CONTEXT REGEXP" default) |
60918
58a53f588384
* textmodes/refbib.el, textmodes/refer.el, textmodes/reftex-cite.el,
Werner LEMBERG <wl@gnu.org>
parents:
59534
diff
changeset
|
176 (string-match "INVALID VALUE OF PARSE" default) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
177 (string-match "SECTION HEADING NOT FOUND" default) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
178 (string-match "HOOK ERROR" default) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
179 (string-match "^[ \t]*$" default)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
180 (setq default prefix |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
181 force-prompt t) ; need to prompt |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
182 (setq default |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
183 (concat prefix |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
184 (funcall reftex-string-to-label-function default))) |
25280 | 185 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
186 ;; Make it unique. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
187 (setq default (reftex-uniquify-label default nil "-")))) |
25280 | 188 |
189 ((reftex-typekey-check typekey (nth 1 reftex-insert-label-flags)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
190 ;; Minimal default: the user will be prompted. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
191 (setq default prefix)) |
25280 | 192 |
193 (t | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
194 ;; Make an automatic label. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
195 (setq default (reftex-uniquify-label prefix t)))) |
25280 | 196 |
197 ;; Should we ask the user? | |
198 (if (or (reftex-typekey-check typekey | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
199 (nth 1 reftex-insert-label-flags)) ; prompt |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
200 force-prompt) |
25280 | 201 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
202 (while (not valid) |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
60918
diff
changeset
|
203 ;; iterate until we get a valid label |
25280 | 204 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
205 (setq label (read-string |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
206 (if naked "Naked Label: " "Label: ") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
207 default)) |
25280 | 208 |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
60918
diff
changeset
|
209 ;; Lets make sure that this is a valid label |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
210 (cond |
25280 | 211 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
212 ((string-match (concat "\\`\\(" (regexp-quote prefix) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
213 "\\)?[ \t]*\\'") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
214 label) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
215 ;; No label at all, please |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
216 (message "No label inserted.") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
217 (throw 'exit nil)) |
25280 | 218 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
219 ;; Test if label contains strange characters |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
220 ((string-match reftex-label-illegal-re label) |
60918
58a53f588384
* textmodes/refbib.el, textmodes/refer.el, textmodes/reftex-cite.el,
Werner LEMBERG <wl@gnu.org>
parents:
59534
diff
changeset
|
221 (message "Label \"%s\" contains invalid characters" label) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
222 (ding) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
223 (sit-for 2)) |
25280 | 224 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
225 ;; Look it up in the label list |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
226 ((setq entry (assoc label |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
227 (symbol-value reftex-docstruct-symbol))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
228 (ding) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
229 (if (y-or-n-p |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
230 (format "Label '%s' exists. Use anyway? " label)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
231 (setq valid t))) |
25280 | 232 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
233 ;; Label is ok |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
234 (t |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
235 (setq valid t)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
236 (setq label default)) |
25280 | 237 |
238 ;; Insert the label into the label list | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
239 (let* ((here-I-am-info |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
240 (save-excursion |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
241 (if (and (or naked no-insert) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
242 (integerp (cdr macro-cell))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
243 (goto-char (cdr macro-cell))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
244 (reftex-where-am-I))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
245 (here-I-am (car here-I-am-info)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
246 (note (if (cdr here-I-am-info) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
247 "" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
248 "POSITION UNCERTAIN. RESCAN TO FIX.")) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
249 (file (buffer-file-name)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
250 (text nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
251 (tail (memq here-I-am (symbol-value reftex-docstruct-symbol)))) |
25280 | 252 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
253 (or (cdr here-I-am-info) (setq rescan-is-useful t)) |
25280 | 254 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
255 (when tail |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
256 (push (list label typekey text file nil note) (cdr tail)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
257 (put reftex-docstruct-symbol 'modified t))) |
25280 | 258 |
259 ;; Insert the label into the buffer | |
260 (unless no-insert | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
261 (insert |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
262 (if reftex-format-label-function |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
263 (funcall reftex-format-label-function label format) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
264 (format format label))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
265 (if (and reftex-plug-into-AUCTeX |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
266 (fboundp 'LaTeX-add-labels)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
267 ;; Tell AUCTeX about this |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
268 (LaTeX-add-labels label))) |
25280 | 269 |
270 ;; Delete the corresponding selection buffers to force update on next use. | |
271 (when reftex-auto-update-selection-buffers | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
272 (reftex-erase-buffer (reftex-make-selection-buffer-name typekey)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
273 (reftex-erase-buffer (reftex-make-selection-buffer-name " "))) |
25280 | 274 |
275 (when (and rescan-is-useful reftex-allow-automatic-rescan) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
276 (reftex-parse-one)) |
25280 | 277 |
278 ;; return value of the function is the label | |
279 label))) | |
280 | |
281 (defun reftex-string-to-label (string) | |
282 "Convert a string (a sentence) to a label. | |
283 Uses `reftex-derive-label-parameters' and `reftex-label-illegal-re'. It | |
284 also applies `reftex-translate-to-ascii-function' to the string." | |
285 (when (and reftex-translate-to-ascii-function | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
286 (fboundp reftex-translate-to-ascii-function)) |
25280 | 287 (setq string (funcall reftex-translate-to-ascii-function string))) |
288 (apply 'reftex-convert-string string | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
289 "[-~ \t\n\r,;]+" reftex-label-illegal-re nil nil |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
290 reftex-derive-label-parameters)) |
25280 | 291 |
292 (defun reftex-latin1-to-ascii (string) | |
293 ;; Translate the upper 128 chars in the Latin-1 charset to ASCII equivalents | |
294 (let ((tab "@@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@ icLxY|S\"ca<--R-o|23'uq..1o>423?AAAAAAACEEEEIIIIDNOOOOOXOUUUUYP3aaaaaaaceeeeiiiidnooooo:ouuuuypy") | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
295 (emacsp (not (featurep 'xemacs)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
296 (mapconcat |
25280 | 297 (lambda (c) |
298 (cond ((and (> c 127) (< c 256)) ; 8 bit Latin-1 | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
299 (char-to-string (aref tab (- c 128)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
300 ((and emacsp ; Not for XEmacs |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
301 (> c 2175) (< c 2304)) ; Mule Latin-1 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
302 (char-to-string (aref tab (- c 2176)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
303 (t (char-to-string c)))) |
25280 | 304 string ""))) |
305 | |
306 (defun reftex-replace-prefix-escapes (prefix) | |
307 ;; Replace %escapes in a label prefix | |
308 (save-match-data | |
309 (let (letter (num 0) replace) | |
310 (while (string-match "\\%\\([a-zA-Z]\\)" prefix num) | |
311 (setq letter (match-string 1 prefix)) | |
312 (setq replace | |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
313 (save-match-data |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
314 (cond |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
315 ((equal letter "f") |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
316 (file-name-sans-extension |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
317 (file-name-nondirectory (buffer-file-name)))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
318 ((equal letter "F") |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
319 (let ((masterdir (file-name-directory (reftex-TeX-master-file))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
320 (file (file-name-sans-extension (buffer-file-name)))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
321 (if (string-match (concat "\\`" (regexp-quote masterdir)) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
322 file) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
323 (substring file (length masterdir)) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
324 file))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
325 ((equal letter "m") |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
326 (file-name-sans-extension |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
327 (file-name-nondirectory (reftex-TeX-master-file)))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
328 ((equal letter "M") |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
329 (file-name-nondirectory |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
330 (substring (file-name-directory (reftex-TeX-master-file)) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
331 0 -1))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
332 ((equal letter "u") |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
333 (or (user-login-name) "")) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
334 ((equal letter "S") |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
335 (let* (macro level-exp level) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
336 (save-excursion |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
337 (save-match-data |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
338 (when (re-search-backward reftex-section-regexp nil t) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
339 (setq macro (reftex-match-string 2) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
340 level-exp (cdr (assoc macro reftex-section-levels-all)) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
341 level (if (symbolp level-exp) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
342 (abs (save-match-data |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
343 (funcall level-exp))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
344 (abs level-exp)))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
345 (cdr (or (assoc macro reftex-section-prefixes) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
346 (assoc level reftex-section-prefixes) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
347 (assq t reftex-section-prefixes) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
348 (list t "sec:"))))))) |
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
349 (t "")))) |
25280 | 350 (setq num (1- (+ (match-beginning 1) (length replace))) |
351 prefix (replace-match replace nil nil prefix))) | |
352 prefix))) | |
353 | |
354 (defun reftex-uniquify-label (label &optional force separator) | |
355 ;; Make label unique by appending a number. | |
356 ;; Optional FORCE means, force appending a number, even if label is unique. | |
357 ;; Optional SEPARATOR is a string to stick between label and number. | |
358 | |
359 ;; Ensure access to scanning info | |
360 (reftex-access-scan-info) | |
361 | |
362 (cond | |
363 ((and (not force) | |
364 (not (assoc label (symbol-value reftex-docstruct-symbol)))) | |
365 label) | |
366 (t | |
367 (let* ((label-numbers (assq 'label-numbers | |
368 (symbol-value reftex-docstruct-symbol))) | |
369 (label-numbers-alist (cdr label-numbers)) | |
370 (cell (or (assoc label label-numbers-alist) | |
371 (car (setcdr label-numbers | |
372 (cons (cons label 0) | |
373 label-numbers-alist))))) | |
374 (num (1+ (cdr cell))) | |
375 (sep (or separator ""))) | |
376 (while (assoc (concat label sep (int-to-string num)) | |
377 (symbol-value reftex-docstruct-symbol)) | |
378 (incf num)) | |
379 (setcdr cell num) | |
380 (concat label sep (int-to-string num)))))) | |
381 | |
382 ;;; Referencing labels ------------------------------------------------------ | |
383 | |
384 ;; Help string for the reference label menu | |
385 (defconst reftex-select-label-prompt | |
386 "Select: [n]ext [p]revious [r]escan [ ]context e[x]tern [q]uit RET [?]HELP+more") | |
387 | |
388 (defconst reftex-select-label-help | |
389 " n / p Go to next/previous label (Cursor motion works as well) | |
390 C-c C-n/p Go to next/previous section heading. | |
391 b / l Jump back to previous selection / Reuse last referenced label. | |
37998
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
392 z Jump to a specific section, e.g. '3 z' jumps to section 3. |
25280 | 393 g / s Update menu / Switch label type. |
394 r / C-u r Reparse document / Reparse entire document. | |
395 x Switch to label menu of external document (with LaTeX package `xr'). | |
396 F t c Toggle: [F]ile borders, [t]able of contents, [c]ontext | |
397 # % Toggle: [#] label counters, [%] labels in comments | |
398 SPC / f Show full context in other window / Toggle follow mode. | |
399 . Show insertion point in other window. | |
400 v / V Toggle \\ref <-> \\vref / Rotate \\ref <=> \\fref <=> \\Fref | |
401 TAB Enter a label with completion. | |
402 m , - + Mark entry. `,-+' also assign a separator. | |
403 a / A Put all marked entries into one/many \\ref commands. | |
404 q / RET Quit without referencing / Accept current label (also on mouse-2).") | |
405 | |
406 (defun reftex-reference (&optional type no-insert cut) | |
407 "Make a LaTeX reference. Look only for labels of a certain TYPE. | |
408 With prefix arg, force to rescan buffer for labels. This should only be | |
409 necessary if you have recently entered labels yourself without using | |
410 reftex-label. Rescanning of the buffer can also be requested from the | |
411 label selection menu. | |
412 The function returns the selected label or nil. | |
413 If NO-INSERT is non-nil, do not insert \\ref command, just return label. | |
414 When called with 2 C-u prefix args, disable magic word recognition." | |
415 | |
416 (interactive) | |
417 | |
418 ;; check for active recursive edits | |
419 (reftex-check-recursive-edit) | |
420 | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
421 ;; Ensure access to scanning info and rescan buffer if prefix are is '(4) |
25280 | 422 (reftex-access-scan-info current-prefix-arg) |
423 | |
424 (unless type | |
425 ;; guess type from context | |
426 (if (and reftex-guess-label-type | |
427 (setq type (reftex-guess-label-type))) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
428 (setq cut (cdr type) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
429 type (car type)) |
25280 | 430 (setq type (reftex-query-label-type)))) |
431 | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
432 (let* ((refstyle |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
433 (cond ((reftex-typekey-check type reftex-vref-is-default) "\\vref") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
434 ((reftex-typekey-check type reftex-fref-is-default) "\\fref") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
435 (t "\\ref"))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
436 (reftex-format-ref-function reftex-format-ref-function) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
437 (form "\\ref{%s}") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
438 label labels sep sep1) |
25280 | 439 |
440 ;; Have the user select a label | |
441 (set-marker reftex-select-return-marker (point)) | |
442 (setq labels (save-excursion | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
443 (reftex-offer-label-menu type))) |
25280 | 444 (reftex-ensure-compiled-variables) |
445 (set-marker reftex-select-return-marker nil) | |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
446 ;; If the first entry is the symbol 'concat, concat all labels. |
25280 | 447 ;; We keep the cdr of the first label for typekey etc information. |
448 (if (eq (car labels) 'concat) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
449 (setq labels (list (list (mapconcat 'car (cdr labels) ",") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
450 (cdr (nth 1 labels)))))) |
25280 | 451 (setq type (nth 1 (car labels)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
452 form (or (cdr (assoc type reftex-typekey-to-format-alist)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
453 form)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
454 |
25280 | 455 (cond |
456 (no-insert | |
457 ;; Just return the first label | |
458 (car (car labels))) | |
459 ((null labels) | |
460 (message "Quit") | |
461 nil) | |
462 (t | |
463 (while labels | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
464 (setq label (car (car labels)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
465 sep (nth 2 (car labels)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
466 sep1 (cdr (assoc sep reftex-multiref-punctuation)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
467 labels (cdr labels)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
468 (when cut |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
469 (backward-delete-char cut) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
470 (setq cut nil)) |
25280 | 471 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
472 ;; remove ~ if we do already have a space |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
473 (when (and (= ?~ (string-to-char form)) |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
474 (member (preceding-char) '(?\ ?\t ?\n ?~))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
475 (setq form (substring form 1))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
476 ;; do we have a special format? |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
477 (setq reftex-format-ref-function |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
478 (cond |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
479 ((string= refstyle "\\vref") 'reftex-format-vref) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
480 ((string= refstyle "\\fref") 'reftex-format-fref) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
481 ((string= refstyle "\\Fref") 'reftex-format-Fref) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
482 (t reftex-format-ref-function))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
483 ;; ok, insert the reference |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
484 (if sep1 (insert sep1)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
485 (insert |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
486 (if reftex-format-ref-function |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
487 (funcall reftex-format-ref-function label form) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
488 (format form label label))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
489 ;; take out the initial ~ for good |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
490 (and (= ?~ (string-to-char form)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
491 (setq form (substring form 1)))) |
25280 | 492 (message "") |
493 label)))) | |
494 | |
495 (defun reftex-guess-label-type () | |
496 ;; Examine context to guess what a \ref might want to reference. | |
497 (let ((words reftex-words-to-typekey-alist) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
498 (case-fold-search t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
499 (bound (max (point-min) (- (point) 35))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
500 matched cell) |
25280 | 501 (save-excursion |
502 (while (and (setq cell (pop words)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
503 (not (setq matched |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
504 (re-search-backward (car cell) bound t)))))) |
25280 | 505 (if matched |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
506 (cons (cdr cell) (- (match-end 0) (match-end 1))) |
25280 | 507 nil))) |
508 | |
509 (defvar reftex-select-label-map) | |
510 (defun reftex-offer-label-menu (typekey) | |
511 ;; Offer a menu with the appropriate labels. | |
512 (let* ((buf (current-buffer)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
513 (xr-data (assq 'xr (symbol-value reftex-docstruct-symbol))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
514 (xr-alist (cons (cons "" (buffer-file-name)) (nth 1 xr-data))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
515 (xr-index 0) |
25280 | 516 (here-I-am (car (reftex-where-am-I))) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
517 (here-I-am1 here-I-am) |
25280 | 518 (toc (reftex-typekey-check typekey reftex-label-menu-flags 0)) |
519 (files (reftex-typekey-check typekey reftex-label-menu-flags 7)) | |
520 (context (not (reftex-typekey-check | |
521 typekey reftex-label-menu-flags 3))) | |
522 (counter (reftex-typekey-check | |
523 typekey reftex-label-menu-flags 2)) | |
524 (follow (reftex-typekey-check | |
525 typekey reftex-label-menu-flags 4)) | |
526 (commented (nth 5 reftex-label-menu-flags)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
527 (prefix "") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
528 selection-buffers |
25280 | 529 offset rtn key data last-data entries) |
530 | |
531 (unwind-protect | |
532 (catch 'exit | |
533 (while t | |
534 (save-window-excursion | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
535 (delete-other-windows) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
536 (setq reftex-call-back-to-this-buffer buf |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
537 reftex-latex-syntax-table (syntax-table)) |
104768
17d2ae0948e2
Remove unnecessary bindings of default-major-mode (all are followed by
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
538 (if reftex-use-multiple-selection-buffers |
17d2ae0948e2
Remove unnecessary bindings of default-major-mode (all are followed by
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
539 (switch-to-buffer-other-window |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104768
diff
changeset
|
540 (with-current-buffer buf |
104768
17d2ae0948e2
Remove unnecessary bindings of default-major-mode (all are followed by
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
541 (reftex-make-selection-buffer-name typekey))) |
17d2ae0948e2
Remove unnecessary bindings of default-major-mode (all are followed by
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
542 (switch-to-buffer-other-window "*RefTeX Select*") |
17d2ae0948e2
Remove unnecessary bindings of default-major-mode (all are followed by
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
543 (reftex-erase-buffer)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
544 (unless (eq major-mode 'reftex-select-label-mode) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
545 (reftex-select-label-mode)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
546 (add-to-list 'selection-buffers (current-buffer)) |
25280 | 547 (setq truncate-lines t) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
548 (setq mode-line-format |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
549 (list "---- " 'mode-line-buffer-identification |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
550 " " 'global-mode-string " (" mode-name ")" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
551 " S<" 'refstyle ">" |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
552 " -%-")) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
553 (cond |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
554 ((= 0 (buffer-size)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
555 (let ((buffer-read-only nil)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
556 (message "Creating Selection Buffer...") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
557 (setq offset (reftex-insert-docstruct |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
558 buf |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
559 toc |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
560 typekey |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
561 nil ; index |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
562 files |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
563 context |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
564 counter |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
565 commented |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
566 (or here-I-am offset) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
567 prefix |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
568 nil ; no a toc buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
569 )))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
570 (here-I-am |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
571 (setq offset (reftex-get-offset buf here-I-am typekey))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
572 (t (setq offset t))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
573 (setq buffer-read-only t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
574 (setq offset (or offset t)) |
25280 | 575 |
576 (setq here-I-am nil) ; turn off determination of offset | |
577 (setq rtn | |
578 (reftex-select-item | |
579 reftex-select-label-prompt | |
580 reftex-select-label-help | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
581 reftex-select-label-map |
25280 | 582 offset |
583 'reftex-show-label-location follow)) | |
584 (setq key (car rtn) | |
585 data (nth 1 rtn) | |
586 last-data (nth 2 rtn) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
587 offset t) |
25280 | 588 (unless key (throw 'exit nil)) |
589 (cond | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
590 ((eq key ?g) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
591 ;; update buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
592 (reftex-erase-buffer)) |
25280 | 593 ((or (eq key ?r) |
594 (eq key ?R)) | |
595 ;; rescan buffer | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
596 (and current-prefix-arg (setq key ?R)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
597 (reftex-erase-buffer) |
25280 | 598 (reftex-reparse-document buf last-data key)) |
599 ((eq key ?c) | |
600 ;; toggle context mode | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
601 (reftex-erase-buffer) |
25280 | 602 (setq context (not context))) |
603 ((eq key ?s) | |
604 ;; switch type | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
605 (setq here-I-am here-I-am1) |
25280 | 606 (setq typekey (reftex-query-label-type))) |
607 ((eq key ?t) | |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
608 ;; toggle table of contents display, or change depth |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
609 (reftex-erase-buffer) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
610 (if current-prefix-arg |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
611 (setq reftex-toc-max-level (prefix-numeric-value |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
612 current-prefix-arg)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
613 (setq toc (not toc)))) |
25280 | 614 ((eq key ?F) |
615 ;; toggle display of included file borders | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
616 (reftex-erase-buffer) |
25280 | 617 (setq files (not files))) |
618 ((eq key ?#) | |
619 ;; toggle counter display | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
620 (reftex-erase-buffer) |
25280 | 621 (setq counter (not counter))) |
622 ((eq key ?%) | |
623 ;; toggle display of commented labels | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
624 (reftex-erase-buffer) |
25280 | 625 (setq commented (not commented))) |
626 ((eq key ?l) | |
627 ;; reuse the last referenced label again | |
628 (setq entries reftex-last-used-reference) | |
629 (throw 'exit t)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
630 ((eq key ?x) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
631 ;; select an external document |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
632 (setq xr-index (reftex-select-external-document |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
633 xr-alist xr-index)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
634 (setq buf (or (reftex-get-file-buffer-force |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
635 (cdr (nth xr-index xr-alist))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
636 (error "Cannot switch document")) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
637 prefix (or (car (nth xr-index xr-alist)) "")) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
638 (set-buffer buf) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
639 (reftex-access-scan-info)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
640 ((stringp key) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
641 (setq entries |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
642 (list |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
643 (list |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
644 (or (assoc key (symbol-value reftex-docstruct-symbol)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
645 (list key typekey))))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
646 (throw 'exit t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
647 ((memq key '(?a ?A return)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
648 (cond |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
649 (reftex-select-marked |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
650 (setq entries (nreverse reftex-select-marked))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
651 (data |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
652 (setq entries (list (list data)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
653 (t (setq entries nil))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
654 (when entries |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
655 (if (equal key ?a) (push 'concat entries)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
656 (setq reftex-last-used-reference entries)) |
25280 | 657 (set-buffer buf) |
658 (throw 'exit t)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
659 (t (error "This should not happen (reftex-offer-label-menu)")))))) |
25280 | 660 (save-excursion |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
661 (while reftex-buffers-with-changed-invisibility |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
662 (set-buffer (car (car reftex-buffers-with-changed-invisibility))) |
85197
861bd8efa4d6
(reftex-offer-label-menu): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
663 (setq buffer-invisibility-spec |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
664 (cdr (pop reftex-buffers-with-changed-invisibility))))) |
85197
861bd8efa4d6
(reftex-offer-label-menu): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
665 (mapc (lambda (buf) (and (buffer-live-p buf) (bury-buffer buf))) |
861bd8efa4d6
(reftex-offer-label-menu): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
666 selection-buffers) |
25280 | 667 (reftex-kill-temporary-buffers)) |
668 ;; Add the prefixes, put together the relevant information in the form | |
46683
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
669 ;; (LABEL TYPEKEY SEPARATOR) and return a list of those. |
25280 | 670 (mapcar (lambda (x) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
671 (if (listp x) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
672 (list (concat prefix (car (car x))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
673 (nth 1 (car x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
674 (nth 2 x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
675 x)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
676 entries))) |
25280 | 677 |
678 (defun reftex-reparse-document (&optional buffer data key) | |
679 ;; Rescan the document. | |
680 (save-window-excursion | |
681 (save-excursion | |
682 (if buffer | |
683 (if (not (bufferp buffer)) | |
684 (error "No such buffer %s" (buffer-name buffer)) | |
685 (set-buffer buffer))) | |
686 (let ((arg (if (eq key ?R) '(16) '(4))) | |
687 (file (nth 3 data))) | |
688 (reftex-access-scan-info arg file))))) | |
689 | |
690 (defun reftex-query-label-type () | |
691 ;; Ask for label type | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
692 (let ((key (reftex-select-with-char |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
693 reftex-type-query-prompt reftex-type-query-help 3))) |
25280 | 694 (unless (member (char-to-string key) reftex-typekey-list) |
695 (error "No such label type: %s" (char-to-string key))) | |
696 (char-to-string key))) | |
697 | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
698 (defun reftex-show-label-location (data forward no-revisit |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
699 &optional stay error) |
25280 | 700 ;; View the definition site of a label in another window. |
701 ;; DATA is an entry from the docstruct list. | |
702 ;; FORWARD indicates if the label is likely forward from current point. | |
703 ;; NO-REVISIT means do not load a file to show this label. | |
704 ;; STAY means leave the new window selected. | |
705 ;; ERROR means throw an error exception when the label cannot be found. | |
706 ;; If ERROR is nil, the return value of this function indicates success. | |
707 (let* ((this-window (selected-window)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
708 (errorf (if error 'error 'message)) |
25280 | 709 label file buffer re found) |
710 | |
711 (catch 'exit | |
712 (setq label (nth 0 data) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
713 file (nth 3 data)) |
25280 | 714 |
715 (unless file | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
716 (funcall errorf "Unknown label - reparse might help") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
717 (throw 'exit nil)) |
25280 | 718 |
719 ;; Goto the file in another window | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
720 (setq buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
721 (if no-revisit |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
722 (reftex-get-buffer-visiting file) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
723 (reftex-get-file-buffer-force |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
724 file (not reftex-keep-temporary-buffers)))) |
25280 | 725 (if buffer |
726 ;; good - the file is available | |
727 (switch-to-buffer-other-window buffer) | |
728 ;; we have got a problem here. The file does not exist. | |
729 ;; Let' get out of here.. | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
730 (funcall errorf "Label %s not found" label) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
731 (throw 'exit nil)) |
25280 | 732 |
733 ;; search for that label | |
734 (setq re (format reftex-find-label-regexp-format (regexp-quote label))) | |
735 (setq found | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
736 (if forward |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
737 (re-search-forward re nil t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
738 (re-search-backward re nil t))) |
25280 | 739 (unless found |
740 (goto-char (point-min)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
741 (unless (setq found (re-search-forward re nil t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
742 ;; Ooops. Must be in a macro with distributed args. |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
743 (setq found |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
744 (re-search-forward |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
745 (format reftex-find-label-regexp-format2 |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
746 (regexp-quote label)) nil t)))) |
25280 | 747 (if (match-end 3) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
748 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
749 (reftex-highlight 0 (match-beginning 3) (match-end 3)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
750 (reftex-show-entry (match-beginning 3) (match-end 3)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
751 (recenter '(4)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
752 (unless stay (select-window this-window))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
753 (select-window this-window) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
754 (funcall errorf "Label %s not found" label)) |
25280 | 755 found))) |
756 | |
757 (defvar font-lock-mode) | |
758 (defun reftex-show-entry (beg-hlt end-hlt) | |
759 ;; Show entry if point is hidden | |
760 (let* ((n (/ (reftex-window-height) 2)) | |
761 (beg (save-excursion | |
762 (re-search-backward "[\n\r]" nil 1 n) (point))) | |
763 (end (save-excursion | |
764 (re-search-forward "[\n\r]" nil 1 n) (point)))) | |
765 (cond | |
766 ((and (boundp 'buffer-invisibility-spec) buffer-invisibility-spec | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
767 (get-char-property (1+ beg-hlt) 'invisible)) |
25280 | 768 ;; Invisible with text properties. That is easy to change. |
769 (push (cons (current-buffer) buffer-invisibility-spec) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
770 reftex-buffers-with-changed-invisibility) |
25280 | 771 (setq buffer-invisibility-spec nil)) |
772 ((string-match "\r" (buffer-substring beg end)) | |
773 ;; Invisible with selective display. We need to copy it. | |
774 (let ((string (buffer-substring-no-properties beg end))) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
775 (switch-to-buffer "*RefTeX Context Copy*") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
776 (setq buffer-read-only nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
777 (erase-buffer) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
778 (insert string) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
779 (subst-char-in-region (point-min) (point-max) ?\r ?\n t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
780 (goto-char (- beg-hlt beg)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
781 (reftex-highlight 0 (1+ (- beg-hlt beg)) (1+ (- end-hlt beg))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
782 (if (reftex-refontify) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
783 (when (or (not (eq major-mode 'latex-mode)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
784 (not font-lock-mode)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
785 (latex-mode) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
786 (run-hook-with-args |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
787 'reftex-pre-refontification-functions |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
788 reftex-call-back-to-this-buffer 'reftex-hidden) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
789 (turn-on-font-lock)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
790 (when (or (not (eq major-mode 'fundamental-mode)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
791 font-lock-mode) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
792 (fundamental-mode))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
793 (run-hooks 'reftex-display-copied-context-hook) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
794 (setq buffer-read-only t)))))) |
25280 | 795 |
796 (defun reftex-varioref-vref () | |
37998
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
797 "Insert a reference using the `\\vref' macro from the varioref package." |
25280 | 798 (interactive) |
799 (let ((reftex-format-ref-function 'reftex-format-vref)) | |
800 (reftex-reference))) | |
801 (defun reftex-fancyref-fref () | |
37998
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
802 "Insert a reference using the `\\fref' macro from the fancyref package." |
25280 | 803 (interactive) |
804 (let ((reftex-format-ref-function 'reftex-format-fref) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
805 ;;(reftex-guess-label-type nil) ;FIXME do we want this???? |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
806 ) |
25280 | 807 (reftex-reference))) |
808 (defun reftex-fancyref-Fref () | |
37998
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
809 "Insert a reference using the `\\Fref' macro from the fancyref package." |
25280 | 810 (interactive) |
811 (let ((reftex-format-ref-function 'reftex-format-Fref) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
812 ;;(reftex-guess-label-type nil) ;FIXME do we want this???? |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
813 ) |
25280 | 814 (reftex-reference))) |
815 | |
816 (defun reftex-format-vref (label fmt) | |
817 (while (string-match "\\\\ref{" fmt) | |
818 (setq fmt (replace-match "\\vref{" t t fmt))) | |
819 (format fmt label label)) | |
820 (defun reftex-format-Fref (label def-fmt) | |
821 (format "\\Fref{%s}" label)) | |
822 (defun reftex-format-fref (label def-fmt) | |
823 (format "\\fref{%s}" label)) | |
824 | |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
825 (defun reftex-goto-label (&optional other-window) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
826 "Prompt for a label (with completion) and jump to the location of this label. |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
827 Optional prefix argument OTHER-WINDOW goes to the label in another window." |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
828 (interactive "P") |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
829 (reftex-access-scan-info) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
830 (let* ((wcfg (current-window-configuration)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
831 (docstruct (symbol-value reftex-docstruct-symbol)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
832 (label (completing-read "Label: " docstruct |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
833 (lambda (x) (stringp (car x))) t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
834 (selection (assoc label docstruct)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
835 (where (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
836 (reftex-show-label-location selection t nil 'stay) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
837 (point-marker)))) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
838 (unless other-window |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
839 (set-window-configuration wcfg) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
840 (switch-to-buffer (marker-buffer where)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
50978
diff
changeset
|
841 (goto-char where)) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
842 (reftex-unhighlight 0))) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
843 |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
844 |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
845 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
846 ;; arch-tag: 52f14032-fb76-4d31-954f-750c72415675 |
25280 | 847 ;;; reftex-ref.el ends here |