default sh-test in sh-script.el

Ville Skyttä scop at xemacs.org
Sat Feb 9 16:51:45 EST 2008


Applied, thanks!


On Dec 10, 2007 3:55 AM, FKtPp <m_pupil at yahoo.com.cn> wrote:
> Hi Aidan,
>
> Sorry for bring confusion to you...
>
> But that patch is not related to indent setting, the extra point moving
> occurs when you using `C-c C-i' to insert if-else template. The
> minibuffer initial-string initialized in the way people have to type
> extra keys to avoid shell script syntax error.
>
> Say if I want to insert a:
>
> if [ -z "$ABC" ]; then
>     echo "gocha!"
> fi
>
> I just type `C-c C-i' and the minibuffer initialized as "condition: [
> ]"(point on character `]') and I continue type in `-z "$ABC"<RET><C-]>'
> will result in:
>
> if [ -z "$ABC"]; then
>
> fi
>
> Note the sytax error at `ABC"]; then', character `"' and `]' should be
> seperated by a space. To avoid this error, I always have to type in
> `<C-b> -z "$ABC"<RET><C-]>' or `-z "$ABC" <RET><C-]>' etc.
>
> With my patch while you type `C-c C-i' the minibuffer initialized as
> "condition [  ]"(point just at the space character before `]'
> character). And this will save some extra key strocks.
>
>
> --- Aidan Kehoe <kehoea at parhasard.net> wrote:
>
> >
> > Dear FKtPp,
> >
> >  Ar an seachtú lá de mí na Nollaig, scríobh FKtPp:
> >
> >  > The variable sh-test defined in package sh-script sh-script.el
> > make me feel uncomfortable while editing sh/ksh files.
> >  >
> >  > The default value make it move the point to the end of the initial
> > prompt string, and it make me always have to move back/delete one
> > character when inserting `if' clause in sh/ksh shell-script mode.
> >
> > This is a little confusing. Normally, one does not see the initial
> > prompt
> > string in shell-script-mode; prompt strings are limited to shell-mode
> > and
> > other modes associated with comint. And when, in shell-script mode, I
> > type
> >
> > if [ -f
> >
> > enter, and then tab, I get eight spaces, both with and without your
> > patch. What exactly are you seeing--please give us example
> > inputs--and what
> > exactly would you like to see?
> >
> > Bye,
> >
> >         Aidan
> >
> >  > It will be much better if the default value be as this:
> >  >
> >  > --- sh-script.el~    Wed Nov 28 17:03:20 2007
> >  > +++ sh-script.el    Fri Dec 07 16:45:44 2007
> >  > @@ -600,8 +600,8 @@
> >  >    "Word to delimit here documents.")
> >  >
> >  >  (defvar sh-test
> >  > -  '((sh "[  ]" . 3)
> >  > -    (ksh88 "[[  ]]" . 4))
> >  > +  '((sh "[  ]" . 2)
> >  > +    (ksh88 "[[  ]]" . 3))
> >  >    "Initial input in Bourne if, while and until skeletons.  See
> > `sh-feature'.")
> >
> > --
> > ¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
> > precipitadamente de la aldea por culpa de la escasez de rinocerontes?
> >
>
>
>
>       ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
>
> _______________________________________________
> XEmacs-Beta mailing list
> XEmacs-Beta at xemacs.org
> http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
>



More information about the XEmacs-Beta mailing list