+2010-11-19 Tassilo Horn <tassilo@member.fsf.org>
+
+ * 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 <jay.p.belanger@gmail.com>
* calc/calc-units.el (math-build-units-table-buffer):
(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)