auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Re: Contribution to AUCTeX


From: Ralf Angeli
Subject: [AUCTeX-devel] Re: Contribution to AUCTeX
Date: Sat, 24 Jul 2010 16:40:02 +0200

* Vincent Belaïche (2010-07-19) writes:

>> I think we should have two separate marking functions, one for nodes and
>> one for chapter structuring commands. I'd consider the latter one more
>> relevant for AUCTeX.
>
> The reason why I had thought of a single function is that you then need
> a single keybinding (C-c *). I can split into two functions, but then
> you should please provide me with the keybinding to be used for nodes.

We could also choose not to provide a key binding for it.

> Note that the current function works for chapter structuring
> Texinfo commands by default, so it fulfills your point that "you'd consider
> the latter one more relevant for AUCTeX"

Yes, but this is not the point.  The point is that the prefix argument
is used to control orthogonal features: the inclusion of subsections and
the type of structuring command to mark.  If you wanted to cover all
combinations you'd have to provide an interface like that:

* no prefix argument: mark section including subsections
* C-u: mark section without subsections
* C-u C-u: mark node including subnodes
* C-u C-u C-u: mark node without subnodes

If you have two separate functions then you can use the prefix argument
for the inclusion of subsections or subnodes only, which is much cleaner
IMO.

>> In your last mail you wrote the following about
>> `Texinfo-structuring-command-re':
>>
>> | I however declared Texinfo-structuring-command-re as a defvar to avoid
>> | memory duplication (ie when there are several Texinfo buffer the same
>> | string will be used in memory).
>>
>> Are you sure the above code would really accomplish that? Wouldn't
>> there still be a separate string in memory for each buffer where
>> `outline-regexp' is set? 
>
> The memory will be allocated separately for the symbols as the
> outline-regexp symbol is buffer local, but each symbol instance will
> point to the same string. So yes, memory for the string is saved.

Okay.  Thanks for the example.

>> Personally I'd rather live with a little bit more memory consumption
>> than obfuscating the code like in the example above.
>
> What I consider obfuscating is that there could be different values of
> outline-regexp for different buffers, This seems quite unlikely. 
>
> I agree that because you need one more symbol
> Texinfo-structuring-command-re, and the memory thereof, and the extra
> code to make the string value comparison and revert to prior behaviour
> if the strings are different, then memory saving may be non-existing if
> there are only two buffers, but sometimes you grep on lots of files, and
> you may have significantly more than two buffers.
>
> Anyhow, if you make a point that I should come back to the prior simpler
> coding, I am not so strongly opinionated on this, and I can do it if you
> were not convinced by what precedes. I have been so much involved in
> embedded systems in my professional life, that I am sometimes a bit to
> obsessed with resource consumptions.

As mentioned before I'd rather live with a bit more memory consumption
and have code that is easier to understand.  An optimization like you
propose could be made when we see that the memory consumption gets out
of hand but I don't think that the code we are discussing has a large
impact.

Anyhow, if you think the optimization is worth keeping, then keep it,
but then please add a comment about why it was implemented like that
instead of using a simple solution.

Besides, my computer died a few days ago and is currently in repair.  I
likely won't install all the things necessary to do coding or CVS
commits for AUCTeX on the temporary replacement I am using, so things
like that will have to wait a few days.

-- 
Ralf



reply via email to

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