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