diff options
| author | Tassilo Horn | 2010-11-22 09:09:41 +0100 |
|---|---|---|
| committer | Tassilo Horn | 2010-11-22 09:09:41 +0100 |
| commit | c799747bd6b3a121d760ed5b4063a05cda425e81 (patch) | |
| tree | 832079a3c1b2006dd93baea367c499458e7a5a81 | |
| parent | b609f5916da6c2fc66864b390e05e807d85ea88f (diff) | |
| download | emacs-c799747bd6b3a121d760ed5b4063a05cda425e81.tar.gz emacs-c799747bd6b3a121d760ed5b4063a05cda425e81.zip | |
* textmodes/reftex-ref.el (reftex-goto-label): Use the current
\ref's or \pageref's value as default instead of initial input.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-ref.el | 21 |
2 files changed, 17 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d82eeac7788..5353efa267a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-11-22 Tassilo Horn <tassilo@member.fsf.org> | ||
| 2 | |||
| 3 | * textmodes/reftex-ref.el (reftex-goto-label): Use the current | ||
| 4 | \ref's or \pageref's value as default instead of initial input. | ||
| 5 | |||
| 1 | 2010-11-21 Michael Albinus <michael.albinus@gmx.de> | 6 | 2010-11-21 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * files.el (backup-by-copying-when-mismatch): The default value is | 8 | * files.el (backup-by-copying-when-mismatch): The default value is |
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index ff3ffbc20ba..91cc77480eb 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el | |||
| @@ -237,9 +237,9 @@ This function is controlled by the settings of reftex-insert-label-flags." | |||
| 237 | (setq label default)) | 237 | (setq label default)) |
| 238 | 238 | ||
| 239 | ;; Insert the label into the label list | 239 | ;; Insert the label into the label list |
| 240 | (let* ((here-I-am-info | 240 | (let* ((here-I-am-info |
| 241 | (save-excursion | 241 | (save-excursion |
| 242 | (if (and (or naked no-insert) | 242 | (if (and (or naked no-insert) |
| 243 | (integerp (cdr macro-cell))) | 243 | (integerp (cdr macro-cell))) |
| 244 | (goto-char (cdr macro-cell))) | 244 | (goto-char (cdr macro-cell))) |
| 245 | (reftex-where-am-I))) | 245 | (reftex-where-am-I))) |
| @@ -830,13 +830,16 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window." | |||
| 830 | (reftex-access-scan-info) | 830 | (reftex-access-scan-info) |
| 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 | ;; If point is inside a \ref{} or \pageref{}, use that as |
| 834 | (lambda (x) (stringp (car x))) t | 834 | ;; default value. |
| 835 | ;; If point is inside a \ref{} or | 835 | (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*") |
| 836 | ;; \pageref{}, use that as initial | 836 | (reftex-this-word "-a-zA-Z0-9_*.:"))) |
| 837 | ;; input. | 837 | (label (completing-read (if default |
| 838 | (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*") | 838 | (format "Label (default %s): " default) |
| 839 | (reftex-this-word "-a-zA-Z0-9_*.:")))) | 839 | "Label: ") |
| 840 | docstruct | ||
| 841 | (lambda (x) (stringp (car x))) t nil nil | ||
| 842 | default)) | ||
| 840 | (selection (assoc label docstruct)) | 843 | (selection (assoc label docstruct)) |
| 841 | (where (progn | 844 | (where (progn |
| 842 | (reftex-show-label-location selection t nil 'stay) | 845 | (reftex-show-label-location selection t nil 'stay) |