[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r102438: * textmodes/reftex-ref.e
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r102438: * textmodes/reftex-ref.el (reftex-goto-label): If point is inside |
Date: |
Mon, 22 Nov 2010 09:48:32 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
>>> (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_*.:"))))
>>
>> This seems to go against our conventions of keeping the initial
>> minibuffer contents empty and rely on the default value instead.
> Ah, I didn't know about that convention, but I can see that this is
> indeed better.
I actually don't claim it's better. With delete-selection-mode, the use
of an initial-content works just as well (and with the advantage that it's
the standard approach used by most other applications).
> I fixed it in the way you suggested...
>> I.e. the above should be something like:
>>
>> ;; If point is inside a \ref{} or \pageref{}, use that as
>> ;; initial input.
>> (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*")
>> (reftex-this-word "-a-zA-Z0-9_*.:"))))
>> (label (completing-read (if default
>> (format "Label (default %s): " default)
>> "Label: ")
>> docstruct
>> (lambda (x) (stringp (car x))) t nil nil
>> default))
> ... and also adapted the comment. ;-)
Thanks,
Stefan