auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Re: Impending release...


From: Ralf Angeli
Subject: Re: [AUCTeX-devel] Re: Impending release...
Date: Tue, 10 May 2005 15:32:50 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

* David Kastrup (2005-05-10) writes:

> Ralf Angeli <address@hidden> writes:
>
>> * David Kastrup (2005-05-10) writes:
>>
>>> Ralf Angeli <address@hidden> writes:
>>>
>>>> And how do you make sure that `forward-comment' will look into a
>>>> line starting with a "%" character rather than skip it?
>>>
>>> What has that to do with limiting the search?
>>
>> As this seems to be working so good right now,
>
> As _what_ seems to be working now?

Communicating with questions only.

> Ignoring my questions and coming
> up with something completely unrelated?

As there obviously was a communication problem -- either you
misunderstood something or I did -- I asked a question which I hoped
would help to clarify things.  With the introductory sentence I just
wanted to point out in a nice way the fact that we are asking question
after question.  Okay, next time I'll refrain from that and will just
take the risk of sounding snotty.

> Could you be so kind as to
> tell me just _what_ kind of work is achieved well by that?  Maybe we
> can arrive at a less annoying and more constructive way of achieving
> the goal that you appear to be aiming for.

It is _you_ who is not satisfied.  _I_ already achieved my goal.

> It is quite hard to guess what this is supposed to be about.  The code
> is rather obfuscated.  So if we are at the beginning of a line, we
> skip across single line that may start with comment characters,
> followed by any number of whitespace-only lines.  Then while we are
> looking at any such lines that are not completely empty, we move to
> the beginning of the next line.
>
> Then if we are at the beginning of a line, we skip percent characters,
> followed by non-newline whitespace.  And if any non-newline whitespace
> has been skipped and there happens to be a percent character after
> this skipping, we move to the next line.
>
> Ralf, this is simply insane.

I already wrote that it is ugly.

> Ok, so what you seem to be trying to do is to skip across white space
> and at most one comment not starting in column 1.  I have no clue why
> you'd want to do that,

The code is supposed to find the start of macro arguments and thereby
has to skip whitespace and comments between e.g. the end of the macro
name and the start of the argument.  For example, it has to deal with
code like

\foo-1-% some comment
  -2-{bar}

or in docTeX mode with

% \foo-1-
%   -2-{bar}

"-1-" marks the starting point and "-2-" where point should end up.

> but assuming that you do, you'd have to do
> something like
>
> (while (and (< (point) limit)
>             (progn (if (bolp) (skip-chars-forward "%" limit))
>                    (> (skip-chars-forward " \t\n" limit) 0))))
> (when (< (point) limit)
>   (when (eq (char-after) ?%)
>     (beginning-of-line 2)))

Yes, that's much nicer.  Thanks.  I checked in an adapted version of
it.

> But as I already said: it seems easier to just do a narrow-to-region
> in order to have `limit' heeded.

`limit' will usually not be reached by `font-latex-forward-comment'
anyway because it will stop at the next non-whitespace character which
is not in a comment.  So I don't think this will improve performance
in a measurable way.  But I implemented it anyway because it allowed
me to simplify the code a bit.  Hopefully it will make you happy as
well.

-- 
Ralf




reply via email to

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