From: Tassilo Horn Date: Fri, 19 Nov 2010 11:18:15 +0000 (+0100) Subject: * textmodes/reftex-ref.el (reftex-goto-label): If point is inside X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~193 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9061f667df3e306edf9e40686e5dc5551fc8d607;p=emacs.git * textmodes/reftex-ref.el (reftex-goto-label): If point is inside a \ref{} or \pageref{} macro, then use its value as initial input. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 166f30c0574..be4a885a666 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-11-19 Tassilo Horn + + * textmodes/reftex-ref.el (reftex-goto-label): If point is inside + a \ref{} or \pageref{} macro, then use its value as initial input. + 2010-11-19 Jay Belanger * 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." (let* ((wcfg (current-window-configuration)) (docstruct (symbol-value reftex-docstruct-symbol)) (label (completing-read "Label: " docstruct - (lambda (x) (stringp (car x))) t)) + (lambda (x) (stringp (car x))) t + ;; If point is inside a \ref{} or + ;; \pageref{}, use that as initial + ;; input. + (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*") + (reftex-this-word "-a-zA-Z0-9_*.:")))) (selection (assoc label docstruct)) (where (progn (reftex-show-label-location selection t nil 'stay)