[Top][All Lists]

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

Re: address@hidden: shell-script-mode case indenting]

From: Michael Welsh Duggan
Subject: Re: address@hidden: shell-script-mode case indenting]
Date: Tue, 03 Oct 2006 23:33:17 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> In your new code, what is the purpose of the following line in the loop:
>>> (unless (eobp) (forward-char 1))
>> Don't move forward by a character if at the end of a (narrowed)
>> buffer.
> Well, that's the result, not the purpose :-(
>> The need to move forward a character was experimentally
>> determined, I am afraid.
> That's the part I'm interested in.  Could you give us some idea of the case(s)
> you've encountered where it was found necessary?

It actually took me a long time to figure out why.  (I was at work
when I answered you originally, and as such couldn't verify why at the

Before you restructured `sh-prev-thing' to not use narrowing, the

                (unless (bolp)
                  (forward-char -1)))

on line 2263-4 (in `sh-get-indent-info') would place the cursor before
the last character of the previous token.  When narrowed by the next
call to `sh-prev-thing', the narrowing cut off that character, causing
`sh-get-word' to fail to get the next word.

Your change which removes narrowing in favor of explicit match limits
is a much more elegant solution, and obviates the need for the
questionable line.

Michael Welsh Duggan

reply via email to

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