unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode)
@ 2011-07-28 15:57 Jim Diamond
  2011-07-28 19:22 ` zlists
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jim Diamond @ 2011-07-28 15:57 UTC (permalink / raw)
  To: 9193

Create the following file

#! /bin/sh

if [ $a == $b ]
then
    echo newline-and-indent is OK here
    echo "newline-and-indent is NOT OK here"
fi

Now, put the cursor at the end of the first "echo" line and type ^J
(bound to newline-and-indent).  As expected, it does a
newline-and-indent.  Now put the cursor at the end of the second "echo"
line and type ^J.  It does the newline, but not the indent.

[ Other possibly completely irrelevant information:
Playing around a bit, I found that if I create my own function and
instead of using (newline-and-indent) I use
    (newline)
    (sit-for .001)
    (indent-according-to-mode)
then calling that function Does The Right Thing.
]



In GNU Emacs 23.3.1 (x86_64-slackware-linux-gnu, GTK+ Version 2.24.1)
 of 2011-03-12 on midas64
Windowing system distributor `The X.Org Foundation', version 11.0.10905000
configured using `configure  '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--program-prefix=' '--program-suffix=' '--mandir=/usr/man' '--infodir=/usr/info' '--enable-static=no' '--enable-shared=yes' '--with-x' '--with-x-toolkit=gtk' '--build=x86_64-slackware-linux' 'build_alias=x86_64-slackware-linux' 'CFLAGS=-O2 -fPIC''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_CA
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Shell-script

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<backspace> C-e C-j <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> M-x b u g <tab> 
<tab> C-g M-x a p r o <tab> <return> b u g <return> 
<down-mouse-1> <mouse-movement> <mouse-movement> <mouse-1> 
C-s - b u g C-s C-s <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<return> <return> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <down-mouse-1> 
<mouse-movement> <drag-mouse-1> C-x b <return> C-x 
C-f a . s h <backspace> <backspace> <backspace> <backspace> 
b u g g y . s h <return> # ! SPC / b i n s <backspace> 
/ s h <return> <return> i f SPC [ SPC a SPC = SPC <backspace> 
= SPC b SPC ] <return> t h e n <return> f i <up> C-e 
<return> <tab> a <up> <up> $ <right> <right> <right> 
<right> <right> $ <down> <down> = <backspace> <backspace> 
e c h o SPC t h i s SPC i s SPC o k <return> <tab> 
<up> <down> C-a <backspace> C-j e c h o SPC " t h i 
s SPC i s SPC n o t " C-j <backspace> <up> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> SPC n e w l i n e SPC a n d SPC i n d C-w C-w 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> - a n d - i n d 
e n t C-d C-d C-d C-d C-d C-e SPC h e r e <down> M-b 
M-b M-b n e w M-/ SPC M-d C-d <right> <right> <right> 
M-u SPC O K <backspace> K SPC h e r e <up> M-b M-b 
M-u C-e C-j <backspace> <backspace> <backspace> <backspace> 
<backspace> <down> C-e C-j <backspace> M-x g n u - 
e m C-u C-g M-x r e p o r t <tab> <return>

Recent messages:
Quit
Mark saved where search started
Type C-x 4 C-o RET to restore the other window.
(New file)
Setting up indent for shell type sh
setting up indent stuff
Indentation variables are now local.
Indentation setup for shell type sh
kill-region: The mark is not set now, so there is no region [2 times]
Auto-saving...done
Quit

Load-path shadows:
/usr/share/emacs/site-lisp/t-mouse hides /usr/share/emacs/23.3/lisp/t-mouse

Features:
(shadow sort mail-extr message idna sendmail ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 hex-util hashcash mail-utils emacsbug dabbrev help-fns apropos
skeleton multi-isearch kmacro two-column iso-transl help-mode easymenu
view regexp-opt sh-script executable tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
font-render-setting gtk x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode)
  2011-07-28 15:57 bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode) Jim Diamond
@ 2011-07-28 19:22 ` zlists
  2011-07-29  4:04 ` Leo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: zlists @ 2011-07-28 19:22 UTC (permalink / raw)
  To: 9193

I hunted a bit before sending the bug report out, but further hunting
after I submitted the report reveals
	bug#6916: Fwd: [PATCH] fix indent bug in sh-script

I expect that is the same issue, and according to the thread a fix has
been submitted (presumably to Emacs 24) almost a year ago.







^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode)
  2011-07-28 15:57 bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode) Jim Diamond
  2011-07-28 19:22 ` zlists
@ 2011-07-29  4:04 ` Leo
  2011-08-03  1:46 ` Stefan Monnier
       [not found] ` <mailman.735.1312336055.939.bug-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 5+ messages in thread
From: Leo @ 2011-07-29  4:04 UTC (permalink / raw)
  To: Jim Diamond; +Cc: 9193

On 2011-07-28 23:57 +0800, Jim Diamond wrote:
> Create the following file
> Now, put the cursor at the end of the first "echo" line and type ^J
> (bound to newline-and-indent).  As expected, it does a
> newline-and-indent.  Now put the cursor at the end of the second "echo"
> line and type ^J.  It does the newline, but not the indent.

I cannot reproduce this on GNU Emacs 23.3.50.1 of 2011-07-27.

Leo





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode)
  2011-07-28 15:57 bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode) Jim Diamond
  2011-07-28 19:22 ` zlists
  2011-07-29  4:04 ` Leo
@ 2011-08-03  1:46 ` Stefan Monnier
       [not found] ` <mailman.735.1312336055.939.bug-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2011-08-03  1:46 UTC (permalink / raw)
  To: Jim Diamond; +Cc: 9193

> #! /bin/sh

> if [ $a == $b ]
> then
>     echo newline-and-indent is OK here
>     echo "newline-and-indent is NOT OK here"
> fi

> Now, put the cursor at the end of the first "echo" line and type ^J
> (bound to newline-and-indent).  As expected, it does a
> newline-and-indent.  Now put the cursor at the end of the second "echo"
> line and type ^J.  It does the newline, but not the indent.

> [ Other possibly completely irrelevant information:
> Playing around a bit, I found that if I create my own function and
> instead of using (newline-and-indent) I use
>     (newline)
>     (sit-for .001)
>     (indent-according-to-mode)
> then calling that function Does The Right Thing.
> ]

FWIW it seems to be fixed in the trunk (i.e. in the upcoming Emacs-24).
Could you try it out to confirm it fixes your problems?


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode)
       [not found] ` <mailman.735.1312336055.939.bug-gnu-emacs@gnu.org>
@ 2011-08-05  1:28   ` Jim Diamond
  0 siblings, 0 replies; 5+ messages in thread
From: Jim Diamond @ 2011-08-05  1:28 UTC (permalink / raw)
  To: bug-gnu-emacs

On 2011-08-02 at 22:46 ADT, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> #! /bin/sh
>
>> if [ $a == $b ]
>> then
>>     echo newline-and-indent is OK here
>>     echo "newline-and-indent is NOT OK here"
>> fi
>
>> Now, put the cursor at the end of the first "echo" line and type ^J
>> (bound to newline-and-indent).  As expected, it does a
>> newline-and-indent.  Now put the cursor at the end of the second "echo"
>> line and type ^J.  It does the newline, but not the indent.
>
>> [ Other possibly completely irrelevant information:
>> Playing around a bit, I found that if I create my own function and
>> instead of using (newline-and-indent) I use
>>     (newline)
>>     (sit-for .001)
>>     (indent-according-to-mode)
>> then calling that function Does The Right Thing.
>> ]

> FWIW it seems to be fixed in the trunk (i.e. in the upcoming Emacs-24).
> Could you try it out to confirm it fixes your problems?

Stefan,

I tried using 24.0.50's sh-script.el with 23.3, but there are other
changes which make that version sh-script.el not work at all in 23.3.

I put the specific patch into the 23.3 version of sh-script.el and
that solves the problem there, so I think we're good.

I'm a bit too swamped right now to play with 24.0.50, but anyone with
it installed should be able to repeat the above test in a few
seconds.

				Jim


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-05  1:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-28 15:57 bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode) Jim Diamond
2011-07-28 19:22 ` zlists
2011-07-29  4:04 ` Leo
2011-08-03  1:46 ` Stefan Monnier
     [not found] ` <mailman.735.1312336055.939.bug-gnu-emacs@gnu.org>
2011-08-05  1:28   ` Jim Diamond

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).