From: Jim Diamond <zlists@ns.sympatico.ca>
To: 9193@debbugs.gnu.org
Subject: bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode)
Date: Thu, 28 Jul 2011 12:57:34 -0300 [thread overview]
Message-ID: <8762mm5rf5.fsf@jdiamond-nb2.acadiau.ca> (raw)
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)
next reply other threads:[~2011-07-28 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 15:57 Jim Diamond [this message]
2011-07-28 19:22 ` bug#9193: 23.3; newline-and-indent broken in shell-script (sh mode) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8762mm5rf5.fsf@jdiamond-nb2.acadiau.ca \
--to=zlists@ns.sympatico.ca \
--cc=9193@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).