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: Vincent Belaïche
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:10:23 +0100


----------------------------------------
> From: address@hidden
> To: address@hidden
> CC: address@hidden
> 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 08:43:08 +0100
>
> Vincent Belaïche <address@hidden> writes:
>
>>> If there's something else I have to do, please tell me.
>>
>> Indeed, this revision which I had proposed seems to be useless as far
>> as execution speed is concerned --- at least that was not why Stefan
>> did the change, and nobody had complained.
>>
>> However it still have some added value in terms of warning the user in
>> case that a duplicate node name is detected.
>
> Ah, right, that's indeed useful.
>
>> So, I am not really opinionated whether this further change is needed,
>> it is up to you...
>
> I think the hash-table approach is a bit over-engineered. I've
> committed something simpler in
>
> http://git.savannah.gnu.org/cgit/auctex.git/commit/?id=fb09c26aa539c1a3a48ccf78098ed536f48c4870
>

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")))

> 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.


> Bye,
> Tassilo

Bye,
   Vincent.

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


reply via email to

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