all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#16015: 24.3.50; newline indents in shell script mode
@ 2013-11-30 22:01 Jarek Czekalski
  2013-11-30 22:13 ` Glenn Morris
  2013-12-01  8:24 ` Jarek Czekalski
  0 siblings, 2 replies; 5+ messages in thread
From: Jarek Czekalski @ 2013-11-30 22:01 UTC (permalink / raw)
  To: 16015


Steps to reproduce:
emacs -Q
C-x C-f test.sh
type "if [[ 1 ]]; then"
M-x newline

Expected behaviour: a new line indented with left margin (column 0).
Found: a new line is indented by four spaces, as if newline-and-indent
command was executed.

I checked "newline" documentation and found no explanation for that.



In GNU Emacs 24.3.50.12 (i686-pc-linux-gnu, GTK+ Version 3.8.6)
  of 2013-11-30 on jcdeb
Bzr revision: 115317 eliz@gnu.org-20131130191221-9pxtv2v0eilgek8u
Windowing system distributor `The X.Org Foundation', version 11.0.11403000
System Description:    Debian GNU/Linux unstable (sid)

Important settings:
   value of $LC_ALL: en_US
   value of $LANG: pl_PL
   locale-coding-system: iso-latin-1-unix
   default enable-multibyte-characters: t

Major mode: Shell-script

Minor modes in effect:
   sh-electric-here-document-mode: t
   tooltip-mode: t
   electric-indent-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-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
C-x C-f t e s t . s h <return> i f SPC [ [ SPC 1 SPC
] ] ; SPC t h e n <return> <backspace> <backspace>
<backspace> <backspace> <backspace> M-x n e w l i n
e <return> <backspace> <backspace> <backspace> <backspace>
<backspace> M-x n e w l i n e - a n d <tab> <return>
M-x n e w l i n e - <escape> <escape> <escape> C-h
f n e w l i n e - a n d <tab> <return> C-x C-c <escape>
<escape> <escape> <help-echo> n n o <return> M-x r
e p o r t <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
(New file)
Setting up indent for shell type sh
Indentation variables are now local.
Indentation setup for shell type sh
You can run the command `newline' with RET
Quit
Type C-x 1 to delete the help window.
Type C-h for help. [3 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils help-mode easymenu help-fns sh-script smie
executable time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar 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 minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)






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

* bug#16015: 24.3.50; newline indents in shell script mode
  2013-11-30 22:01 bug#16015: 24.3.50; newline indents in shell script mode Jarek Czekalski
@ 2013-11-30 22:13 ` Glenn Morris
  2013-12-01  8:24 ` Jarek Czekalski
  1 sibling, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2013-11-30 22:13 UTC (permalink / raw)
  To: Jarek Czekalski; +Cc: 16015


Because electric-indent-mode is now on by default.





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

* bug#16015: 24.3.50; newline indents in shell script mode
  2013-11-30 22:01 bug#16015: 24.3.50; newline indents in shell script mode Jarek Czekalski
  2013-11-30 22:13 ` Glenn Morris
@ 2013-12-01  8:24 ` Jarek Czekalski
  2013-12-01 15:59   ` Stefan Monnier
  2013-12-01 17:23   ` Glenn Morris
  1 sibling, 2 replies; 5+ messages in thread
From: Jarek Czekalski @ 2013-12-01  8:24 UTC (permalink / raw)
  To: 16015

Let me be a standard user first. I fire the "newline" command, not 
"newline-and-indent". The default -Q behaviour should do what is written 
in the documentation of the product. Now it is not. This is a bug.

Now a longer background, I wished I didn't have to write it.

I know long discussions about "Default behaviour of RET." and 
"electric-indent-mode: abolition of `newline' function is not the Right 
Thing.". Their outcome was as follows:
1. The author of the change wanted to make programming modes indent on 
RET by default
2. They did it in a wrong way

Nobody argues with 1. Many people have objections about removing the 
functionality of the "newline" command, that is point 2. I also didn't 
object until I found out, that you did it by default. Please do the 
change in an acceptable way. There were many suggestions how to make RET 
indent without achieving unreasonable documentation contradiction.

The least acceptable fix IMO is placing the following string in the 
docs, presumably at the beginning:

"newline is a deprecated command and now it is an alias of 
newline-and-indent in programming modes. If you want the old newline 
behaviour please use ... instead."

The other acceptable way (still not very good) is to introduce a new 
function newline-without-indent, because then it's easy to place it in 
the docs (the first suggestion) and find by a user through C-h f newline.

A good solution may be found in the threads I mentioned. One of them 
suggested by Richard Stallman:
http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00701.html
Supported by Stephen J. Turnbull
http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00732.html
And here is the summary of the discussion which is what I described in 
points 1 and 2, by Josh:
http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00724.html
And everybody knows that the strongest opposer to the new change was the 
author of the thread, Alan Mackenzie. But I always prefer to show that 
the author was not the only believer.

Seems like you ignore these people's opinions, but at least you should 
not ignore this bug report. The first paragraph proves that this is a 
bug. Are you able to deny it?

Jarek






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

* bug#16015: 24.3.50; newline indents in shell script mode
  2013-12-01  8:24 ` Jarek Czekalski
@ 2013-12-01 15:59   ` Stefan Monnier
  2013-12-01 17:23   ` Glenn Morris
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2013-12-01 15:59 UTC (permalink / raw)
  To: Jarek Czekalski; +Cc: 16015-done

> Let me be a standard user first. I fire the "newline" command, not
> "newline-and-indent". The default -Q behaviour should do what is written in
> the documentation of the product. Now it is not. This is a bug.

Thanks.  I adjusted the docstring to mention electric-indent-mode.


        Stefan





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

* bug#16015: 24.3.50; newline indents in shell script mode
  2013-12-01  8:24 ` Jarek Czekalski
  2013-12-01 15:59   ` Stefan Monnier
@ 2013-12-01 17:23   ` Glenn Morris
  1 sibling, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2013-12-01 17:23 UTC (permalink / raw)
  To: Jarek Czekalski; +Cc: 16015

Jarek Czekalski wrote:

> Seems like you ignore these people's opinions, but at least you should
> not ignore this bug report. The first paragraph proves that this is a
> bug. Are you able to deny it?

Thanks for the lecture!





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

end of thread, other threads:[~2013-12-01 17:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-30 22:01 bug#16015: 24.3.50; newline indents in shell script mode Jarek Czekalski
2013-11-30 22:13 ` Glenn Morris
2013-12-01  8:24 ` Jarek Czekalski
2013-12-01 15:59   ` Stefan Monnier
2013-12-01 17:23   ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.