diff options
| author | Tassilo Horn | 2010-11-19 12:18:15 +0100 |
|---|---|---|
| committer | Tassilo Horn | 2010-11-19 12:18:15 +0100 |
| commit | 9061f667df3e306edf9e40686e5dc5551fc8d607 (patch) | |
| tree | c20d02487c63ddb3b46522c69dfe40588502187e | |
| parent | 18c01d769ba8daf04af5ff512bf02a34289fdb7e (diff) | |
| download | emacs-9061f667df3e306edf9e40686e5dc5551fc8d607.tar.gz emacs-9061f667df3e306edf9e40686e5dc5551fc8d607.zip | |
* textmodes/reftex-ref.el (reftex-goto-label): If point is inside
a \ref{} or \pageref{} macro, then use its value as initial input.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-ref.el | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 166f30c0574..be4a885a666 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-11-19 Tassilo Horn <tassilo@member.fsf.org> | ||
| 2 | |||
| 3 | * textmodes/reftex-ref.el (reftex-goto-label): If point is inside | ||
| 4 | a \ref{} or \pageref{} macro, then use its value as initial input. | ||
| 5 | |||
| 1 | 2010-11-19 Jay Belanger <jay.p.belanger@gmail.com> | 6 | 2010-11-19 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 7 | ||
| 3 | * calc/calc-units.el (math-build-units-table-buffer): | 8 | * calc/calc-units.el (math-build-units-table-buffer): |
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 655d69b531d..ff3ffbc20ba 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el | |||
| @@ -831,7 +831,12 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window." | |||
| 831 | (let* ((wcfg (current-window-configuration)) | 831 | (let* ((wcfg (current-window-configuration)) |
| 832 | (docstruct (symbol-value reftex-docstruct-symbol)) | 832 | (docstruct (symbol-value reftex-docstruct-symbol)) |
| 833 | (label (completing-read "Label: " docstruct | 833 | (label (completing-read "Label: " docstruct |
| 834 | (lambda (x) (stringp (car x))) t)) | 834 | (lambda (x) (stringp (car x))) t |
| 835 | ;; If point is inside a \ref{} or | ||
| 836 | ;; \pageref{}, use that as initial | ||
| 837 | ;; input. | ||
| 838 | (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*") | ||
| 839 | (reftex-this-word "-a-zA-Z0-9_*.:")))) | ||
| 835 | (selection (assoc label docstruct)) | 840 | (selection (assoc label docstruct)) |
| 836 | (where (progn | 841 | (where (progn |
| 837 | (reftex-show-label-location selection t nil 'stay) | 842 | (reftex-show-label-location selection t nil 'stay) |