emacs-devel
[Top][All Lists]
Advanced

[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: Sun, 12 Jan 2003 11:10:02 -0600 (CST)

Stefan Monnier wrote:

   I believe it is because of the following:
   in Emacs-20, sh-script did not offer auto-indentation so skeletons used
   a "rigid" form of indentation defined in the skeleton's definition.
   In Emacs-21, OTOH sh-script offers auto-indentation and skeletons thus
   simply rely on it to do their job.

   Now why was the indentation style chosen differently in the indentation
   code than what the skeletons used, I don't know.

What is meant by auto-indentation?

What definitely changed between 20.7 and 21 is that the
indentation-style is now very customizable for shells derived from sh
and rc.  That should not have affected the default indentation and
all my "Sh Indentation" variables are at their standard settings.

You seem to suggest that sh-mode can now "indent-as-you-go" while one
is typing in one's shell script, like one can do in the Lisp or C
modes, regardless of whether one uses sh-if, sh-case and friends.

Maybe I am missing something, but how does this work?

The only indentation related bound commands in sh-mode are TAB and
C-j.  The main one I use and I believe most people use to
"indent-as-you-go" in Lisp or C modes is C-j.  In sh-mode this is
bound to sh-newline-and-indent.  C-h f yields:

    sh-newline-and-indent is an interactive compiled Lisp function in
    `/usr/local/share/emacs/21.3.50/lisp/progmodes/sh-script.elc'.
    It is bound to C-j.
    (sh-newline-and-indent)

    Strip unquoted whitespace, insert newline, and indent like current
    line.

That seems to accurately describe the actual behavior.  The next line
just gets indented like the previous one.  Obviously, that is not
always correct.  It is also no different from Emacs20 behavior.

Did I misunderstand you?

Sincerely,

Luc.

  





reply via email to

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