From: Michael Welsh Duggan <md5i@cs.cmu.edu>
Cc: Glenn Morris <rgm@gnu.org>,
emacs-devel@gnu.org, rms@gnu.org, jidanni@jidanni.org
Subject: Re: [jidanni@jidanni.org: shell-script-mode case indenting]
Date: Tue, 03 Oct 2006 23:33:17 -0400 [thread overview]
Message-ID: <87ac4cvjpe.fsf@cs.cmu.edu> (raw)
In-Reply-To: <jwvbqot2npk.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue\, 03 Oct 2006 15\:41\:29 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> 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
time.)
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
(md5i@cs.cmu.edu)
next prev parent reply other threads:[~2006-10-04 3:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-21 20:15 [jidanni@jidanni.org: shell-script-mode case indenting] Richard Stallman
2006-09-21 22:29 ` Michael Welsh Duggan
2006-09-22 17:01 ` Richard Stallman
2006-09-30 20:06 ` Glenn Morris
2006-10-01 15:15 ` Richard Stallman
2006-10-01 18:38 ` Michael Welsh Duggan
2006-10-01 23:43 ` Glenn Morris
2006-10-02 14:37 ` Stefan Monnier
2006-10-03 19:22 ` Michael Welsh Duggan
2006-10-03 19:41 ` Stefan Monnier
2006-10-04 3:33 ` Michael Welsh Duggan [this message]
2006-10-04 4:09 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ac4cvjpe.fsf@cs.cmu.edu \
--to=md5i@cs.cmu.edu \
--cc=emacs-devel@gnu.org \
--cc=jidanni@jidanni.org \
--cc=rgm@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).