From unknown Sat Jun 21 10:40:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function. Resent-From: Philipp Rumpf Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 May 2014 15:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17449 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17449@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139965016911576 (code B ref -1); Fri, 09 May 2014 15:43:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 May 2014 15:42:49 +0000 Received: from localhost ([127.0.0.1]:57128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wimwh-00030b-6d for submit@debbugs.gnu.org; Fri, 09 May 2014 11:42:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50466) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wihjy-0001MF-UB for submit@debbugs.gnu.org; Fri, 09 May 2014 06:09:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wihjr-0007XE-C6 for submit@debbugs.gnu.org; Fri, 09 May 2014 06:09:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=AC_HTML_NONSENSE_TAGS, BAYES_50, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wihjr-0007XA-8l for submit@debbugs.gnu.org; Fri, 09 May 2014 06:09:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wihjo-0000j9-Tb for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 06:09:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wihjk-0007WB-Rt for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 06:09:08 -0400 Received: from mail-ve0-x231.google.com ([2607:f8b0:400c:c01::231]:36075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wihjk-0007W7-KL for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 06:09:04 -0400 Received: by mail-ve0-f177.google.com with SMTP id db11so4849438veb.22 for ; Fri, 09 May 2014 03:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=oo5M1Nyh1BP1oloFotnLsVElEyHnRv74Nwyq7WJaJV8=; b=owTnmcSXXkFOL8zpTuSMqN2Qblr2y5vZPczegaQwPA9lKPTfv8NnXQkGF4EKH6Opbh i1rRSEOkgLUnbsskhLvnaHQLdXsjDdK9ybU5WN+w/Yr/P5Tx8tLW8jmv1PpJYSeq2pKY H8e5qunTGoxTivsjQLGKBQrUEIhagPYgAO9UX9IZsckqJs/Nj9OmneEhAy4w62PHPY7V PuWyQnQD/07Fvxhn0qeOsvkzU38Eju4Q74oEkpT1vbN/7MZx180lw6DmzQGdUGT1FIvY dojdrlax961NebG+ftOZED6nzkpDBlE1+VqIew/0fO4DCFHd1Ric0qYvJRqEZKOVZzGm ORyw== MIME-Version: 1.0 X-Received: by 10.58.211.69 with SMTP id na5mr1637058vec.30.1399630143598; Fri, 09 May 2014 03:09:03 -0700 (PDT) Received: by 10.221.34.142 with HTTP; Fri, 9 May 2014 03:09:03 -0700 (PDT) Date: Fri, 9 May 2014 10:09:03 +0000 Message-ID: From: Philipp Rumpf Content-Type: multipart/mixed; boundary=047d7bd6c21a86cc5504f8f4c933 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Fri, 09 May 2014 11:42:45 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --047d7bd6c21a86cc5504f8f4c933 Content-Type: multipart/alternative; boundary=047d7bd6c21a86cc5104f8f4c931 --047d7bd6c21a86cc5104f8f4c931 Content-Type: text/plain; charset=UTF-8 In C mode and Python mode, hitting on an indented but otherwise empty line results in an unindented new line at point, rather than an indented line. To reproduce in emacs -Q: M-x python-mode if a == 3: M-: (current-column) Expected result: 4 / indented line Actual result: 0 / line not indented Emacs 24.3.1 produces the expected result. Lossage: M-x p y t h o n - m o d e i f SPC a SPC = = SPC 3 : M-: ( c u r r e n t - c o l u m n ) The same bug can be seen in C mode: M-x c-mode int main(void) { M-: (current-column) (However, since there are more electric characters in c-mode, the problem goes away as you continue typing; that isn't true of the python-mode bug). Investigating this, it seems the problem is in electric-indent-post-self-insert-function: its code reads (when (<= pos (line-beginning-position)) ... (delete-horizontal-space t))))) (unless (and electric-indent-inhibit (> pos (line-beginning-position))) (indent-according-to-mode))))) where pos is an integer, not a marker. Assuming electric-indent-inhibit, when delete-horizontal-space does anything (as is the case for newline on an indented empty line), (line-beginning-position) changes, but pos doesn't change along with it, so the (indent-according-to-mode) is skipped even though it should be run on new empty lines. The easiest fix would be to change electric--after-char-pos to return a marker, not an integer: diff --git a/lisp/electric.el b/lisp/electric.el index e8ceaa6..874ec09 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -176,7 +176,7 @@ (defun electric--after-char-pos () "Return the position after the char we just inserted. Returns nil when we can't find this char." - (let ((pos (point))) + (let ((pos (point-marker))) (when (or (eq (char-before) last-command-event) ;; Sanity check. (save-excursion (or (progn (skip-chars-backward " \t") A slightly different fix would avoid using a temporary marker for every self-insert: diff --git a/lisp/electric.el b/lisp/electric.el index e8ceaa6..34567d3 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -259,7 +259,8 @@ or comment." (unless (eq act 'do-indent) (nth 8 (syntax-ppss)))))))) ;; For newline, we want to reindent both lines and basically behave like ;; reindent-then-newline-and-indent (whose code we hence copied). - (when (<= pos (line-beginning-position)) + (let ((at-newline (<= pos (line-beginning-position)))) + (when at-newline (let ((before (copy-marker (1- pos) t))) (save-excursion (unless (or (memq indent-line-function @@ -280,8 +281,8 @@ or comment." ;; indentation may (re)introduce the whitespace. (delete-horizontal-space t))))) (unless (and electric-indent-inhibit - (> pos (line-beginning-position))) - (indent-according-to-mode))))) + (not at-newline)) + (indent-according-to-mode)))))) (put 'electric-indent-post-self-insert-function 'priority 60) Both fixes appear to fix the problem in c-mode and python-mode; I've not tested rst-mode, which appears to be the only other standard mode that uses electric-indent-inhibit. In GNU Emacs 24.4.50.14 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7) of 2014-05-08 on amerigo Windowing system distributor `The X.Org Foundation', version 11.0.11500000 System Description: Debian GNU/Linux unstable (sid) Configured using: `configure --without-makeinfo --without-compress-install' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Help Minor modes in effect: 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 buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent input: M-x p y t h o n - m o d e i f SPC a SPC = = SPC 3 : M-: ( c u r r e n t - c o l u m n ) M-x v i e w - l C-a C-SPC C-w M-x r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Can't guess python-indent-offset, using defaults: 4 0 (#o0, #x0, ?\C-@) Type C-x 1 to delete the help window. Beginning of buffer [4 times] Mark set End of buffer Buffer is read-only: # Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired 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 help-fns mail-prsvr mail-utils help-mode mule-util python easymenu comint ring ansi-color 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) Memory information: ((conses 16 82158 4302) (symbols 48 18600 0) (miscs 40 51 174) (strings 32 13034 3892) (string-bytes 1 365906) (vectors 16 10278) (vector-slots 8 388612 3417) (floats 8 68 243) (intervals 56 260 1) (buffers 960 13) (heap 1024 29346 991)) --047d7bd6c21a86cc5104f8f4c931 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In C mode and Python mode, hitting <RET> on an = indented but otherwise
empty line results in an unindented new line at p= oint, rather than an
indented line.

To reproduce in emacs -Q:

M-x python-mode<RET>
if a =3D=3D 3:<RET>
<RET><= br>M-: (current-column)<RET>

Expected result: 4 / indented lin= e
Actual result: 0 / line not indented

Emacs 24.3.1 produces the = expected result.


Lossage:

M-x p y t h o n - m o d e <return> i f SPC a = SPC =3D
=3D SPC 3 : <return> <return> M-: ( c u r r e n t - = c
o l u m n ) <return>


The same bug can be seen in C mo= de:

M-x c-mode<RET>
int main(void) {<RET>
<RET>
= M-: (current-column)<RET>

(However, since there are more elect= ric characters in c-mode, the
problem goes away as you continue typing; = that isn't true of the
python-mode bug).

Investigating this, it seems the problem is in
= electric-indent-post-self-insert-function: its code reads

=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (when (<=3D pos (line-beginning-position))
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (delete-horizontal-space t)))))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (unless (and electric-indent-inhibit
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (> pos (line-beginning-position)))
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (indent-according-to-mode)))))
<= br>where pos is an integer, not a marker. Assuming
electric-indent-inhib= it, when delete-horizontal-space does anything
(as is the case for newline on an indented empty line),
(line-beginning-= position) changes, but pos doesn't change along with
it, so the (ind= ent-according-to-mode) is skipped even though it should
be run on new em= pty lines.

The easiest fix would be to change electric--after-char-pos to returna marker, not an integer:

diff --git a/lisp/electric.el b/lisp/ele= ctric.el
index e8ceaa6..874ec09 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -176,7 +176,7 @@
=C2=A0(defun electric--aft= er-char-pos ()
=C2=A0=C2=A0 "Return the position after the char we = just inserted.
=C2=A0Returns nil when we can't find this char."=
-=C2=A0 (let ((pos (point)))
+=C2=A0 (let ((pos (point-marker)))
=C2=A0=C2=A0=C2=A0=C2=A0 (when (or (= eq (char-before) last-command-event) ;; Sanity check.
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (save-ex= cursion
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (or (progn (skip-chars-backward " \t= ")

A slightly different fix would avoid using a temporary marke= r for
every self-insert:

diff --git a/lisp/electric.el b/lisp/electric.el<= br>index e8ceaa6..34567d3 100644
--- a/lisp/electric.el
+++ b/lisp/el= ectric.el
@@ -259,7 +259,8 @@ or comment."
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (unless (eq act 'do-indent) (nth 8 (syntax-pps= s))))))))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; For newline, we want to reindent bo= th lines and basically behave like
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = ;; reindent-then-newline-and-indent (whose code we hence copied).
-=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (when (<=3D pos (line-beginning-position))+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((at-newline (<=3D pos (line-begi= nning-position))))
+=C2=A0=C2=A0=C2=A0 (when at-newline
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 (le= t ((before (copy-marker (1- pos) t)))
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 (save-excursion
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (unless (or (memq indent-line-function
@@ -280,8 +281,8 @@ or = comment."
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ;; indentatio= n may (re)introduce the whitespace.
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (delete-horizontal-space t)))))=
=C2=A0=C2=A0=C2=A0=C2=A0 (unless (and electric-indent-inhibit
-=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (> pos (line-beginning-position)))
-= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (indent-according-to-mode)))))+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (not at-n= ewline))
+=C2=A0=C2=A0=C2=A0 =C2=A0 (indent-according-to-mode))))))
=C2=A0
=C2= =A0(put 'electric-indent-post-self-insert-function 'priority=C2=A0 = 60)


Both fixes appear to fix the problem in c-mode and python-mo= de; I've
not tested rst-mode, which appears to be the only other sta= ndard mode
that uses electric-indent-inhibit.

In GNU Emacs 24.4.50.1= 4 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
=C2=A0of 2014-05-08 on= amerigo
Windowing system distributor `The X.Org Foundation', versio= n 11.0.11500000
System Description:=C2=A0=C2=A0=C2=A0 Debian GNU/Linux unstable (sid)
Configured using:
=C2=A0`configure --without-makeinfo --without-compre= ss-install'

Configured features:
XPM JPEG TIFF GIF PNG RSVG S= OUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS
LIBXML2 FREETYPE XFT ZLIB

Important settings:
=C2=A0 value of $LA= NG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-unix

Major mod= e: Help

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 e= lectric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mo= de: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t=
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-= composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 buffer-read-only: t
=C2=A0 lin= e-number-mode: t
=C2=A0 transient-mark-mode: t

Recent input:
M= -x p y t h o n - m o d e <return> i f SPC a SPC =3D
=3D SPC 3 : &= lt;return> <return> M-: ( c u r r e n t - c
o l u m n ) <return> M-x v i e w - l <tab> <return>
&= lt;help-echo> <down-mouse-1> <mouse-1> <up> <up>= <up>
<up> <up> <up> <up> <up> C-a = C-SPC <C-down> <down>
<up> <right> <C-up> <down> <right> <right&= gt; <right>
<right> <right> <right> <right&g= t; <right> <right> <right>
<right> <right>= ; <right> <right> <right> <right> <right> <right> <right> <right> <down> <right> <le= ft> C-w M-x
r e p <tab> o r <tab> <return>

= Recent messages:
For information about GNU Emacs and the GNU system, typ= e C-h C-a.
Can't guess python-indent-offset, using defaults: 4
0 (#o0, #x0, ?\C= -@)
Type C-x 1 to delete the help window.
Beginning of buffer [4 time= s]
Mark set
End of buffer
Buffer is read-only: #<buffer *Help*&= gt;
Making completion list...

Load-path shadows:
None found.

F= eatures:
(shadow sort gnus-util mail-extr emacsbug message dired 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-u= til help-fns mail-prsvr mail-utils help-mode mule-util python
easymenu c= omint ring ansi-color 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 j= it-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-la= ng misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyr= illic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minib= uffer nadvice loaddefs button faces cus-face macroexp files
text-propert= ies overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
db= usbind gfilenotify dynamic-setting system-font-setting
font-render-setti= ng move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:=
((conses 16 82158 4302)
=C2=A0(symbols 48 18600 0)
=C2=A0(miscs 40 51= 174)
=C2=A0(strings 32 13034 3892)
=C2=A0(string-bytes 1 365906)
= =C2=A0(vectors 16 10278)
=C2=A0(vector-slots 8 388612 3417)
=C2=A0(fl= oats 8 68 243)
=C2=A0(intervals 56 260 1)
=C2=A0(buffers 960 13)
=C2=A0(heap 1024 29346 991))

--047d7bd6c21a86cc5104f8f4c931-- --047d7bd6c21a86cc5504f8f4c933 Content-Type: text/plain; charset=US-ASCII; name="emacs-002.diff" Content-Disposition: attachment; filename="emacs-002.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_huzbhxb90 ZGlmZiAtLWdpdCBhL2xpc3AvZWxlY3RyaWMuZWwgYi9saXNwL2VsZWN0cmljLmVsCmluZGV4IGU4 Y2VhYTYuLjg3NGVjMDkgMTAwNjQ0Ci0tLSBhL2xpc3AvZWxlY3RyaWMuZWwKKysrIGIvbGlzcC9l bGVjdHJpYy5lbApAQCAtMTc2LDcgKzE3Niw3IEBACiAoZGVmdW4gZWxlY3RyaWMtLWFmdGVyLWNo YXItcG9zICgpCiAgICJSZXR1cm4gdGhlIHBvc2l0aW9uIGFmdGVyIHRoZSBjaGFyIHdlIGp1c3Qg aW5zZXJ0ZWQuCiBSZXR1cm5zIG5pbCB3aGVuIHdlIGNhbid0IGZpbmQgdGhpcyBjaGFyLiIKLSAg KGxldCAoKHBvcyAocG9pbnQpKSkKKyAgKGxldCAoKHBvcyAocG9pbnQtbWFya2VyKSkpCiAgICAg KHdoZW4gKG9yIChlcSAoY2hhci1iZWZvcmUpIGxhc3QtY29tbWFuZC1ldmVudCkgOzsgU2FuaXR5 IGNoZWNrLgogICAgICAgICAgICAgICAoc2F2ZS1leGN1cnNpb24KICAgICAgICAgICAgICAgICAo b3IgKHByb2duIChza2lwLWNoYXJzLWJhY2t3YXJkICIgXHQiKQo= --047d7bd6c21a86cc5504f8f4c933 Content-Type: text/plain; charset=US-ASCII; name="emacs-003.diff" Content-Disposition: attachment; filename="emacs-003.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_huzbi3811 ZGlmZiAtLWdpdCBhL2xpc3AvZWxlY3RyaWMuZWwgYi9saXNwL2VsZWN0cmljLmVsCmluZGV4IGU4 Y2VhYTYuLjM0NTY3ZDMgMTAwNjQ0Ci0tLSBhL2xpc3AvZWxlY3RyaWMuZWwKKysrIGIvbGlzcC9l bGVjdHJpYy5lbApAQCAtMjU5LDI5ICsyNTksMzAgQEAgb3IgY29tbWVudC4iCiAgICAgICAgICAg ICAgICAgICAgICh1bmxlc3MgKGVxIGFjdCAnZG8taW5kZW50KSAobnRoIDggKHN5bnRheC1wcHNz KSkpKSkpKSkKICAgICAgIDs7IEZvciBuZXdsaW5lLCB3ZSB3YW50IHRvIHJlaW5kZW50IGJvdGgg bGluZXMgYW5kIGJhc2ljYWxseSBiZWhhdmUgbGlrZQogICAgICAgOzsgcmVpbmRlbnQtdGhlbi1u ZXdsaW5lLWFuZC1pbmRlbnQgKHdob3NlIGNvZGUgd2UgaGVuY2UgY29waWVkKS4KLSAgICAgICh3 aGVuICg8PSBwb3MgKGxpbmUtYmVnaW5uaW5nLXBvc2l0aW9uKSkKLSAgICAgICAgKGxldCAoKGJl Zm9yZSAoY29weS1tYXJrZXIgKDEtIHBvcykgdCkpKQotICAgICAgICAgIChzYXZlLWV4Y3Vyc2lv bgotICAgICAgICAgICAgKHVubGVzcyAob3IgKG1lbXEgaW5kZW50LWxpbmUtZnVuY3Rpb24KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZWN0cmljLWluZGVudC1mdW5jdGlvbnMtd2l0 aG91dC1yZWluZGVudCkKL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IHNhdmUvcmVzdG9yZSBieSBoYW5kLgorCSAgICAgIChnb3RvLWNo YXIgYmVmb3JlKQorCSAgICAgICh3aGVuIChlb2xwKQorCQk7OyBSZW1vdmUgdGhlIHRyYWlsaW5n IHdoaXRlc3BhY2UgYWZ0ZXIgaW5kZW50YXRpb24gYmVjYXVzZQorCQk7OyBpbmRlbnRhdGlvbiBt YXkgKHJlKWludHJvZHVjZSB0aGUgd2hpdGVzcGFjZS4KKwkJKGRlbGV0ZS1ob3Jpem9udGFsLXNw YWNlIHQpKSkpKQorCSh1bmxlc3MgKGFuZCBlbGVjdHJpYy1pbmRlbnQtaW5oaWJpdAorCQkgICAg IChub3QgYXQtbmV3bGluZSkpCisJICAoaW5kZW50LWFjY29yZGluZy10by1tb2RlKSkpKSkpCiAK IChwdXQgJ2VsZWN0cmljLWluZGVudC1wb3N0LXNlbGYtaW5zZXJ0LWZ1bmN0aW9uICdwcmlvcml0 eSAgNjApCiAK --047d7bd6c21a86cc5504f8f4c933-- From unknown Sat Jun 21 10:40:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 May 2014 16:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17449 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Philipp Rumpf Cc: 17449@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 17449-submit@debbugs.gnu.org id=B17449.139965177818867 (code B ref 17449); Fri, 09 May 2014 16:10:02 +0000 Received: (at 17449) by debbugs.gnu.org; 9 May 2014 16:09:38 +0000 Received: from localhost ([127.0.0.1]:57179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WinMf-0004uC-BY for submit@debbugs.gnu.org; Fri, 09 May 2014 12:09:37 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:38660) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WinMc-0004tq-Rp for 17449@debbugs.gnu.org; Fri, 09 May 2014 12:09:36 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N5B00I00DVQVJ00@mtaout29.012.net.il> for 17449@debbugs.gnu.org; Fri, 09 May 2014 19:10:31 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N5B00IVRE9IQH10@mtaout29.012.net.il>; Fri, 09 May 2014 19:10:31 +0300 (IDT) Date: Fri, 09 May 2014 19:09:42 +0300 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <83siojue61.fsf@gnu.org> References: X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 9 May 2014 10:09:03 +0000 > From: Philipp Rumpf > > In C mode and Python mode, hitting on an indented but otherwise > empty line results in an unindented new line at point, rather than an > indented line. > > To reproduce in emacs -Q: > > M-x python-mode > if a == 3: > > M-: (current-column) > > Expected result: 4 / indented line > Actual result: 0 / line not indented Per the design. "C-h k RET" displays this text: RET (translated from ) runs the command newline, which is an interactive compiled Lisp function in `simple.el'. It is bound to RET. (newline &optional ARG INTERACTIVE) Insert a newline, and move to left margin of the new line if it's blank. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From unknown Sat Jun 21 10:40:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function. Resent-From: Philipp Rumpf Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 May 2014 17:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17449 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 17449@debbugs.gnu.org Received: via spool by 17449-submit@debbugs.gnu.org id=B17449.139965702227717 (code B ref 17449); Fri, 09 May 2014 17:38:01 +0000 Received: (at 17449) by debbugs.gnu.org; 9 May 2014 17:37:02 +0000 Received: from localhost ([127.0.0.1]:57207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WiojF-0007Cn-DJ for submit@debbugs.gnu.org; Fri, 09 May 2014 13:37:01 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:45626) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WiojB-0007CS-UW for 17449@debbugs.gnu.org; Fri, 09 May 2014 13:36:58 -0400 Received: by mail-vc0-f173.google.com with SMTP id il7so5593523vcb.4 for <17449@debbugs.gnu.org>; Fri, 09 May 2014 10:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AupMl2hXd1vWRZyPQBtFfS/KWCL07cuS8lM6tj1yZ+Y=; b=kvvk3qgN3EOkEQPL3T+q0ZEf8tksu34nMCvRw8p/CfIGH5qpguH0EDVisFSmKgeX9f AUJMJRdy4xt7L4WQrYkGUyS3ywSUy03d9Jq1Dv2fscuVB7VVRHQYNw2InWdjWP+ZaMTh m8IvNP7nb3WwlfkGhNNn+AUnRBi3112ii+1jkW1ZPh7Dax1dgKzdRDkiJ1WyNfW/XF/H 99K/crAsBnRpQ6ni2e6WZw9u0g0G8NmG28aTHv7AFD6hctJtBH3olIfy1cvCVeBqNCg4 CvDpbdwYG8XB8LsP8cMv0LeZpSK0ecWVtQVFatMx1vD77jiU9WKXyyTW7yWcbdO5VUvV an7Q== MIME-Version: 1.0 X-Received: by 10.58.85.65 with SMTP id f1mr8727335vez.20.1399657012029; Fri, 09 May 2014 10:36:52 -0700 (PDT) Received: by 10.221.34.142 with HTTP; Fri, 9 May 2014 10:36:51 -0700 (PDT) In-Reply-To: <83siojue61.fsf@gnu.org> References: <83siojue61.fsf@gnu.org> Date: Fri, 9 May 2014 17:36:51 +0000 Message-ID: From: Philipp Rumpf Content-Type: multipart/alternative; boundary=047d7b86f126029c9b04f8fb0b46 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --047d7b86f126029c9b04f8fb0b46 Content-Type: text/plain; charset=UTF-8 Thanks for the response, but I really don't think this is the intended behaviour! If you type M-x python-mode if a == 3: the cursor will jump back and forth between column 0 and 4 on every alternate line, which simply does not make sense. As for the documentation, here is the relevant paragraph from C-h k RET: If `electric-indent-mode' is enabled, this indents the final new line that it adds, and reindents the preceding line. To just insert a newline, use M-x electric-indent-just-newline. Since we're in electric-indent-mode in the test case (it is enabled by default for me in emacs -Q), the behaviour I've seen definitely does not match the documentation. On Fri, May 9, 2014 at 4:09 PM, Eli Zaretskii wrote: > > Date: Fri, 9 May 2014 10:09:03 +0000 > > From: Philipp Rumpf > > > > In C mode and Python mode, hitting on an indented but otherwise > > empty line results in an unindented new line at point, rather than an > > indented line. > > > > To reproduce in emacs -Q: > > > > M-x python-mode > > if a == 3: > > > > M-: (current-column) > > > > Expected result: 4 / indented line > > Actual result: 0 / line not indented > > Per the design. "C-h k RET" displays this text: > > RET (translated from ) runs the command newline, which is an > interactive compiled Lisp function in `simple.el'. > > It is bound to RET. > > (newline &optional ARG INTERACTIVE) > > Insert a newline, and move to left margin of the new line if it's blank. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > --047d7b86f126029c9b04f8fb0b46 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the response= , but I really don't think this is the intended behaviour! If you type<= br>
M-x python-mode <RET>
if a =3D=3D 3:<RET>=
<RET>
<RET>
<RET>

the curs= or will jump back and forth between column 0 and 4 on every alternate line,= which simply does not make sense.

As for the documentation, h= ere is the relevant paragraph from C-h k RET:

=C2=A0=C2=A0=C2=A0 If `electric-indent-mode' is enabled, this inden= ts the final new line
=C2=A0=C2=A0=C2=A0 that it adds, and reindents the= preceding line.=C2=A0 To just insert
=C2=A0=C2=A0=C2=A0 a newline, use = M-x electric-indent-just-newline.

Since we're in electric-indent-mode in the test case (it is enable= d by default for me in emacs -Q), the behaviour I've seen definitely do= es not match the documentation.


On Fri, May 9, 2014 at 4:09 PM, Eli Zare= tskii <eliz@gnu.org> wrote:
> Date: Fri, 9 May 2014 10:09:03 +0000
> From: Philipp Rumpf <prumpf@gma= il.com>
>
> In C mode and Python mode, hitting <RET> on an indented but othe= rwise
> empty line results in an unindented new line at point, rather than an<= br> > indented line.
>
> To reproduce in emacs -Q:
>
> M-x python-mode<RET>
> if a =3D=3D 3:<RET>
> <RET>
> M-: (current-column)<RET>
>
> Expected result: 4 / indented line
> Actual result: 0 / line not indented

Per the design. =C2=A0"C-h k RET" displays this text:

=C2=A0 RET (translated from <return>) runs the command newline, which= is an
=C2=A0 interactive compiled Lisp function in `simple.el'.

=C2=A0 It is bound to RET.

=C2=A0 (newline &optional ARG INTERACTIVE)

=C2=A0 Insert a newline, and move to left margin of the new line if it'= s blank.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^^^^^= ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--047d7b86f126029c9b04f8fb0b46-- From unknown Sat Jun 21 10:40:04 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Philipp Rumpf Subject: bug#17449: closed (Re: bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function.) Message-ID: References: X-Gnu-PR-Message: they-closed 17449 X-Gnu-PR-Package: emacs Reply-To: 17449@debbugs.gnu.org Date: Fri, 09 May 2014 18:04:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1399658642-30462-1" This is a multi-part message in MIME format... ------------=_1399658642-30462-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-funct= ion. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 17449@debbugs.gnu.org. --=20 17449: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17449 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1399658642-30462-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17449-done) by debbugs.gnu.org; 9 May 2014 18:03:57 +0000 Received: from localhost ([127.0.0.1]:57226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wip9J-0007v2-9B for submit@debbugs.gnu.org; Fri, 09 May 2014 14:03:57 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:8283) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wip9H-0007up-CG for 17449-done@debbugs.gnu.org; Fri, 09 May 2014 14:03:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgGAIDvNVNMCqwB/2dsb2JhbABZgwaDSr0vgwYIgRcXdIIlAQEBAQIBViMFCwsOJhIUGA0kiAQI0hkXjnoHhDgEqRmBaoFxgVshgSwk X-IPAS-Result: ArgGAIDvNVNMCqwB/2dsb2JhbABZgwaDSr0vgwYIgRcXdIIlAQEBAQIBViMFCwsOJhIUGA0kiAQI0hkXjnoHhDgEqRmBaoFxgVshgSwk X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="62139953" Received: from 76-10-172-1.dsl.teksavvy.com (HELO pastel.home) ([76.10.172.1]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 09 May 2014 14:03:48 -0400 Received: by pastel.home (Postfix, from userid 20848) id 173EF60203; Fri, 9 May 2014 14:03:46 -0400 (EDT) From: Stefan Monnier To: Philipp Rumpf Subject: Re: bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function. Message-ID: References: Date: Fri, 09 May 2014 14:03:46 -0400 In-Reply-To: (Philipp Rumpf's message of "Fri, 9 May 2014 10:09:03 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 17449-done Cc: 17449-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > A slightly different fix would avoid using a temporary marker for > every self-insert: Thanks, I installed this fix, Stefan ------------=_1399658642-30462-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 May 2014 15:42:49 +0000 Received: from localhost ([127.0.0.1]:57128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wimwh-00030b-6d for submit@debbugs.gnu.org; Fri, 09 May 2014 11:42:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50466) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wihjy-0001MF-UB for submit@debbugs.gnu.org; Fri, 09 May 2014 06:09:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wihjr-0007XE-C6 for submit@debbugs.gnu.org; Fri, 09 May 2014 06:09:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=AC_HTML_NONSENSE_TAGS, BAYES_50, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wihjr-0007XA-8l for submit@debbugs.gnu.org; Fri, 09 May 2014 06:09:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wihjo-0000j9-Tb for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 06:09:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wihjk-0007WB-Rt for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 06:09:08 -0400 Received: from mail-ve0-x231.google.com ([2607:f8b0:400c:c01::231]:36075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wihjk-0007W7-KL for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 06:09:04 -0400 Received: by mail-ve0-f177.google.com with SMTP id db11so4849438veb.22 for ; Fri, 09 May 2014 03:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=oo5M1Nyh1BP1oloFotnLsVElEyHnRv74Nwyq7WJaJV8=; b=owTnmcSXXkFOL8zpTuSMqN2Qblr2y5vZPczegaQwPA9lKPTfv8NnXQkGF4EKH6Opbh i1rRSEOkgLUnbsskhLvnaHQLdXsjDdK9ybU5WN+w/Yr/P5Tx8tLW8jmv1PpJYSeq2pKY H8e5qunTGoxTivsjQLGKBQrUEIhagPYgAO9UX9IZsckqJs/Nj9OmneEhAy4w62PHPY7V PuWyQnQD/07Fvxhn0qeOsvkzU38Eju4Q74oEkpT1vbN/7MZx180lw6DmzQGdUGT1FIvY dojdrlax961NebG+ftOZED6nzkpDBlE1+VqIew/0fO4DCFHd1Ric0qYvJRqEZKOVZzGm ORyw== MIME-Version: 1.0 X-Received: by 10.58.211.69 with SMTP id na5mr1637058vec.30.1399630143598; Fri, 09 May 2014 03:09:03 -0700 (PDT) Received: by 10.221.34.142 with HTTP; Fri, 9 May 2014 03:09:03 -0700 (PDT) Date: Fri, 9 May 2014 10:09:03 +0000 Message-ID: Subject: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function. From: Philipp Rumpf To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary=047d7bd6c21a86cc5504f8f4c933 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 09 May 2014 11:42:45 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --047d7bd6c21a86cc5504f8f4c933 Content-Type: multipart/alternative; boundary=047d7bd6c21a86cc5104f8f4c931 --047d7bd6c21a86cc5104f8f4c931 Content-Type: text/plain; charset=UTF-8 In C mode and Python mode, hitting on an indented but otherwise empty line results in an unindented new line at point, rather than an indented line. To reproduce in emacs -Q: M-x python-mode if a == 3: M-: (current-column) Expected result: 4 / indented line Actual result: 0 / line not indented Emacs 24.3.1 produces the expected result. Lossage: M-x p y t h o n - m o d e i f SPC a SPC = = SPC 3 : M-: ( c u r r e n t - c o l u m n ) The same bug can be seen in C mode: M-x c-mode int main(void) { M-: (current-column) (However, since there are more electric characters in c-mode, the problem goes away as you continue typing; that isn't true of the python-mode bug). Investigating this, it seems the problem is in electric-indent-post-self-insert-function: its code reads (when (<= pos (line-beginning-position)) ... (delete-horizontal-space t))))) (unless (and electric-indent-inhibit (> pos (line-beginning-position))) (indent-according-to-mode))))) where pos is an integer, not a marker. Assuming electric-indent-inhibit, when delete-horizontal-space does anything (as is the case for newline on an indented empty line), (line-beginning-position) changes, but pos doesn't change along with it, so the (indent-according-to-mode) is skipped even though it should be run on new empty lines. The easiest fix would be to change electric--after-char-pos to return a marker, not an integer: diff --git a/lisp/electric.el b/lisp/electric.el index e8ceaa6..874ec09 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -176,7 +176,7 @@ (defun electric--after-char-pos () "Return the position after the char we just inserted. Returns nil when we can't find this char." - (let ((pos (point))) + (let ((pos (point-marker))) (when (or (eq (char-before) last-command-event) ;; Sanity check. (save-excursion (or (progn (skip-chars-backward " \t") A slightly different fix would avoid using a temporary marker for every self-insert: diff --git a/lisp/electric.el b/lisp/electric.el index e8ceaa6..34567d3 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -259,7 +259,8 @@ or comment." (unless (eq act 'do-indent) (nth 8 (syntax-ppss)))))))) ;; For newline, we want to reindent both lines and basically behave like ;; reindent-then-newline-and-indent (whose code we hence copied). - (when (<= pos (line-beginning-position)) + (let ((at-newline (<= pos (line-beginning-position)))) + (when at-newline (let ((before (copy-marker (1- pos) t))) (save-excursion (unless (or (memq indent-line-function @@ -280,8 +281,8 @@ or comment." ;; indentation may (re)introduce the whitespace. (delete-horizontal-space t))))) (unless (and electric-indent-inhibit - (> pos (line-beginning-position))) - (indent-according-to-mode))))) + (not at-newline)) + (indent-according-to-mode)))))) (put 'electric-indent-post-self-insert-function 'priority 60) Both fixes appear to fix the problem in c-mode and python-mode; I've not tested rst-mode, which appears to be the only other standard mode that uses electric-indent-inhibit. In GNU Emacs 24.4.50.14 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7) of 2014-05-08 on amerigo Windowing system distributor `The X.Org Foundation', version 11.0.11500000 System Description: Debian GNU/Linux unstable (sid) Configured using: `configure --without-makeinfo --without-compress-install' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Help Minor modes in effect: 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 buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent input: M-x p y t h o n - m o d e i f SPC a SPC = = SPC 3 : M-: ( c u r r e n t - c o l u m n ) M-x v i e w - l C-a C-SPC C-w M-x r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Can't guess python-indent-offset, using defaults: 4 0 (#o0, #x0, ?\C-@) Type C-x 1 to delete the help window. Beginning of buffer [4 times] Mark set End of buffer Buffer is read-only: # Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired 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 help-fns mail-prsvr mail-utils help-mode mule-util python easymenu comint ring ansi-color 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) Memory information: ((conses 16 82158 4302) (symbols 48 18600 0) (miscs 40 51 174) (strings 32 13034 3892) (string-bytes 1 365906) (vectors 16 10278) (vector-slots 8 388612 3417) (floats 8 68 243) (intervals 56 260 1) (buffers 960 13) (heap 1024 29346 991)) --047d7bd6c21a86cc5104f8f4c931 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In C mode and Python mode, hitting <RET> on an = indented but otherwise
empty line results in an unindented new line at p= oint, rather than an
indented line.

To reproduce in emacs -Q:

M-x python-mode<RET>
if a =3D=3D 3:<RET>
<RET><= br>M-: (current-column)<RET>

Expected result: 4 / indented lin= e
Actual result: 0 / line not indented

Emacs 24.3.1 produces the = expected result.


Lossage:

M-x p y t h o n - m o d e <return> i f SPC a = SPC =3D
=3D SPC 3 : <return> <return> M-: ( c u r r e n t - = c
o l u m n ) <return>


The same bug can be seen in C mo= de:

M-x c-mode<RET>
int main(void) {<RET>
<RET>
= M-: (current-column)<RET>

(However, since there are more elect= ric characters in c-mode, the
problem goes away as you continue typing; = that isn't true of the
python-mode bug).

Investigating this, it seems the problem is in
= electric-indent-post-self-insert-function: its code reads

=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (when (<=3D pos (line-beginning-position))
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (delete-horizontal-space t)))))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (unless (and electric-indent-inhibit
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (> pos (line-beginning-position)))
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (indent-according-to-mode)))))
<= br>where pos is an integer, not a marker. Assuming
electric-indent-inhib= it, when delete-horizontal-space does anything
(as is the case for newline on an indented empty line),
(line-beginning-= position) changes, but pos doesn't change along with
it, so the (ind= ent-according-to-mode) is skipped even though it should
be run on new em= pty lines.

The easiest fix would be to change electric--after-char-pos to returna marker, not an integer:

diff --git a/lisp/electric.el b/lisp/ele= ctric.el
index e8ceaa6..874ec09 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -176,7 +176,7 @@
=C2=A0(defun electric--aft= er-char-pos ()
=C2=A0=C2=A0 "Return the position after the char we = just inserted.
=C2=A0Returns nil when we can't find this char."=
-=C2=A0 (let ((pos (point)))
+=C2=A0 (let ((pos (point-marker)))
=C2=A0=C2=A0=C2=A0=C2=A0 (when (or (= eq (char-before) last-command-event) ;; Sanity check.
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (save-ex= cursion
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (or (progn (skip-chars-backward " \t= ")

A slightly different fix would avoid using a temporary marke= r for
every self-insert:

diff --git a/lisp/electric.el b/lisp/electric.el<= br>index e8ceaa6..34567d3 100644
--- a/lisp/electric.el
+++ b/lisp/el= ectric.el
@@ -259,7 +259,8 @@ or comment."
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (unless (eq act 'do-indent) (nth 8 (syntax-pps= s))))))))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; For newline, we want to reindent bo= th lines and basically behave like
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = ;; reindent-then-newline-and-indent (whose code we hence copied).
-=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (when (<=3D pos (line-beginning-position))+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((at-newline (<=3D pos (line-begi= nning-position))))
+=C2=A0=C2=A0=C2=A0 (when at-newline
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 (le= t ((before (copy-marker (1- pos) t)))
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 (save-excursion
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (unless (or (memq indent-line-function
@@ -280,8 +281,8 @@ or = comment."
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ;; indentatio= n may (re)introduce the whitespace.
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (delete-horizontal-space t)))))=
=C2=A0=C2=A0=C2=A0=C2=A0 (unless (and electric-indent-inhibit
-=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (> pos (line-beginning-position)))
-= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (indent-according-to-mode)))))+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (not at-n= ewline))
+=C2=A0=C2=A0=C2=A0 =C2=A0 (indent-according-to-mode))))))
=C2=A0
=C2= =A0(put 'electric-indent-post-self-insert-function 'priority=C2=A0 = 60)


Both fixes appear to fix the problem in c-mode and python-mo= de; I've
not tested rst-mode, which appears to be the only other sta= ndard mode
that uses electric-indent-inhibit.

In GNU Emacs 24.4.50.1= 4 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
=C2=A0of 2014-05-08 on= amerigo
Windowing system distributor `The X.Org Foundation', versio= n 11.0.11500000
System Description:=C2=A0=C2=A0=C2=A0 Debian GNU/Linux unstable (sid)
Configured using:
=C2=A0`configure --without-makeinfo --without-compre= ss-install'

Configured features:
XPM JPEG TIFF GIF PNG RSVG S= OUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS
LIBXML2 FREETYPE XFT ZLIB

Important settings:
=C2=A0 value of $LA= NG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-unix

Major mod= e: Help

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 e= lectric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mo= de: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t=
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-= composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 buffer-read-only: t
=C2=A0 lin= e-number-mode: t
=C2=A0 transient-mark-mode: t

Recent input:
M= -x p y t h o n - m o d e <return> i f SPC a SPC =3D
=3D SPC 3 : &= lt;return> <return> M-: ( c u r r e n t - c
o l u m n ) <return> M-x v i e w - l <tab> <return>
&= lt;help-echo> <down-mouse-1> <mouse-1> <up> <up>= <up>
<up> <up> <up> <up> <up> C-a = C-SPC <C-down> <down>
<up> <right> <C-up> <down> <right> <right&= gt; <right>
<right> <right> <right> <right&g= t; <right> <right> <right>
<right> <right>= ; <right> <right> <right> <right> <right> <right> <right> <right> <down> <right> <le= ft> C-w M-x
r e p <tab> o r <tab> <return>

= Recent messages:
For information about GNU Emacs and the GNU system, typ= e C-h C-a.
Can't guess python-indent-offset, using defaults: 4
0 (#o0, #x0, ?\C= -@)
Type C-x 1 to delete the help window.
Beginning of buffer [4 time= s]
Mark set
End of buffer
Buffer is read-only: #<buffer *Help*&= gt;
Making completion list...

Load-path shadows:
None found.

F= eatures:
(shadow sort gnus-util mail-extr emacsbug message dired 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-u= til help-fns mail-prsvr mail-utils help-mode mule-util python
easymenu c= omint ring ansi-color 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 j= it-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-la= ng misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyr= illic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minib= uffer nadvice loaddefs button faces cus-face macroexp files
text-propert= ies overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
db= usbind gfilenotify dynamic-setting system-font-setting
font-render-setti= ng move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:=
((conses 16 82158 4302)
=C2=A0(symbols 48 18600 0)
=C2=A0(miscs 40 51= 174)
=C2=A0(strings 32 13034 3892)
=C2=A0(string-bytes 1 365906)
= =C2=A0(vectors 16 10278)
=C2=A0(vector-slots 8 388612 3417)
=C2=A0(fl= oats 8 68 243)
=C2=A0(intervals 56 260 1)
=C2=A0(buffers 960 13)
=C2=A0(heap 1024 29346 991))

--047d7bd6c21a86cc5104f8f4c931-- --047d7bd6c21a86cc5504f8f4c933 Content-Type: text/plain; charset=US-ASCII; name="emacs-002.diff" Content-Disposition: attachment; filename="emacs-002.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_huzbhxb90 ZGlmZiAtLWdpdCBhL2xpc3AvZWxlY3RyaWMuZWwgYi9saXNwL2VsZWN0cmljLmVsCmluZGV4IGU4 Y2VhYTYuLjg3NGVjMDkgMTAwNjQ0Ci0tLSBhL2xpc3AvZWxlY3RyaWMuZWwKKysrIGIvbGlzcC9l bGVjdHJpYy5lbApAQCAtMTc2LDcgKzE3Niw3IEBACiAoZGVmdW4gZWxlY3RyaWMtLWFmdGVyLWNo YXItcG9zICgpCiAgICJSZXR1cm4gdGhlIHBvc2l0aW9uIGFmdGVyIHRoZSBjaGFyIHdlIGp1c3Qg aW5zZXJ0ZWQuCiBSZXR1cm5zIG5pbCB3aGVuIHdlIGNhbid0IGZpbmQgdGhpcyBjaGFyLiIKLSAg KGxldCAoKHBvcyAocG9pbnQpKSkKKyAgKGxldCAoKHBvcyAocG9pbnQtbWFya2VyKSkpCiAgICAg KHdoZW4gKG9yIChlcSAoY2hhci1iZWZvcmUpIGxhc3QtY29tbWFuZC1ldmVudCkgOzsgU2FuaXR5 IGNoZWNrLgogICAgICAgICAgICAgICAoc2F2ZS1leGN1cnNpb24KICAgICAgICAgICAgICAgICAo b3IgKHByb2duIChza2lwLWNoYXJzLWJhY2t3YXJkICIgXHQiKQo= --047d7bd6c21a86cc5504f8f4c933 Content-Type: text/plain; charset=US-ASCII; name="emacs-003.diff" Content-Disposition: attachment; filename="emacs-003.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_huzbi3811 ZGlmZiAtLWdpdCBhL2xpc3AvZWxlY3RyaWMuZWwgYi9saXNwL2VsZWN0cmljLmVsCmluZGV4IGU4 Y2VhYTYuLjM0NTY3ZDMgMTAwNjQ0Ci0tLSBhL2xpc3AvZWxlY3RyaWMuZWwKKysrIGIvbGlzcC9l bGVjdHJpYy5lbApAQCAtMjU5LDI5ICsyNTksMzAgQEAgb3IgY29tbWVudC4iCiAgICAgICAgICAg ICAgICAgICAgICh1bmxlc3MgKGVxIGFjdCAnZG8taW5kZW50KSAobnRoIDggKHN5bnRheC1wcHNz KSkpKSkpKSkKICAgICAgIDs7IEZvciBuZXdsaW5lLCB3ZSB3YW50IHRvIHJlaW5kZW50IGJvdGgg bGluZXMgYW5kIGJhc2ljYWxseSBiZWhhdmUgbGlrZQogICAgICAgOzsgcmVpbmRlbnQtdGhlbi1u ZXdsaW5lLWFuZC1pbmRlbnQgKHdob3NlIGNvZGUgd2UgaGVuY2UgY29waWVkKS4KLSAgICAgICh3 aGVuICg8PSBwb3MgKGxpbmUtYmVnaW5uaW5nLXBvc2l0aW9uKSkKLSAgICAgICAgKGxldCAoKGJl Zm9yZSAoY29weS1tYXJrZXIgKDEtIHBvcykgdCkpKQotICAgICAgICAgIChzYXZlLWV4Y3Vyc2lv bgotICAgICAgICAgICAgKHVubGVzcyAob3IgKG1lbXEgaW5kZW50LWxpbmUtZnVuY3Rpb24KLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZWN0cmljLWluZGVudC1mdW5jdGlvbnMtd2l0 aG91dC1yZWluZGVudCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGVsZWN0cmljLWluZGVudC1p bmhpYml0KQotICAgICAgICAgICAgICA7OyBEb24ndCByZWluZGVudCB0aGUgcHJldmlvdXMgbGlu ZSBpZiB0aGUgaW5kZW50YXRpb24gZnVuY3Rpb24KLSAgICAgICAgICAgICAgOzsgaXMgbm90IGEg cmVhbCBvbmUuCi0gICAgICAgICAgICAgIChnb3RvLWNoYXIgYmVmb3JlKQotICAgICAgICAgICAg ICAoaW5kZW50LWFjY29yZGluZy10by1tb2RlKSkKLSAgICAgICAgICAgIDs7IFdlIGFyZSBhdCBF T0wgYmVmb3JlIHRoZSBjYWxsIHRvIGluZGVudC1hY2NvcmRpbmctdG8tbW9kZSwgYW5kCi0gICAg ICAgICAgICA7OyBhZnRlciBpdCB3ZSB1c3VhbGx5IGFyZSBhcyB3ZWxsLCBidXQgbm90IGFsd2F5 cy4gIFdlIHRyaWVkIHRvCi0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