auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Patch to tex-info.el to support node name completion in @..


From: Tassilo Horn
Subject: Re: [AUCTeX] Patch to tex-info.el to support node name completion in @..ref commands, and solve a few other pbs
Date: Wed, 28 Oct 2015 10:32:42 +0100
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Vincent Belaïche <address@hidden> writes:

> I have not tested the change, but reading this:
>
>       (message "There are duplicate nodes:")
>       (dolist (dup (nreverse dups))
>     (message "    %s on line %d" (car dup) (cdr dup))))
>
> I gather that the "There are duplicate nodes:" message will be output
> even when dups is nil. Furthermore if you have N duplicates you will have
> N+1 message and only the last one will remain in the minibuffer ---
> meaning that the user has to go to the *Message* buffer. That is why I
> was using the `warn' function. If you want to use `message' it might be
> better to contatenate all the messages together, maybe something like
> this (not tested):
>
> (and dups
>    (message "There are duplicate nodes: %s"
>       (mapconcat (lambda (x) (format "%s on line %d"
>                    (car x) (cdr x))) (nreverse dups) "\n\t")))

Gosh, and there was also a void-variable error because I didn't test
again after removing the nodes argument. ;-)

Ok, now I've fixed it and use `display-warning' with CLASS set to
'AUCTeX so that users also see who issued the warning.  That's much
better.  But I'm not entirely sure if very old emacsen have that: I
checked GNU Emacs 22+ and XEmacs 21.5 but it would be great if somebody
could check Emacs 21.4 and XEmacs 21.4.

>> I've also removed the optional NODES parameter because apparently nobody
>> used it anyway.
>
> Yes, I had used this nodes argument in case that the code is evolved
> to do partial rescan instead of full rescan...  But I agree that this
> is useless for now, let us not make the code confusing. Anyway, if we
> are to do more clever things it would be better to integrate the
> change with reftex so that node references can also appear in the
> reftex *toc* buffer and we also get all the multifile stuff.  Anyway
> the current code does not handle the @anchor{...} reference, just
> nodes --- better than nothing.

Patches welcome!

> PS: BTW, what is the use of calling `nreverse' over `nodes' at
> function return ?

Just to have the list of nodes be in the definition order.  That's not
really required but more intuitive.

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]