[Top][All Lists]

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

Re: skeleton.el machinery eats newlines.

From: Luc Teirlinck
Subject: Re: skeleton.el machinery eats newlines.
Date: Sat, 11 Jan 2003 20:22:03 -0600 (CST)

Here is the problem with my previous patch:

The return value of sh-get-indent-info after my patch avoiding the
"Beginning of buffer error" (in the previously described situation)

((t 1) (+ sh-indent-for-case-alt) (+ sh-indent-for-case-label))

Now we add:
#! /usr/local/bin/bash
and a blank line at the beginning of the buffer.

New return value (same relative position of point):

((t 25) (+ sh-indent-for-case-alt))

Adding only a blank line yields:

((t 2) (+ sh-indent-for-case-alt))

The 25 and 2 are expected.  The beginning of the case statement is now
at position 25 (2, respectively).  However, somehow the 
(+ sh-indent-for-case-label) in the first return value seems to be
a remaining bug.

Note that the entire bug never occurs if the file starts with any kind
of comment, magic or not, or with a blank line.  Even if we can take
care of this problem, I do not know whether there are no other places
in the indentation machinery that assume the file to start with some
kind of comment, or blank line.

Could somebody familiar with the shell indentation machinery take a
look at this?  The (forward-char -1) is where the problem manifests
itself.  Clearly at the beginning of the buffer we should definitely
not call (forward-char -1), but somehow for the remaining code to work
well point should be at "the end of the line before the beginning of
the buffer".



reply via email to

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