Mercurial > emacs
annotate lisp/textmodes/reftex-sel.el @ 110015:280c8ae2476d
Add "Package:" file headers to denote built-in packages.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 29 Aug 2010 12:17:13 -0400 |
parents | 1d1d5d9bd884 |
children | 2eee976277c5 |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
1 ;;; reftex-sel.el --- the selection modes for RefTeX |
74508
0b524ec529e1
Fix time-travelling copyright years.
Glenn Morris <rgm@gnu.org>
parents:
69177
diff
changeset
|
2 |
0b524ec529e1
Fix time-travelling copyright years.
Glenn Morris <rgm@gnu.org>
parents:
69177
diff
changeset
|
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:
43352
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 |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
9 ;; Package: reftex |
27035 | 10 |
11 ;; This file is part of GNU Emacs. | |
12 | |
94670
f4a69fedbd46
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
27035 | 14 ;; 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
|
15 ;; 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
|
16 ;; (at your option) any later version. |
27035 | 17 |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; 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
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
25280 | 25 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
26 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
27 |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
28 ;;; Code: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37998
diff
changeset
|
29 |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
25280 | 31 (provide 'reftex-sel) |
32 (require 'reftex) | |
33 ;;; | |
34 | |
35 (defvar reftex-select-label-map nil | |
36 "Keymap used for *RefTeX Select* buffer, when selecting a label. | |
37 This keymap can be used to configure the label selection process which is | |
38 started with the command \\[reftex-reference].") | |
39 | |
40 (defun reftex-select-label-mode () | |
41 "Major mode for selecting a label in a LaTeX document. | |
42 This buffer was created with RefTeX. | |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
43 It only has a meaningful keymap when you are in the middle of a |
25280 | 44 selection process. |
45 To select a label, move the cursor to it and press RET. | |
46 Press `?' for a summary of important key bindings. | |
47 | |
48 During a selection process, these are the local bindings. | |
49 | |
50 \\{reftex-select-label-map}" | |
51 | |
52 (interactive) | |
53 (kill-all-local-variables) | |
46683
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
54 (when (featurep 'xemacs) |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
55 ;; XEmacs needs the call to make-local-hook |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
56 (make-local-hook 'pre-command-hook) |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
57 (make-local-hook 'post-command-hook)) |
25280 | 58 (setq major-mode 'reftex-select-label-mode |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
59 mode-name "LSelect") |
25280 | 60 (set (make-local-variable 'reftex-select-marked) nil) |
61 (when (syntax-table-p reftex-latex-syntax-table) | |
62 (set-syntax-table reftex-latex-syntax-table)) | |
63 ;; We do not set a local map - reftex-select-item does this. | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
64751
diff
changeset
|
64 (run-hooks 'reftex-select-label-mode-hook)) |
25280 | 65 |
66 (defvar reftex-select-bib-map nil | |
67 "Keymap used for *RefTeX Select* buffer, when selecting a BibTeX entry. | |
68 This keymap can be used to configure the BibTeX selection process which is | |
69 started with the command \\[reftex-citation].") | |
70 | |
71 (defun reftex-select-bib-mode () | |
72 "Major mode for selecting a citation key in a LaTeX document. | |
73 This buffer was created with RefTeX. | |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
74 It only has a meaningful keymap when you are in the middle of a |
25280 | 75 selection process. |
76 In order to select a citation, move the cursor to it and press RET. | |
77 Press `?' for a summary of important key bindings. | |
78 | |
79 During a selection process, these are the local bindings. | |
80 | |
81 \\{reftex-select-label-map}" | |
82 (interactive) | |
83 (kill-all-local-variables) | |
46683
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
84 (when (featurep 'xemacs) |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
85 ;; XEmacs needs the call to make-local-hook |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
86 (make-local-hook 'pre-command-hook) |
060f433ebf11
Updated to RefTeX 4.18
Carsten Dominik <dominik@science.uva.nl>
parents:
46612
diff
changeset
|
87 (make-local-hook 'post-command-hook)) |
25280 | 88 (setq major-mode 'reftex-select-bib-mode |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
89 mode-name "BSelect") |
25280 | 90 (set (make-local-variable 'reftex-select-marked) nil) |
91 ;; We do not set a local map - reftex-select-item does this. | |
65548
253cad16882d
Little fixes to remove compiler warnings
Carsten Dominik <dominik@science.uva.nl>
parents:
64751
diff
changeset
|
92 (run-hooks 'reftex-select-bib-mode-hook)) |
25280 | 93 |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
94 ;; (defun reftex-get-offset (buf here-am-I &optional typekey toc index file) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
95 ;; ;; Find the correct offset data, like insert-docstruct would, but faster. |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
96 ;; ;; Buffer BUF knows the correct docstruct to use. |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
97 ;; ;; Basically this finds the first docstruct entry after HERE-I-AM which |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
98 ;; ;; is of allowed type. The optional arguments specify what is allowed. |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
99 ;; (catch 'exit |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
100 ;; (with-current-buffer buf |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
101 ;; (reftex-access-scan-info) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
102 ;; (let* ((rest (memq here-am-I (symbol-value reftex-docstruct-symbol))) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
103 ;; entry) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
104 ;; (while (setq entry (pop rest)) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
105 ;; (if (or (and typekey |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
106 ;; (stringp (car entry)) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
107 ;; (or (equal typekey " ") |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
108 ;; (equal typekey (nth 1 entry)))) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
109 ;; (and toc (eq (car entry) 'toc)) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
110 ;; (and index (eq (car entry) 'index)) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
111 ;; (and file |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
112 ;; (memq (car entry) '(bof eof file-error)))) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
113 ;; (throw 'exit entry))) |
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
114 ;; nil)))) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
115 |
25280 | 116 (defun reftex-get-offset (buf here-am-I &optional typekey toc index file) |
117 ;; Find the correct offset data, like insert-docstruct would, but faster. | |
118 ;; Buffer BUF knows the correct docstruct to use. | |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
119 ;; Basically this finds the first docstruct entry before HERE-I-AM which |
25280 | 120 ;; is of allowed type. The optional arguments specify what is allowed. |
121 (catch 'exit | |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
122 (with-current-buffer buf |
25280 | 123 (reftex-access-scan-info) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
124 (let* ((rest (symbol-value reftex-docstruct-symbol)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
125 lastentry entry) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
126 (while (setq entry (pop rest)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
127 (if (or (and typekey |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
128 (stringp (car entry)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
129 (or (equal typekey " ") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
130 (equal typekey (nth 1 entry)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
131 (and toc (eq (car entry) 'toc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
132 (and index (eq (car entry) 'index)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
133 (and file |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
134 (memq (car entry) '(bof eof file-error)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
135 (setq lastentry entry)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
136 (if (eq entry here-am-I) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
137 (throw 'exit (or lastentry entry)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
138 nil)))) |
25280 | 139 |
140 (defun reftex-insert-docstruct | |
141 (buf toc labels index-entries files context counter show-commented | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
142 here-I-am xr-prefix toc-buffer) |
25280 | 143 ;; Insert an excerpt of the docstruct list. |
144 ;; Return the data property of the entry corresponding to HERE-I-AM. | |
145 ;; BUF is the buffer which has the correct docstruct-symbol. | |
146 ;; LABELS non-nil means to include labels into the list. | |
147 ;; When a string, indicates the label type to include | |
34402
5eec8d1d09f0
Update to RefTeX 4.15, see ChangeLog for details
Carsten Dominik <dominik@science.uva.nl>
parents:
29775
diff
changeset
|
148 ;; FILES non-nil means to display file boundaries. |
25280 | 149 ;; CONTEXT non-nil means to include label context. |
150 ;; COUNTER means to count the labels. | |
151 ;; SHOW-COMMENTED means to include also labels which are commented out. | |
152 ;; HERE-I-AM is a member of the docstruct list. The function will return | |
153 ;; a used member near to this one, as a possible starting point. | |
154 ;; XR-PREFIX is the prefix to put in front of labels. | |
155 ;; TOC-BUFFER means this is to fill the toc buffer. | |
156 (let* ((font (reftex-use-fonts)) | |
157 (cnt 0) | |
158 (index -1) | |
159 (toc-indent " ") | |
160 (label-indent | |
161 (concat "> " | |
162 (if toc (make-string (* 7 reftex-level-indent) ?\ ) ""))) | |
163 (context-indent | |
164 (concat ". " | |
165 (if toc (make-string (* 7 reftex-level-indent) ?\ ) ""))) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
166 (mouse-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
167 (if (memq reftex-highlight-selection '(mouse both)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
168 reftex-mouse-selected-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
169 nil)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
170 (label-face (reftex-verified-face reftex-label-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
171 'font-lock-constant-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
172 'font-lock-reference-face)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
173 (index-face (reftex-verified-face reftex-index-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
174 'font-lock-constant-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
175 'font-lock-reference-face)) |
25280 | 176 all cell text label typekey note comment master-dir-re |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
177 prev-inserted offset from to index-tag docstruct-symbol) |
25280 | 178 |
179 ;; Pop to buffer buf to get the correct buffer-local variables | |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
180 (with-current-buffer buf |
25280 | 181 |
182 ;; Ensure access to scanning info | |
183 (reftex-access-scan-info) | |
184 | |
185 (setq docstruct-symbol reftex-docstruct-symbol | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
186 all (symbol-value reftex-docstruct-symbol) |
25280 | 187 reftex-active-toc nil |
188 master-dir-re | |
189 (concat "\\`" (regexp-quote | |
190 (file-name-directory (reftex-TeX-master-file)))))) | |
191 | |
192 (set (make-local-variable 'reftex-docstruct-symbol) docstruct-symbol) | |
193 (set (make-local-variable 'reftex-prefix) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
194 (cdr (assoc labels reftex-typekey-to-prefix-alist))) |
25280 | 195 (if (equal reftex-prefix " ") (setq reftex-prefix nil)) |
196 | |
197 ;; Walk the docstruct and insert the appropriate stuff | |
198 (while (setq cell (pop all)) | |
199 | |
200 (incf index) | |
201 (setq from (point)) | |
202 | |
203 (cond | |
204 | |
205 ((memq (car cell) '(bib thebib label-numbers appendix | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
206 master-dir bibview-cache is-multi xr xr-doc))) |
25280 | 207 ;; These are currently ignored |
208 | |
209 ((memq (car cell) '(bof eof file-error)) | |
210 ;; Beginning or end of a file | |
211 (when files | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
212 (setq prev-inserted cell) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
213 ; (if (eq offset 'attention) (setq offset cell)) |
25280 | 214 (insert |
215 " File " (if (string-match master-dir-re (nth 1 cell)) | |
216 (substring (nth 1 cell) (match-end 0)) | |
217 (nth 1 cell)) | |
218 (cond ((eq (car cell) 'bof) " starts here\n") | |
219 ((eq (car cell) 'eof) " ends here\n") | |
220 ((eq (car cell) 'file-error) " was not found\n"))) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
221 (setq to (point)) |
25280 | 222 (when font |
223 (put-text-property from to | |
224 'face reftex-file-boundary-face)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
225 (when toc-buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
226 (if mouse-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
227 (put-text-property from (1- to) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
228 'mouse-face mouse-face)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
229 (put-text-property from to :data cell)))) |
25280 | 230 |
231 ((eq (car cell) 'toc) | |
232 ;; a table of contents entry | |
26910
489a5439b988
* reftex.el (reftex-compile-variables): respect new structure of
Carsten Dominik <dominik@science.uva.nl>
parents:
25806
diff
changeset
|
233 (when (and toc |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
234 (<= (nth 5 cell) reftex-toc-max-level)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
235 (setq prev-inserted cell) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
236 ; (if (eq offset 'attention) (setq offset cell)) |
25280 | 237 (setq reftex-active-toc cell) |
238 (insert (concat toc-indent (nth 2 cell) "\n")) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
239 (setq to (point)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
240 (when font |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
241 (put-text-property from to |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
242 'face reftex-section-heading-face)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
243 (when toc-buffer |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
244 (if mouse-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
245 (put-text-property from (1- to) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
246 'mouse-face mouse-face)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
247 (put-text-property from to :data cell)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
248 (goto-char to))) |
25280 | 249 |
250 ((stringp (car cell)) | |
251 ;; a label | |
252 (when (null (nth 2 cell)) | |
253 ;; No context yet. Quick update. | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
254 (setcdr cell (cdr (reftex-label-info-update cell))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
255 (put docstruct-symbol 'modified t)) |
25280 | 256 |
257 (setq label (car cell) | |
258 typekey (nth 1 cell) | |
259 text (nth 2 cell) | |
260 comment (nth 4 cell) | |
261 note (nth 5 cell)) | |
262 | |
263 (when (and labels | |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
264 (or (eq labels t) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
265 (string= typekey labels) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
266 (string= labels " ")) |
25280 | 267 (or show-commented (null comment))) |
268 | |
269 ;; Yes we want this one | |
270 (incf cnt) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
271 (setq prev-inserted cell) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
272 ; (if (eq offset 'attention) (setq offset cell)) |
25280 | 273 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
274 (setq label (concat xr-prefix label)) |
25280 | 275 (when comment (setq label (concat "% " label))) |
276 (insert label-indent label) | |
277 (when font | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
278 (setq to (point)) |
25280 | 279 (put-text-property |
280 (- (point) (length label)) to | |
281 'face (if comment | |
282 'font-lock-comment-face | |
283 label-face)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
284 (goto-char to)) |
25280 | 285 |
286 (insert (if counter (format " (%d) " cnt) "") | |
287 (if comment " LABEL IS COMMENTED OUT " "") | |
288 (if (stringp note) (concat " " note) "") | |
289 "\n") | |
290 (setq to (point)) | |
291 | |
292 (when context | |
293 (insert context-indent text "\n") | |
294 (setq to (point))) | |
295 (put-text-property from to :data cell) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
296 (when mouse-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
297 (put-text-property from (1- to) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
298 'mouse-face mouse-face)) |
25280 | 299 (goto-char to))) |
300 | |
301 ((eq (car cell) 'index) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
302 ;; index entry |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
303 (when (and index-entries |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
304 (or (eq t index-entries) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
305 (string= index-entries (nth 1 cell)))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
306 (setq prev-inserted cell) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
307 ; (if (eq offset 'attention) (setq offset cell)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
308 (setq index-tag (format "<%s>" (nth 1 cell))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
309 (and font |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
310 (put-text-property 0 (length index-tag) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
311 'face reftex-index-tag-face index-tag)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
312 (insert label-indent index-tag " " (nth 7 cell)) |
25280 | 313 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
314 (when font |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
315 (setq to (point)) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
316 (put-text-property |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
317 (- (point) (length (nth 7 cell))) to |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
318 'face index-face) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
319 (goto-char to)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
320 (insert "\n") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
321 (setq to (point)) |
25280 | 322 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
323 (when context |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
324 (insert context-indent (nth 2 cell) "\n") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
325 (setq to (point))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
326 (put-text-property from to :data cell) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
327 (when mouse-face |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
328 (put-text-property from (1- to) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
329 'mouse-face mouse-face)) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
330 (goto-char to)))) |
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
331 |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
332 (if (eq cell here-I-am) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
333 (setq offset 'attention)) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
334 (if (and prev-inserted (eq offset 'attention)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
335 (setq offset prev-inserted)) |
47050
904fd28be439
Update to RefTeX 4.19
Carsten Dominik <dominik@science.uva.nl>
parents:
46683
diff
changeset
|
336 ) |
25280 | 337 |
338 (when (reftex-refontify) | |
339 ;; we need to fontify the buffer | |
340 (reftex-fontify-select-label-buffer buf)) | |
341 (run-hooks 'reftex-display-copied-context-hook) | |
342 offset)) | |
343 | |
344 (defun reftex-find-start-point (fallback &rest locations) | |
345 ;; Set point to the first available LOCATION. When a LOCATION is a list, | |
346 ;; search for such a :data text property. When it is an integer, | |
347 ;; use is as line number. FALLBACK is a buffer position used if everything | |
348 ;; else fails. | |
349 (catch 'exit | |
350 (goto-char (point-min)) | |
351 (let (loc pos) | |
352 (while locations | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
353 (setq loc (pop locations)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
354 (cond |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
355 ((null loc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
356 ((listp loc) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
357 (setq pos (text-property-any (point-min) (point-max) :data loc)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
358 (when pos |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
359 (goto-char pos) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
360 (throw 'exit t))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
361 ((integerp loc) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
362 (when (<= loc (count-lines (point-min) (point-max))) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
363 (goto-char (point-min)) |
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
364 (forward-line (1- loc)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
365 (throw 'exit t))))) |
25280 | 366 (goto-char fallback)))) |
367 | |
368 (defvar reftex-last-data nil) | |
369 (defvar reftex-last-line nil) | |
370 (defvar reftex-select-marked nil) | |
371 | |
372 (defun reftex-select-item (prompt help-string keymap | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
373 &optional offset |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
374 call-back cb-flag) |
25280 | 375 ;; Select an item, using PROMPT. The function returns a key indicating |
376 ;; an exit status, along with a data structure indicating which item was | |
377 ;; selected. | |
378 ;; HELP-STRING contains help. KEYMAP is a keymap with the available | |
379 ;; selection commands. | |
380 ;; OFFSET can be a label list item which will be selected at start. | |
381 ;; When it is t, point will start out at the beginning of the buffer. | |
382 ;; Any other value will cause restart where last selection left off. | |
383 ;; When CALL-BACK is given, it is a function which is called with the index | |
384 ;; of the element. | |
385 ;; CB-FLAG is the initial value of that flag. | |
386 | |
387 (let* (ev data last-data (selection-buffer (current-buffer))) | |
388 | |
389 (setq reftex-select-marked nil) | |
390 | |
391 (setq ev | |
392 (catch 'myexit | |
393 (save-window-excursion | |
394 (setq truncate-lines t) | |
395 | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
396 ;; Find a good starting point |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
397 (reftex-find-start-point |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
398 (point-min) offset reftex-last-data reftex-last-line) |
25280 | 399 (beginning-of-line 1) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
400 (set (make-local-variable 'reftex-last-follow-point) (point)) |
25280 | 401 |
402 (unwind-protect | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
403 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
404 (use-local-map keymap) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
405 (add-hook 'pre-command-hook 'reftex-select-pre-command-hook nil t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
406 (add-hook 'post-command-hook 'reftex-select-post-command-hook nil t) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
407 (princ prompt) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
408 (set-marker reftex-recursive-edit-marker (point)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
409 ;; XEmacs does not run post-command-hook here |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
410 (and (featurep 'xemacs) (run-hooks 'post-command-hook)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
411 (recursive-edit)) |
25280 | 412 |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
413 (set-marker reftex-recursive-edit-marker nil) |
105813
df4934f25eef
* textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104543
diff
changeset
|
414 (with-current-buffer selection-buffer |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
415 (use-local-map nil) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
416 (remove-hook 'pre-command-hook 'reftex-select-pre-command-hook t) |
85284
4e8918d06189
(reftex-select-item): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
85196
diff
changeset
|
417 (remove-hook 'post-command-hook |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
418 'reftex-select-post-command-hook t)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
419 ;; Kill the mark overlays |
85284
4e8918d06189
(reftex-select-item): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
85196
diff
changeset
|
420 (mapc (lambda (c) (reftex-delete-overlay (nth 1 c))) |
4e8918d06189
(reftex-select-item): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
85196
diff
changeset
|
421 reftex-select-marked))))) |
25280 | 422 |
423 (set (make-local-variable 'reftex-last-line) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
424 (+ (count-lines (point-min) (point)) (if (bolp) 1 0))) |
25280 | 425 (set (make-local-variable 'reftex-last-data) last-data) |
426 (reftex-kill-buffer "*RefTeX Help*") | |
427 (setq reftex-callback-fwd (not reftex-callback-fwd)) ;; ;-))) | |
428 (message "") | |
429 (list ev data last-data))) | |
430 | |
431 ;; The following variables are all bound dynamically in `reftex-select-item'. | |
432 ;; The defvars are here only to silence the byte compiler. | |
433 | |
434 (defvar found-list) | |
435 (defvar cb-flag) | |
436 (defvar data) | |
437 (defvar prompt) | |
438 (defvar last-data) | |
439 (defvar call-back) | |
440 (defvar help-string) | |
441 (defvar refstyle) | |
442 | |
443 ;; The selection commands | |
444 | |
445 (defun reftex-select-pre-command-hook () | |
446 (reftex-unhighlight 1) | |
447 (reftex-unhighlight 0)) | |
448 | |
449 (defun reftex-select-post-command-hook () | |
450 (let (b e) | |
451 (setq data (get-text-property (point) :data)) | |
452 (setq last-data (or data last-data)) | |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
453 |
25280 | 454 (when (and data cb-flag |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
455 (not (equal reftex-last-follow-point (point)))) |
25280 | 456 (setq reftex-last-follow-point (point)) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
457 (funcall call-back data reftex-callback-fwd |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
458 (not reftex-revisit-to-follow))) |
25280 | 459 (if data |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
460 (setq b (or (previous-single-property-change |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
461 (1+ (point)) :data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
462 (point-min)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
463 e (or (next-single-property-change |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
464 (point) :data) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
465 (point-max))) |
25280 | 466 (setq b (point) e (point))) |
467 (and (memq reftex-highlight-selection '(cursor both)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
468 (reftex-highlight 1 b e)) |
25280 | 469 (if (or (not (pos-visible-in-window-p b)) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
470 (not (pos-visible-in-window-p e))) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
471 (recenter '(4))) |
25280 | 472 (unless (current-message) |
473 (princ prompt)))) | |
474 | |
475 (defun reftex-select-next (&optional arg) | |
476 "Move to next selectable item." | |
477 (interactive "p") | |
478 (setq reftex-callback-fwd t) | |
479 (or (eobp) (forward-char 1)) | |
480 (re-search-forward "^[^. \t\n\r]" nil t arg) | |
481 (beginning-of-line 1)) | |
482 (defun reftex-select-previous (&optional arg) | |
483 "Move to previous selectable item." | |
484 (interactive "p") | |
485 (setq reftex-callback-fwd nil) | |
486 (re-search-backward "^[^. \t\n\r]" nil t arg)) | |
37998
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
487 (defun reftex-select-jump (arg) |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
488 "Jump to a specific section. E.g. '3 z' jumps to section 3. |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
489 Useful for large TOC's." |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
490 (interactive "P") |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
491 (goto-char (point-min)) |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
492 (re-search-forward |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
493 (concat "^ *" (number-to-string (if (numberp arg) arg 1)) " ") |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
494 nil t) |
706af946b1e7
* reftex-ref.el (reftex-select-label-help): Added "z" key
Carsten Dominik <dominik@science.uva.nl>
parents:
34402
diff
changeset
|
495 (beginning-of-line)) |
25280 | 496 (defun reftex-select-next-heading (&optional arg) |
497 "Move to next table of contentes line." | |
498 (interactive "p") | |
499 (end-of-line) | |
500 (re-search-forward "^ " nil t arg) | |
501 (beginning-of-line)) | |
502 (defun reftex-select-previous-heading (&optional arg) | |
503 "Move to previous table of contentes line." | |
504 (interactive "p") | |
505 (re-search-backward "^ " nil t arg)) | |
506 (defun reftex-select-quit () | |
507 "Abort selection process." | |
508 (interactive) | |
509 (throw 'myexit nil)) | |
510 (defun reftex-select-keyboard-quit () | |
511 "Abort selection process." | |
512 (interactive) | |
513 (throw 'exit t)) | |
514 (defun reftex-select-jump-to-previous () | |
515 "Jump back to where previous selection process left off." | |
516 (interactive) | |
517 (let (pos) | |
518 (cond | |
519 ((and (local-variable-p 'reftex-last-data (current-buffer)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
520 reftex-last-data |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
521 (setq pos (text-property-any (point-min) (point-max) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
522 :data reftex-last-data))) |
25280 | 523 (goto-char pos)) |
524 ((and (local-variable-p 'reftex-last-line (current-buffer)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
525 (integerp reftex-last-line)) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
526 (goto-char (point-min)) |
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
527 (forward-line (1- reftex-last-line))) |
25280 | 528 (t (ding))))) |
529 (defun reftex-select-toggle-follow () | |
530 "Toggle follow mode: Other window follows with full context." | |
531 (interactive) | |
532 (setq reftex-last-follow-point -1) | |
533 (setq cb-flag (not cb-flag))) | |
534 (defun reftex-select-toggle-varioref () | |
535 "Toggle the macro used for referencing the label between \\ref and \\vref." | |
536 (interactive) | |
537 (if (string= refstyle "\\ref") | |
538 (setq refstyle "\\vref") | |
539 (setq refstyle "\\ref")) | |
540 (force-mode-line-update)) | |
541 (defun reftex-select-toggle-fancyref () | |
542 "Toggle the macro used for referencing the label between \\ref and \\vref." | |
543 (interactive) | |
544 (setq refstyle | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
545 (cond ((string= refstyle "\\ref") "\\fref") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
546 ((string= refstyle "\\fref") "\\Fref") |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
547 (t "\\ref"))) |
25280 | 548 (force-mode-line-update)) |
549 (defun reftex-select-show-insertion-point () | |
550 "Show the point from where selection was started in another window." | |
551 (interactive) | |
552 (let ((this-window (selected-window))) | |
553 (unwind-protect | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
554 (progn |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
555 (switch-to-buffer-other-window |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
556 (marker-buffer reftex-select-return-marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
557 (goto-char (marker-position reftex-select-return-marker)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
558 (recenter '(4))) |
25280 | 559 (select-window this-window)))) |
560 (defun reftex-select-callback () | |
561 "Show full context in another window." | |
562 (interactive) | |
563 (if data (funcall call-back data reftex-callback-fwd nil) (ding))) | |
564 (defun reftex-select-accept () | |
565 "Accept the currently selected item." | |
566 (interactive) | |
567 (throw 'myexit 'return)) | |
568 (defun reftex-select-mouse-accept (ev) | |
569 "Accept the item at the mouse click." | |
570 (interactive "e") | |
571 (mouse-set-point ev) | |
572 (setq data (get-text-property (point) :data)) | |
573 (setq last-data (or data last-data)) | |
574 (throw 'myexit 'return)) | |
575 (defun reftex-select-read-label () | |
576 "Use minibuffer to read a label to reference, with completion." | |
577 (interactive) | |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
578 (let ((label (completing-read |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
579 "Label: " (symbol-value reftex-docstruct-symbol) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
580 nil nil reftex-prefix))) |
25280 | 581 (unless (or (equal label "") (equal label reftex-prefix)) |
582 (throw 'myexit label)))) | |
583 (defun reftex-select-read-cite () | |
584 "Use minibuffer to read a citation key with completion." | |
585 (interactive) | |
586 (let* ((key (completing-read "Citation key: " found-list)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
587 (entry (assoc key found-list))) |
25280 | 588 (cond |
589 ((or (null key) (equal key ""))) | |
590 (entry | |
591 (setq data entry) | |
592 (setq last-data data) | |
593 (throw 'myexit 'return)) | |
594 (t (throw 'myexit key))))) | |
595 | |
596 (defun reftex-select-mark (&optional separator) | |
597 "Mark the entry." | |
598 (interactive) | |
599 (let* ((data (get-text-property (point) :data)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
600 boe eoe ovl) |
25280 | 601 (or data (error "No entry to mark at point")) |
602 (if (assq data reftex-select-marked) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
603 (error "Entry is already marked")) |
25280 | 604 (setq boe (or (previous-single-property-change (1+ (point)) :data) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
605 (point-min)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
606 eoe (or (next-single-property-change (point) :data) (point-max))) |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
607 (setq ovl (reftex-make-overlay boe eoe)) |
25280 | 608 (push (list data ovl separator) reftex-select-marked) |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
609 (reftex-overlay-put ovl 'face reftex-select-mark-face) |
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
610 (reftex-overlay-put ovl 'before-string |
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
611 (if separator |
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
612 (format "*%c%d* " separator |
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
613 (length reftex-select-marked)) |
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
614 (format "*%d* " (length reftex-select-marked)))) |
25280 | 615 (message "Entry has mark no. %d" (length reftex-select-marked)))) |
616 | |
617 (defun reftex-select-mark-comma () | |
618 "Mark the entry and store the `comma' separator." | |
619 (interactive) | |
620 (reftex-select-mark ?,)) | |
621 (defun reftex-select-mark-to () | |
622 "Mark the entry and store the `to' separator." | |
623 (interactive) | |
624 (reftex-select-mark ?-)) | |
625 (defun reftex-select-mark-and () | |
626 "Mark the entry and store `and' to separator." | |
627 (interactive) | |
628 (reftex-select-mark ?+)) | |
629 | |
630 (defun reftex-select-unmark () | |
631 "Unmark the entry." | |
632 (interactive) | |
633 (let* ((data (get-text-property (point) :data)) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
634 (cell (assq data reftex-select-marked)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
635 (ovl (nth 1 cell)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
636 (cnt 0) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
637 sep) |
25280 | 638 (unless cell |
639 (error "No marked entry at point")) | |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
640 (and ovl (reftex-delete-overlay ovl)) |
25280 | 641 (setq reftex-select-marked (delq cell reftex-select-marked)) |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
642 (setq cnt (1+ (length reftex-select-marked))) |
85196
5aad543561c0
(reftex-select-unmark): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
643 (mapc (lambda (c) |
5aad543561c0
(reftex-select-unmark): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
644 (setq sep (nth 2 c)) |
5aad543561c0
(reftex-select-unmark): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
645 (reftex-overlay-put (nth 1 c) 'before-string |
5aad543561c0
(reftex-select-unmark): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
646 (if sep |
5aad543561c0
(reftex-select-unmark): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
647 (format "*%c%d* " sep (decf cnt)) |
5aad543561c0
(reftex-select-unmark): Use mapc rather than mapcar.
Glenn Morris <rgm@gnu.org>
parents:
78225
diff
changeset
|
648 (format "*%d* " (decf cnt))))) |
62467
35f6599373fc
* textmodes/reftex-vars.el (reftex-cite-format-builtin): Support
Carsten Dominik <dominik@science.uva.nl>
parents:
59534
diff
changeset
|
649 reftex-select-marked) |
25280 | 650 (message "Entry no longer marked"))) |
651 | |
652 (defun reftex-select-help () | |
653 "Display a summary of the special key bindings." | |
654 (interactive) | |
655 (with-output-to-temp-buffer "*RefTeX Help*" | |
656 (princ help-string)) | |
657 (reftex-enlarge-to-fit "*RefTeX Help*" t)) | |
658 | |
659 ;; Common bindings in reftex-select-label-map and reftex-select-bib-map | |
660 (let ((map (make-sparse-keymap))) | |
661 (substitute-key-definition | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
662 'next-line 'reftex-select-next map global-map) |
25280 | 663 (substitute-key-definition |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
664 'previous-line 'reftex-select-previous map global-map) |
25280 | 665 (substitute-key-definition |
666 'keyboard-quit 'reftex-select-keyboard-quit map global-map) | |
667 (substitute-key-definition | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
668 'newline 'reftex-select-accept map global-map) |
25280 | 669 |
670 (loop for x in | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
671 '((" " . reftex-select-callback) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
672 ("n" . reftex-select-next) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
673 ([(down)] . reftex-select-next) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
674 ("p" . reftex-select-previous) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
675 ([(up)] . reftex-select-previous) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
676 ("f" . reftex-select-toggle-follow) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
677 ("\C-m" . reftex-select-accept) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
678 ([(return)] . reftex-select-accept) |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
679 ("q" . reftex-select-quit) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
680 ("." . reftex-select-show-insertion-point) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
681 ("?" . reftex-select-help)) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
682 do (define-key map (car x) (cdr x))) |
25280 | 683 |
684 ;; The mouse-2 binding | |
685 (if (featurep 'xemacs) | |
686 (define-key map [(button2)] 'reftex-select-mouse-accept) | |
69177
a4c2155cc832
(reftex-select-label-map,
Carsten Dominik <dominik@science.uva.nl>
parents:
69094
diff
changeset
|
687 (define-key map [(mouse-2)] 'reftex-select-mouse-accept) |
a4c2155cc832
(reftex-select-label-map,
Carsten Dominik <dominik@science.uva.nl>
parents:
69094
diff
changeset
|
688 (define-key map [follow-link] 'mouse-face)) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
689 |
25280 | 690 |
691 ;; Digit arguments | |
692 (loop for key across "0123456789" do | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
693 (define-key map (vector (list key)) 'digit-argument)) |
25280 | 694 (define-key map "-" 'negative-argument) |
695 | |
696 ;; Make two maps | |
697 (setq reftex-select-label-map map) | |
698 (setq reftex-select-bib-map (copy-keymap map))) | |
699 | |
700 ;; Specific bindings in reftex-select-label-map | |
701 (loop for key across "aAcgFlrRstx#%" do | |
702 (define-key reftex-select-label-map (vector (list key)) | |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
703 (list 'lambda '() |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
704 "Press `?' during selection to find out about this key." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
705 '(interactive) (list 'throw '(quote myexit) key)))) |
25280 | 706 |
707 (loop for x in | |
708 '(("b" . reftex-select-jump-to-previous) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
709 ("z" . reftex-select-jump) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
710 ("v" . reftex-select-toggle-varioref) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
711 ("V" . reftex-select-toggle-fancyref) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
712 ("m" . reftex-select-mark) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
713 ("u" . reftex-select-unmark) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
714 ("," . reftex-select-mark-comma) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
715 ("-" . reftex-select-mark-to) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
716 ("+" . reftex-select-mark-and) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
717 ([(tab)] . reftex-select-read-label) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
718 ("\C-i" . reftex-select-read-label) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
719 ("\C-c\C-n" . reftex-select-next-heading) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
720 ("\C-c\C-p" . reftex-select-previous-heading)) |
25280 | 721 do |
722 (define-key reftex-select-label-map (car x) (cdr x))) | |
723 | |
724 ;; Specific bindings in reftex-select-bib-map | |
59534
9bad65481674
2005-01-14 Carsten Dominik <dominik@science.uva.nl>
Carsten Dominik <dominik@science.uva.nl>
parents:
52401
diff
changeset
|
725 (loop for key across "grRaAeE" do |
25280 | 726 (define-key reftex-select-bib-map (vector (list key)) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
727 (list 'lambda '() |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
728 "Press `?' during selection to find out about this key." |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
729 '(interactive) (list 'throw '(quote myexit) key)))) |
25280 | 730 |
731 (loop for x in | |
732 '(("\C-i" . reftex-select-read-cite) | |
52170
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
733 ([(tab)] . reftex-select-read-cite) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
734 ("m" . reftex-select-mark) |
27340819ef07
Updated to version 4.21
Carsten Dominik <dominik@science.uva.nl>
parents:
49599
diff
changeset
|
735 ("u" . reftex-select-unmark)) |
25280 | 736 do (define-key reftex-select-bib-map (car x) (cdr x))) |
104543
da8b3e61b182
Use forward-line rather than goto-line.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
737 |
25280 | 738 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
739 ;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464 |
25280 | 740 ;;; reftex-sel.el ends here |