emacs-devel
[Top][All Lists]
Advanced

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

skeleton.el machinery eats newlines.


From: Luc Teirlinck
Subject: skeleton.el machinery eats newlines.
Date: Tue, 7 Jan 2003 22:29:11 -0600 (CST)

Would it be possible for somebody more familiar with the skeleton.el
machinery than I am to take a look at the following?  Something in the
skeleton.el machinery seems to "eat newlines".

The actual manifestations of the problem (at least the ones known to
me) occur in the sh-mode commands sh-for and sh-case, but I believe
that some bug in skeleton.el is the actual underlying cause.

The commands sh-for and sh-case malfunction in the current CVS Emacs
and have apparently been malfunctioning for some time.  I used them in
Emacs20.7, but somehow I have not been using those commands again
until very recently.  The problem becomes immediately apparent by
putting a buffer in sh-mode for bash (other shells probably give
similar problems, but bash is what I use and what I looked at) and
then using C-c TAB and C-c C-c, answering, say "aa" , or whatever, to
all minibuffer questions.  Do this first in Emacs20.7 and then in
current CVS emacs.  Results:

Emacs20.7:

if [ aa ]; then
    
elif [ aa ]; then
    
elif [ aa ]; then
    
elif [ aa ]; then
    
else
    
fi

case aa in
    aa)
        
        ;;
    aa)
        
        ;;
    aa)
        
        ;;
    aa)
        
        ;;
    aa)
        
        ;;
    aa)
        
        ;;
    *)
        
esac

Looks perfect (at least to me).

Now today's CVS:

if [ aa ]; then
    
elif [ aa ]; then
elif [ aa ]; then
elif [ aa ]; then
elif [ aa ]; then
else
    
fi

case aa in
    aa)
    
    ;;
    aa)
    
    ;;aa)
    
    ;;aa)
    
    ;;aa)
    
        ;;*)
        
esac


Problem: Some obvious newlines are missing.  So, at first we guess
that there are newlines missing in the define-skeleton 's for those
commands.  But no, all necessary newlines seem to be there.  It is
actually perfectly possible to revert to the Emacs20.7 behavior by
adding extra newlines anyway.  The elif forms require two newlines in
the buffer.  There are two newlines in the define-skeleton, but we
need three in there to get two in the buffer.  For the case we need
three, there are three newlines in the define-skeleton but four are
needed to get three in the buffer.  

Can somebody familiar with skeleton.el tell me whether for some reason
this is actually expected behavior?  If it is, then the bug is in the
two define-skeleton's and is trivial to correct.  If not, the bug is in
skeleton.el and might be more complex.

A potential candidate for the trouble spot might be changes made by
Stefan, more than 7 months ago, in skeleton-internal-1, involving quite
some games with newlines.  I am absolutely not certain those changes
are the culprit, however.

I believe it would be a lot easier for somebody really familiar with
skeleton.el to get to the bottom of this than it would be for me.

Sincerely,

Luc.




reply via email to

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