From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior Resent-From: Adam Connor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jun 2014 02:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17658@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140158945727372 (code B ref -1); Sun, 01 Jun 2014 02:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jun 2014 02:24:17 +0000 Received: from localhost ([127.0.0.1]:39305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WqvRX-00077K-0I for submit@debbugs.gnu.org; Sat, 31 May 2014 22:24:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35741) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wquu8-0003gO-C5 for submit@debbugs.gnu.org; Sat, 31 May 2014 21:49:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wquu0-0000VN-Qh for submit@debbugs.gnu.org; Sat, 31 May 2014 21:49:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AC_HTML_NONSENSE_TAGS, BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wquu0-0000VJ-Nf for submit@debbugs.gnu.org; Sat, 31 May 2014 21:49:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wquty-0007gf-Ee for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 21:49:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wqutw-0000UE-At for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 21:49:34 -0400 Received: from mail-ob0-x22d.google.com ([2607:f8b0:4003:c01::22d]:62846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wqutw-0000U0-0r for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 21:49:32 -0400 Received: by mail-ob0-f173.google.com with SMTP id wm4so3292423obc.18 for ; Sat, 31 May 2014 18:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=P/PRmcStwyz7pCs2Pyd7GdTL+/tHbrvKOnhfuW9kcso=; b=PXBWMcKGkXW8UBsFTYMOION/csEjpdwM2HJF74V1Bm3OCAcncI+EG7XidVfRPbPgvy Juusn5jzNmioUOemQpGOGK8PxZtoPej9Zjv+2ybYUJVarIGkJUqO8X6XCMCrSwd3y5rW olsgLBF0fW/AiW2utbsXv/87RzKXpVWRl2YDI3fgBijlN0MGqVL6W0GVtjEo7Ye+jluv 2giOQW29ZJ4gu4zKsVD9PmuXwLPR/jM/FKDkMvqmonohOT9i1jMH6CN9hCGx26G/Zh3C MBzKvdrGw2r2iiX9FCFDvcF+hKBuI2svpsJezkR0E0l2q/AhZBnf5wRe09vEJI/fhNHO PRmw== X-Received: by 10.60.155.5 with SMTP id vs5mr29413069oeb.32.1401587371063; Sat, 31 May 2014 18:49:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.85.161 with HTTP; Sat, 31 May 2014 18:49:09 -0700 (PDT) From: Adam Connor Date: Sat, 31 May 2014 20:49:09 -0500 Message-ID: Content-Type: multipart/alternative; boundary=047d7bb048145fc06e04fabc7d0c 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: -3.8 (---) X-Mailman-Approved-At: Sat, 31 May 2014 22:24:13 -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: -3.8 (---) --047d7bb048145fc06e04fabc7d0c Content-Type: text/plain; charset=UTF-8 I've seen this most often in Django coding. Suppose the following file: ------------------------------ snip ------------------------------ from django.conf.urls import patterns, include, url from django.contrib import admin from myapp import views urlpatterns = patterns('', url(r'^$', views.index), ) ------------------------------ snip ------------------------------ When I try to change the "url..." line to ------------------------------ snip ------------------------------ url(r'^$', views.index, name="myapp_index"), ------------------------------ snip ------------------------------ the moment I type the comma, the whole line bounces way over to the left. Is this a bug? Is there a way to turn this off? It is highly distracting. (For what it is worth, I've seen the same issue in Windows Emacs.) If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /usr/share/emacs/24.3/etc/DEBUG. In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2) of 2013-07-26 on roseapple, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11405000 System Description: Linux Mint 16 Petra Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Python Minor modes in effect: shell-dirtrack-mode: t my-keys-minor-mode: t global-undo-tree-mode: t tabbar-mode: t recentf-mode: t global-linum-mode: t linum-mode: t fci-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-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: s e r e s t u r n SPC H t t p R e s p o n s e ( ' H e l l o ' ) C-x C-s C-v C-y C-y SPC SPC SPC SPC r e a l m s _ o f _ s o u r r c e r y ' C-x C-s C-h v i n d e n t - l i n e - f u n c t i o n SPC SPC SPC SPC U u r l ( ' r ' ^ $ ' , SPC v i e w s . i n d e x , SPC n a m e C-k C-k , SPC SPC SPC SPC SPC M-w C-x h M-w M-x r e p o r t - e m a c s - b u g Recent messages: Can't guess python-indent-offset, using defaults: 4 Saving file /home/adam/django_projs/ros/character/views.py... Wrote /home/adam/django_projs/ros/character/views.py scroll-up-command: End of buffer Mark set [2 times] Auto-saving...done Saving file /home/adam/django_projs/ros/ros/urls.py... Wrote /home/adam/django_projs/ros/ros/urls.py Type "q" in help window to restore its previous buffer. Auto-saving...done Load-path shadows: /home/adam/.emacs.d/elpa/python-django-20131214.1841/python-django hides ~/.emacs.d/lib/python-django /home/adam/.emacs.d/elpa/undo-tree-0.6.5/undo-tree hides ~/.emacs.d/lib/undo-tree ~/.emacs.d/elisp/virtualenv hides ~/.emacs.d/lib/virtualenv /usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup ~/.emacs.d/lib/indent hides /usr/share/emacs/24.3/lisp/indent /usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell /usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv gnus-util mm-util mail-prsvr password-cache tramp-loaddefs cl-macs gv shell pcomplete format-spec pp misearch multi-isearch python-django sql thingatpt json hippie-exp help-mode haskell-font-lock haskell-mode haskell-string haskell-sort-imports haskell-align-imports cl noutline outline flymake compile dabbrev disp-table python rx comint ring ansi-color sh-script smie executable vc-git util undo-tree diff tabbar indent revbufs recentf tree-widget wid-edit linum ido framemove advice help-fns cl-lib advice-preload fill-column-indicator easy-mmode desktop haskell-mode-autoloads edmacro kmacro info easymenu ov-autoloads finder-inf python-django-autoloads undo-tree-autoloads package misterioso-theme time-date tooltip 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 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 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 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --047d7bb048145fc06e04fabc7d0c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I've seen this most often in Django coding. Suppo= se the following file:
------------------------------ snip -------= -----------------------
from django.conf.urls import patterns, include, = url

from django.contrib import admin

from myapp import views
urlpatterns =3D patterns('',
=C2=A0=C2=A0=C2=A0 url(r'^= $', views.index),
)
------------------------------ snip ---------= ---------------------

When I try to change the "url..." line to
----------------= -------------- snip ------------------------------
=C2=A0=C2=A0=C2=A0 ur= l(r'^$', views.index, name=3D"myapp_index"),
---------= --------------------- snip ------------------------------

the moment I type the comma, the whole line bounces way over to the lef= t.

Is this a bug? Is there a way to turn this off? It is highly
d= istracting.

(For what it is worth, I've seen the same issue in W= indows Emacs.)

If Emacs crashed, and you have the Emacs process in the gdb debugger,please include the output from the following gdb commands:
=C2=A0=C2= =A0=C2=A0 `bt full' and `xbacktrace'.
For information about debu= gging Emacs, please read the file
/usr/share/emacs/24.3/etc/DEBUG.


In GNU Emacs 24.3.1 (x86_64-pc-= linux-gnu, GTK+ Version 3.8.2)
=C2=A0of 2013-07-26 on roseapple, modifie= d by Debian
Windowing system distributor `The X.Org Foundation', ver= sion 11.0.11405000
System Description:=C2=A0=C2=A0=C2=A0 Linux Mint 16 Petra

Configured= using:
=C2=A0`configure '--build' 'x86_64-linux-gnu' &#= 39;--build' 'x86_64-linux-gnu'
=C2=A0'--prefix=3D/usr= 9; '--sharedstatedir=3D/var/lib' '--libexecdir=3D/usr/lib'<= br> =C2=A0'--localstatedir=3D/var/lib' '--infodir=3D/usr/share/info= '
=C2=A0'--mandir=3D/usr/share/man' '--with-pop=3Dyes= 9;
=C2=A0'--enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/loca= l/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/em= acs/24.3/site-lisp:/usr/share/emacs/site-lisp'
=C2=A0'--with-crt-dir=3D/usr/lib/x86_64-linux-gnu' '--with-x=3D= yes'
=C2=A0'--with-x-toolkit=3Dgtk3' '--with-toolkit-scr= oll-bars'
=C2=A0'build_alias=3Dx86_64-linux-gnu' 'CFLAGS= =3D-g -O2 -fstack-protector
=C2=A0--param=3Dssp-buffer-size=3D4 -Wformat -Werror=3Dformat-security -Wal= l'
=C2=A0'LDFLAGS=3D-Wl,-Bsymbolic-functions -Wl,-z,relro'=C2=A0'CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2''

Important se= ttings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-unix
=C2=A0 default enable-multibyte-= characters: t

Major mode: Python

Minor modes in effect:
= =C2=A0 shell-dirtrack-mode: t
=C2=A0 my-keys-minor-mode: t
=C2=A0 glo= bal-undo-tree-mode: t
=C2=A0 tabbar-mode: t
=C2=A0 recentf-mode: t
=C2=A0 global-linum-mode= : t
=C2=A0 linum-mode: t
=C2=A0 fci-mode: t
=C2=A0 desktop-save-mo= de: t
=C2=A0 tooltip-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 men= u-bar-mode: 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-encryptio= n-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: t<= br>=C2=A0 transient-mark-mode: t

Recent input:
s e <down> <down-mouse-1> <mouse-moveme= nt> <mouse-1>
r e s <backspace> t u r n SPC H t t p R e = s p o n s
e ( ' H e l l o ' ) C-x C-s <help-echo> <hel= p-echo>
<down-mouse-1> <mouse-1> <help-echo> <help-echo> &l= t;down-mouse-1>
<mouse-1> <return> C-v C-y <help-echo= > <help-echo>
<down-mouse-1> <mouse-1> <return&= gt; C-y <home> SPC SPC
SPC SPC <down-mouse-1> <mouse-movement> <mouse-1> <bac= kspace>
<backspace> <backspace> <backspace> <ba= ckspace> <backspace>
<backspace> <backspace> <b= ackspace> <right> <down-mouse-1>
<mouse-1> <backspace> <backspace> <backspace> <b= ackspace>
<backspace> <backspace> <backspace> <= backspace> <backspace>
<backspace> <backspace> <= ;backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> r e a l m s _ o
f= _ s o u r <backspace> <backspace> r c e r y ' <home>=
<kp-delete> <kp-delete> <kp-delete> <kp-delete>= ; <kp-delete>
<kp-delete> <kp-delete> <kp-delete> <kp-delete> <= ;kp-delete>
<kp-delete> <kp-delete> <kp-delete> &l= t;kp-delete> <kp-delete>
<kp-delete> <kp-delete> &= lt;kp-delete> <kp-delete> C-x
C-s <help-echo> <help-echo> C-h v i n d e n t - l i
n e - f= u n c t i o n <return> <help-echo> <help-echo>
<d= own-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> <do= wn-mouse-1>
<mouse-1> <return> SPC SPC SPC SPC U <backspace> u
r = l ( ' <backspace> r ' ^ $ ' , SPC v i e w s . i n
d e= x , SPC n a m e <backspace> <home> C-k C-k <down-mouse-1>= ;
<mouse-1> <backspace> <backspace> <backspace> <b= ackspace>
<backspace> <backspace> <backspace> <= backspace> <backspace>
<backspace> <backspace> <= ;backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <= ;backspace>
<backspace> <backspace> <backspace> &l= t;backspace> <backspace>
, SPC <backspace> <backspace= > <home> <kp-delete> <kp-delete>
<kp-delete> <kp-delete> <kp-delete> <kp-delete> <= ;kp-delete>
<kp-delete> <kp-delete> <kp-delete> &l= t;kp-delete> <kp-delete>
<kp-delete> <kp-delete> &= lt;kp-delete> <kp-delete> <kp-delete>
<kp-delete> <kp-delete> <kp-delete> <kp-delete> <= ;kp-delete>
<kp-delete> SPC SPC SPC SPC <down-mouse-1> &= lt;mouse-movement>
<mouse-movement> <drag-mouse-1> M-w &= lt;help-echo> <help-echo>
C-x h M-w <help-echo> <help-echo> <help-echo> <help-ec= ho>
M-x r e p o r t - e m a c s - b u g <return>

Recent= messages:
Can't guess python-indent-offset, using defaults: 4
Saving file /home/adam/django_projs/ros/character/views.py...
Wrote /hom= e/adam/django_projs/ros/character/views.py
scroll-up-command: End of buf= fer
Mark set [2 times]
Auto-saving...done
Saving file /home/adam/d= jango_projs/ros/ros/urls.py...
Wrote /home/adam/django_projs/ros/ros/urls.py
Type "q" in help= window to restore its previous buffer.
Auto-saving...done

Load-p= ath shadows:
/home/adam/.emacs.d/elpa/python-django-20131214.1841/python= -django hides ~/.emacs.d/lib/python-django
/home/adam/.emacs.d/elpa/undo-tree-0.6.5/undo-tree hides ~/.emacs.d/lib/und= o-tree
~/.emacs.d/elisp/virtualenv hides ~/.emacs.d/lib/virtualenv
/u= sr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-li= sp/debian-startup
~/.emacs.d/lib/indent hides /usr/share/emacs/24.3/lisp/indent
/usr/share= /emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/l= isp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/fl= yspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec= mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils m= ailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache tra= mp
tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv
gnus= -util mm-util mail-prsvr password-cache tramp-loaddefs cl-macs gv
shell = pcomplete format-spec pp misearch multi-isearch python-django sql
thinga= tpt json hippie-exp help-mode haskell-font-lock haskell-mode
haskell-string haskell-sort-imports haskell-align-imports cl noutline
ou= tline flymake compile dabbrev disp-table python rx comint ring
ansi-colo= r sh-script smie executable vc-git util undo-tree diff tabbar
indent rev= bufs recentf tree-widget wid-edit linum ido framemove advice
help-fns cl-lib advice-preload fill-column-indicator easy-mmode desktop
= haskell-mode-autoloads edmacro kmacro info easymenu ov-autoloads
finder-= inf python-django-autoloads undo-tree-autoloads package
misterioso-theme= time-date tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulate= d-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer sel= ect 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
eur= opean ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook= help simple abbrev minibuffer loaddefs button faces
cus-face macroexp f= iles text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
mak= e-network-process dbusbind dynamic-setting system-font-setting
font-rend= er-setting move-toolbar gtk x-toolkit x multi-tty emacs)

--047d7bb048145fc06e04fabc7d0c-- From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jun 2014 02:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Adam Connor Cc: "=?UTF-8?Q?Fabi=C3=A1n?= E. Gallina" , 17658@debbugs.gnu.org Received: via spool by 17658-submit@debbugs.gnu.org id=B17658.140159088930597 (code B ref 17658); Sun, 01 Jun 2014 02:49:02 +0000 Received: (at 17658) by debbugs.gnu.org; 1 Jun 2014 02:48:09 +0000 Received: from localhost ([127.0.0.1]:39341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wqvof-0007xQ-Dq for submit@debbugs.gnu.org; Sat, 31 May 2014 22:48:09 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:60094) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wqvob-0007wu-T0 for 17658@debbugs.gnu.org; Sat, 31 May 2014 22:48:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOAEDqRmBaoNMIYEsJA X-IPAS-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOAEDqRmBaoNMIYEsJA X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="65211043" Received: from 206-248-131-163.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 31 May 2014 22:47:59 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 3DDB8AE0BC; Sat, 31 May 2014 22:47:59 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Sat, 31 May 2014 22:47:59 -0400 In-Reply-To: (Adam Connor's message of "Sat, 31 May 2014 20:49:09 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) 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 (/) > ------------------------------ snip ------------------------------ > from django.conf.urls import patterns, include, url > from django.contrib import admin > from myapp import views > urlpatterns =3D patterns('', > url(r'^$', views.index), > ) > ------------------------------ snip ------------------------------ > When I try to change the "url..." line to > ------------------------------ snip ------------------------------ > url(r'^$', views.index, name=3D"myapp_index"), > ------------------------------ snip ------------------------------ > the moment I type the comma, the whole line bounces way over to the left. Indeed, I can reproduce this in Emacs-24.3.91. The important detail is not to hit "," but to insert a char right before the inner close paren. The problem seems to be in python-indent-post-self-insert-function, where the "still in parenthesis" check doesn't realize that it's within a different pair of parens. > Is this a bug? Looks like it, yes. Fabi=E1n, can you take care of it? > Is there a way to turn this off? A temporary workaround could be (add-hook 'python-mode-hook (lambda () (remove-hook 'post-self-insert-hook #'python-indent-post-self-insert-function 'local))) -- Stefan From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jun 2014 15:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17658@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14016367725640 (code B ref -1); Sun, 01 Jun 2014 15:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jun 2014 15:32:52 +0000 Received: from localhost ([127.0.0.1]:40010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wr7kh-0001St-3C for submit@debbugs.gnu.org; Sun, 01 Jun 2014 11:32:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50014) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wr7ke-0001Sf-4M for submit@debbugs.gnu.org; Sun, 01 Jun 2014 11:32:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wr7kR-00051W-Lp for submit@debbugs.gnu.org; Sun, 01 Jun 2014 11:32:42 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr7kR-00051S-IB for submit@debbugs.gnu.org; Sun, 01 Jun 2014 11:32:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr7kL-0001BV-1V for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2014 11:32:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wr7kE-00050C-NG for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2014 11:32:28 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:54923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wr7kE-000501-EY for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2014 11:32:22 -0400 Received: from [192.168.178.32] (brln-4dba332f.pool.mediaWays.net [77.186.51.47]) by mrelayeu.kundenserver.de (node=mreue006) with ESMTP (Nemesis) id 0LenO7-1WTOG43UI3-00qmzx; Sun, 01 Jun 2014 17:32:20 +0200 Message-ID: <538B4772.2010109@easy-emacs.de> Date: Sun, 01 Jun 2014 17:32:02 +0200 From: Andreas =?UTF-8?Q?R=C3=B6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:btt6b41fb4IYkynLFiqrtnqlmqcq5/748DkwTyw2IMm C8EjhReMwyxZt5ONvriMyKE6Vmo17BEGJHDCMDjyfgJct8G1/6 yMY8+x5IkDNXSwzYZ2Tqzf4g1iiahafPvlWe6nPVJNe0kP2e9C ABpwclU1sIyqmPP+L+SiFFvUKawj0zhKPD8VdcHHD/gZ9J74Sw ZzR+5sVMWyJ6HsWLWpL0gfyNgGWuQ0U4KvQ1S+RQXAX/IE1pRV cybxpNa0oZsk9c6n+hdMOmlgahjEuaZWTeUJh23SGiC5+Fxh4W poMXaXaQqLzt2xAMfJhZw9226iowF6zYiEeCUuCqSoN5g0Qk3h ZOSFFsbwkIG4NHBgtBT2fkh4LLSqtXT7oIpvKrkT5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] 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: -5.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: -5.0 (-----) On 01.06.2014 04:47, Stefan Monnier wrote: >> ------------------------------ snip ------------------------------ >> from django.conf.urls import patterns, include, url > >> from django.contrib import admin > >> from myapp import views > >> urlpatterns = patterns('', >> url(r'^$', views.index), >> ) >> ------------------------------ snip ------------------------------ > >> When I try to change the "url..." line to >> ------------------------------ snip ------------------------------ >> url(r'^$', views.index, name="myapp_index"), >> ------------------------------ snip ------------------------------ > >> the moment I type the comma, the whole line bounces way over to the left. > > Indeed, I can reproduce this in Emacs-24.3.91. The important detail is > not to hit "," but to insert a char right before the inner close paren. > > The problem seems to be in python-indent-post-self-insert-function, > where the "still in parenthesis" check doesn't realize that it's within > a different pair of parens. > >> Is this a bug? > > Looks like it, yes. Fabián, can you take care of it? > >> Is there a way to turn this off? > > A temporary workaround could be > > (add-hook 'python-mode-hook > (lambda () > (remove-hook 'post-self-insert-hook > #'python-indent-post-self-insert-function 'local))) > > -- Stefan > > > > Can't reproduce. Indents to column 23, which seems correct. BTW setting `electric-indent-mode' to nil would also be an alternative to avoid it. Andreas ;;;;;;;;;;;;;; In GNU Emacs 24.3.90.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2014-04-24 Windowing system distributor `The X.Org Foundation', version 11.0.11204000 System Description: Debian GNU/Linux 7.5 (wheezy) Important settings: value of $LANG: de_DE.utf8 locale-coding-system: utf-8-unix Major mode: Python 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 column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC M-+ , C-x 1 C-SPC M-f M-f M-f M-w C-h v C-x 1 M-+ C-x b , C-x b M-x e d e b C-g M-x e x i t - r q c o u q C-_ M-x c l u o l u , SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC M-x e r e p o r t - e m Recent messages: Result: 23 (#o27, #x17, ?\C-w) Result: 23 (#o27, #x17, ?\C-w) Result: 23 (#o27, #x17, ?\C-w) Result: 23 (#o27, #x17, ?\C-w) Result: 23 (#o27, #x17, ?\C-w) 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 cus-start cus-load mule-util edebug cl-loaddefs cl-lib find-func help-mode help-fns 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 inotify dynamic-setting x-toolkit x multi-tty emacs) Memory information: ((conses 8 131478 7096) (symbols 24 37591 0) (miscs 20 149 1193) (strings 16 50813 4816) (string-bytes 1 715481) (vectors 8 11545) (vector-slots 4 408689 5730) (floats 8 69 778) (intervals 28 658 16) (buffers 512 15) (heap 1024 18515 438)) From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jun 2014 21:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andreas =?UTF-8?Q?R=C3=B6hler?= Cc: 17658@debbugs.gnu.org Received: via spool by 17658-submit@debbugs.gnu.org id=B17658.140165750916407 (code B ref 17658); Sun, 01 Jun 2014 21:19:02 +0000 Received: (at 17658) by debbugs.gnu.org; 1 Jun 2014 21:18:29 +0000 Received: from localhost ([127.0.0.1]:40090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrD9A-0004GZ-V0 for submit@debbugs.gnu.org; Sun, 01 Jun 2014 17:18:29 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:51513) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrD97-0004GH-Fo for 17658@debbugs.gnu.org; Sun, 01 Jun 2014 17:18:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA1CIEXF3SCJQEBAQECAVYjBQsLNBIUGA0kiAQI0hkXjnoHhDgEqRmBaoNMIQ X-IPAS-Result: ArYGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA1CIEXF3SCJQEBAQECAVYjBQsLNBIUGA0kiAQI0hkXjnoHhDgEqRmBaoNMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="65276680" Received: from 206-248-131-163.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 01 Jun 2014 17:18:19 -0400 Received: by pastel.home (Postfix, from userid 20848) id B65B8601AD; Sun, 1 Jun 2014 17:18:19 -0400 (EDT) From: Stefan Monnier Message-ID: References: <538B4772.2010109@easy-emacs.de> Date: Sun, 01 Jun 2014 17:18:19 -0400 In-Reply-To: <538B4772.2010109@easy-emacs.de> ("Andreas =?UTF-8?Q?R=C3=B6hler?="'s message of "Sun, 01 Jun 2014 17:32:02 +0200") 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-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 (/) > Indents to column 23, which seems correct. It shouldn't re-indent at all. > BTW setting `electric-indent-mode' to nil would also be an alternative > to avoid it. Makes no difference, it's not done by electric-indent-mode. Stefan From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jun 2014 06:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 17658@debbugs.gnu.org Received: via spool by 17658-submit@debbugs.gnu.org id=B17658.140168997214748 (code B ref 17658); Mon, 02 Jun 2014 06:20:02 +0000 Received: (at 17658) by debbugs.gnu.org; 2 Jun 2014 06:19:32 +0000 Received: from localhost ([127.0.0.1]:40253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrLal-0003pn-Tr for submit@debbugs.gnu.org; Mon, 02 Jun 2014 02:19:32 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:50599) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrLaj-0003pX-5q for 17658@debbugs.gnu.org; Mon, 02 Jun 2014 02:19:30 -0400 Received: from [192.168.178.32] (brln-4d0cb981.pool.mediaWays.net [77.12.185.129]) by mrelayeu.kundenserver.de (node=mreue003) with ESMTP (Nemesis) id 0MF8bn-1X3C5U0YRf-00GJCy; Mon, 02 Jun 2014 08:19:19 +0200 Message-ID: <538C1754.40903@easy-emacs.de> Date: Mon, 02 Jun 2014 08:19:00 +0200 From: Andreas =?UTF-8?Q?R=C3=B6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 References: <538B4772.2010109@easy-emacs.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:ePjPXSkD1lONS1Z8cBiOQFAUh0vs2G7gl1I9IAxnXux ebYZQwX8fR5+oFy1MIoK/MlRDiuapweAJ+b0oh5+j9OYmzqmiZ FjT9EYwHcIJW8JrkwLVk5/Fb+yOmgm8ngiS0yScENVDhzYeQPi qEL6bZPai7ZUnbCkfZBebtMp3+jJ/nQQBxOMBLlMA0zLPQW7C6 1MOGVXqtbD7wqb63jr/WKLLmrRNhJV/yA4wCM0CYo+2cCkN/LW aa28Y9SaAf6EpenW5r3UBQwilAXyZcOAMpjsJ5K/l5TRqbJHUQ ZFsoye5VA9Zy/UWuF8hGLN8Uro9ozdxtrdHO+E/abuLodWmRuF 6iNGDIt26skn6b6RsIMvHxyqcZbG5P817FisXSUTh X-Spam-Score: 0.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: 0.0 (/) On 01.06.2014 23:18, Stefan Monnier wrote: >> Indents to column 23, which seems correct. > > It shouldn't re-indent at all. > >> BTW setting `electric-indent-mode' to nil would also be an alternative >> to avoid it. > > Makes no difference, Did you try it? it's not done by electric-indent-mode. > > > Stefan > AFAIU it's a feature of electric-indent-mode The chars, which trigger an indent, may differ. In this case a comma triggers it. The real bug here IMHO is `electric-indent-mode' on by default - should be off. Andreas From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jun 2014 13:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andreas =?UTF-8?Q?R=C3=B6hler?= Cc: =?UTF-8?Q?Fabi=C3=A1n?= E. Gallina , 17658@debbugs.gnu.org Received: via spool by 17658-submit@debbugs.gnu.org id=B17658.14017162363657 (code B ref 17658); Mon, 02 Jun 2014 13:38:02 +0000 Received: (at 17658) by debbugs.gnu.org; 2 Jun 2014 13:37:16 +0000 Received: from localhost ([127.0.0.1]:40454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrSQJ-0000wo-IJ for submit@debbugs.gnu.org; Mon, 02 Jun 2014 09:37:16 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:62254) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrSQB-0000w9-2x for 17658@debbugs.gnu.org; Mon, 02 Jun 2014 09:37:08 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOASpGYFqg0wh X-IPAS-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReOegeEOASpGYFqg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="65341291" Received: from 206-248-131-163.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 02 Jun 2014 09:36:57 -0400 Received: by pastel.home (Postfix, from userid 20848) id E0138600E1; Mon, 2 Jun 2014 09:36:56 -0400 (EDT) From: Stefan Monnier Message-ID: References: <538B4772.2010109@easy-emacs.de> <538C1754.40903@easy-emacs.de> Date: Mon, 02 Jun 2014 09:36:56 -0400 In-Reply-To: <538C1754.40903@easy-emacs.de> ("Andreas =?UTF-8?Q?R=C3=B6hler?="'s message of "Mon, 02 Jun 2014 08:19:00 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) 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 (/) >> Makes no difference, > Did you try it? I tried it in Emacs-24.3 which doesn't enable electric-indent-mode by default, but suffers from the same problem. Admittedly, In 24.4, I half-fixed the problem by linking this python-mode feature to electric-indent-mode, so that it can be turned off. > The chars, which trigger an indent, may differ. In this case a comma > triggers it. Any char triggers it. As I said: The important detail is not to hit "," but to insert a char right before the inner close paren. The comma is not in electric-indent-chars. Here's the offending code in python-indent-post-self-insert-function: ((and (not (bolp)) (memq (char-after) '(?\) ?\] ?\}))) (save-excursion (goto-char (line-beginning-position)) ;; If after going to the beginning of line the point ;; is still inside a paren it's ok to do the trick (when (python-syntax-context 'paren) (let ((indentation (python-indent-calculate-indentation))) (when (< (current-indentation) indentation) (indent-line-to indentation)))))) This means that current line is reindented whenever you insert a char right before a close-paren and line-beginning-position is inside some parentheses. Since reindenting a line is problematic in Python, it should only be done when we really know for sure that the current indent is wrong. So clearly the above condition triggers too often. But I don't understand the intention of the code, i.e. I don't understand when the above is meant to trigger reindentation, so I don't know how to fix it. Presumably Fabi=E1n should be able to shed some light here. Stefan From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jun 2014 16:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: "=?UTF-8?Q?Fabi=C3=A1n?= E. Gallina" , 17658@debbugs.gnu.org Received: via spool by 17658-submit@debbugs.gnu.org id=B17658.140172518219846 (code B ref 17658); Mon, 02 Jun 2014 16:07:01 +0000 Received: (at 17658) by debbugs.gnu.org; 2 Jun 2014 16:06:22 +0000 Received: from localhost ([127.0.0.1]:41070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrUkb-00059t-M1 for submit@debbugs.gnu.org; Mon, 02 Jun 2014 12:06:22 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:55155) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrUkU-00059N-RO for 17658@debbugs.gnu.org; Mon, 02 Jun 2014 12:06:15 -0400 Received: from [192.168.178.32] (brln-4d0cb981.pool.mediaWays.net [77.12.185.129]) by mrelayeu.kundenserver.de (node=mreue001) with ESMTP (Nemesis) id 0Ls3iR-1Wg8Hu3IJb-013ugj; Mon, 02 Jun 2014 18:06:02 +0200 Message-ID: <538CA0DD.1080901@easy-emacs.de> Date: Mon, 02 Jun 2014 18:05:49 +0200 From: Andreas =?UTF-8?Q?R=C3=B6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 References: <538B4772.2010109@easy-emacs.de> <538C1754.40903@easy-emacs.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:+a8NMcBfFZB+jsmwIp7C9RAePK+JZcOCflJHI+bwgz1 Xvi/gtB3mG/tX0KEX3g2tSw3BL4A9x7X01W6m8bUZH8WojKKY6 vMpGQPML4q8zKTGUnXV87d+3YIwtgNyW1YxBzL9x1lka1p68Gl ulirQJptAWTKeg5LyYsvWBpq8yXpgo/O/bl8Rlwr1841QJE3J1 7LaLlm0xDm2t34CPUkuW9lwTE+rd8kCXb2Vck6JMJsWr+eDFGm Uyo2sYdA73x0ZGiV2jOP3ItRkp56WyRyqnMSzmXMA6EUM7snO3 /NGBsSrU+vOR2rqXvHQC6/wAq/UZI17UcY0UHlrdb2kaMSyU9O 8Aj9hfIuvgSnobE4I0o9t4ASPoU1QFOEFg4QMxLcm X-Spam-Score: 0.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: 0.0 (/) On 02.06.2014 15:36, Stefan Monnier wrote: >>> Makes no difference, >> Did you try it? > > I tried it in Emacs-24.3 which doesn't enable electric-indent-mode by > default, but suffers from the same problem. Admittedly, In 24.4, > I half-fixed the problem by linking this python-mode feature to > electric-indent-mode, so that it can be turned off. > >> The chars, which trigger an indent, may differ. In this case a comma >> triggers it. > > Any char triggers it. As I said: > > The important detail is not to hit "," but to insert a char right > before the inner close paren. > > The comma is not in electric-indent-chars. > > Here's the offending code in python-indent-post-self-insert-function: > > ((and (not (bolp)) > (memq (char-after) '(?\) ?\] ?\}))) > (save-excursion > (goto-char (line-beginning-position)) > ;; If after going to the beginning of line the point > ;; is still inside a paren it's ok to do the trick > (when (python-syntax-context 'paren) > (let ((indentation (python-indent-calculate-indentation))) > (when (< (current-indentation) indentation) > (indent-line-to indentation)))))) > > This means that current line is reindented whenever you insert a char > right before a close-paren and line-beginning-position is inside some > parentheses. Since reindenting a line is problematic in Python, it > should only be done when we really know for sure that the current indent > is wrong. So clearly the above condition triggers too often. > But I don't understand the intention of the code, i.e. I don't > understand when the above is meant to trigger reindentation, so I don't > know how to fix it. Presumably Fabián should be able to shed some > light here. > > > > Stefan > Agree, thanks a lot for the details! Andreas From unknown Sun Sep 14 01:17:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17658: Python mode has odd indentation behavior References: Resent-From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Jul 2014 02:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17658@debbugs.gnu.org Received: via spool by 17658-submit@debbugs.gnu.org id=B17658.140418199812236 (code B ref 17658); Tue, 01 Jul 2014 02:34:02 +0000 Received: (at 17658) by debbugs.gnu.org; 1 Jul 2014 02:33:18 +0000 Received: from localhost ([127.0.0.1]:38471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1nsj-0003BG-TH for submit@debbugs.gnu.org; Mon, 30 Jun 2014 22:33:18 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57076 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1nsg-0003B4-UO for 17658@debbugs.gnu.org; Mon, 30 Jun 2014 22:33:15 -0400 Received: from 222-99-245-190.fibertel.com.ar ([190.245.99.222]:54819 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1X1nsg-000685-3X for 17658@debbugs.gnu.org; Mon, 30 Jun 2014 22:33:14 -0400 From: fgallina@gnu.org (=?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) In-Reply-To: Date: Mon, 30 Jun 2014 23:33:10 -0300 Message-ID: <87ionh7qqh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.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: -5.0 (-----) > ------------------------------ snip ------------------------------ > from django.conf.urls import patterns, include, url > from django.contrib import admin > from myapp import views > urlpatterns =3D patterns('', > url(r'^$', views.index), > ) > ------------------------------ snip ------------------------------ While this is a pretty recurrent style in Django's documentation, this indentation style goes against PEP8. http://legacy.python.org/dev/peps/pep-0008/#indentation Here's a nice answer on SO with an example similar to yours: http://stackoverflow.com/questions/15435811/what-is-pep8s-e128-continuation= -line-under-indented-for-visual-indent/15435837#15435837 > When I try to change the "url..." line to > ------------------------------ snip ------------------------------ > url(r'^$', views.index, name=3D"myapp_index"), > ------------------------------ snip ------------------------------ > the moment I type the comma, the whole line bounces way over to the left. Right, that was absolutely intended in the code. I'm now working in a variant that would prevent triggering the indentation in that particular case. Notice, that even with this fix, python.el will still use the first argument indentation as default value for further url definitions, so I would suggest to embrace the PEP8 way intead -- unless you are really contributing to Django and are forced to follow that convention. Regards, Fabi=C3=A1n From unknown Sun Sep 14 01:17:53 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: Adam Connor Subject: bug#17658: closed (Re: bug#17658: Python mode has odd indentation behavior) Message-ID: References: <87y4wd20fs.fsf@gnu.org> X-Gnu-PR-Message: they-closed 17658 X-Gnu-PR-Package: emacs Reply-To: 17658@debbugs.gnu.org Date: Tue, 01 Jul 2014 04:01:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1404187263-20943-1" This is a multi-part message in MIME format... ------------=_1404187263-20943-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17658: Python mode has odd indentation behavior 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 17658@debbugs.gnu.org. --=20 17658: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17658 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1404187263-20943-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17658-done) by debbugs.gnu.org; 1 Jul 2014 04:00:15 +0000 Received: from localhost ([127.0.0.1]:38493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1pEs-0005Q2-ER for submit@debbugs.gnu.org; Tue, 01 Jul 2014 00:00:14 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:58041 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X1pEp-0005Pu-Lv for 17658-done@debbugs.gnu.org; Tue, 01 Jul 2014 00:00:12 -0400 Received: from 222-99-245-190.fibertel.com.ar ([190.245.99.222]:55169 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1X1pEo-0005xi-JW for 17658-done@debbugs.gnu.org; Tue, 01 Jul 2014 00:00:11 -0400 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: 17658-done@debbugs.gnu.org Subject: Re: bug#17658: Python mode has odd indentation behavior Date: Tue, 01 Jul 2014 01:00:07 -0300 Message-ID: <87y4wd20fs.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 17658-done 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: -5.0 (-----) Fixed in revno 117329 of the emacs-24 branch. Regards, Fabi=C3=A1n ------------=_1404187263-20943-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Jun 2014 02:24:17 +0000 Received: from localhost ([127.0.0.1]:39305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WqvRX-00077K-0I for submit@debbugs.gnu.org; Sat, 31 May 2014 22:24:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35741) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wquu8-0003gO-C5 for submit@debbugs.gnu.org; Sat, 31 May 2014 21:49:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wquu0-0000VN-Qh for submit@debbugs.gnu.org; Sat, 31 May 2014 21:49:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AC_HTML_NONSENSE_TAGS, BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wquu0-0000VJ-Nf for submit@debbugs.gnu.org; Sat, 31 May 2014 21:49:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wquty-0007gf-Ee for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 21:49:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wqutw-0000UE-At for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 21:49:34 -0400 Received: from mail-ob0-x22d.google.com ([2607:f8b0:4003:c01::22d]:62846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wqutw-0000U0-0r for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 21:49:32 -0400 Received: by mail-ob0-f173.google.com with SMTP id wm4so3292423obc.18 for ; Sat, 31 May 2014 18:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=P/PRmcStwyz7pCs2Pyd7GdTL+/tHbrvKOnhfuW9kcso=; b=PXBWMcKGkXW8UBsFTYMOION/csEjpdwM2HJF74V1Bm3OCAcncI+EG7XidVfRPbPgvy Juusn5jzNmioUOemQpGOGK8PxZtoPej9Zjv+2ybYUJVarIGkJUqO8X6XCMCrSwd3y5rW olsgLBF0fW/AiW2utbsXv/87RzKXpVWRl2YDI3fgBijlN0MGqVL6W0GVtjEo7Ye+jluv 2giOQW29ZJ4gu4zKsVD9PmuXwLPR/jM/FKDkMvqmonohOT9i1jMH6CN9hCGx26G/Zh3C MBzKvdrGw2r2iiX9FCFDvcF+hKBuI2svpsJezkR0E0l2q/AhZBnf5wRe09vEJI/fhNHO PRmw== X-Received: by 10.60.155.5 with SMTP id vs5mr29413069oeb.32.1401587371063; Sat, 31 May 2014 18:49:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.85.161 with HTTP; Sat, 31 May 2014 18:49:09 -0700 (PDT) From: Adam Connor Date: Sat, 31 May 2014 20:49:09 -0500 Message-ID: Subject: Python mode has odd indentation behavior To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=047d7bb048145fc06e04fabc7d0c 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: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 31 May 2014 22:24:13 -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: -3.8 (---) --047d7bb048145fc06e04fabc7d0c Content-Type: text/plain; charset=UTF-8 I've seen this most often in Django coding. Suppose the following file: ------------------------------ snip ------------------------------ from django.conf.urls import patterns, include, url from django.contrib import admin from myapp import views urlpatterns = patterns('', url(r'^$', views.index), ) ------------------------------ snip ------------------------------ When I try to change the "url..." line to ------------------------------ snip ------------------------------ url(r'^$', views.index, name="myapp_index"), ------------------------------ snip ------------------------------ the moment I type the comma, the whole line bounces way over to the left. Is this a bug? Is there a way to turn this off? It is highly distracting. (For what it is worth, I've seen the same issue in Windows Emacs.) If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /usr/share/emacs/24.3/etc/DEBUG. In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2) of 2013-07-26 on roseapple, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11405000 System Description: Linux Mint 16 Petra Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Python Minor modes in effect: shell-dirtrack-mode: t my-keys-minor-mode: t global-undo-tree-mode: t tabbar-mode: t recentf-mode: t global-linum-mode: t linum-mode: t fci-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-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: s e r e s t u r n SPC H t t p R e s p o n s e ( ' H e l l o ' ) C-x C-s C-v C-y C-y SPC SPC SPC SPC r e a l m s _ o f _ s o u r r c e r y ' C-x C-s C-h v i n d e n t - l i n e - f u n c t i o n SPC SPC SPC SPC U u r l ( ' r ' ^ $ ' , SPC v i e w s . i n d e x , SPC n a m e C-k C-k , SPC SPC SPC SPC SPC M-w C-x h M-w M-x r e p o r t - e m a c s - b u g Recent messages: Can't guess python-indent-offset, using defaults: 4 Saving file /home/adam/django_projs/ros/character/views.py... Wrote /home/adam/django_projs/ros/character/views.py scroll-up-command: End of buffer Mark set [2 times] Auto-saving...done Saving file /home/adam/django_projs/ros/ros/urls.py... Wrote /home/adam/django_projs/ros/ros/urls.py Type "q" in help window to restore its previous buffer. Auto-saving...done Load-path shadows: /home/adam/.emacs.d/elpa/python-django-20131214.1841/python-django hides ~/.emacs.d/lib/python-django /home/adam/.emacs.d/elpa/undo-tree-0.6.5/undo-tree hides ~/.emacs.d/lib/undo-tree ~/.emacs.d/elisp/virtualenv hides ~/.emacs.d/lib/virtualenv /usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup ~/.emacs.d/lib/indent hides /usr/share/emacs/24.3/lisp/indent /usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell /usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv gnus-util mm-util mail-prsvr password-cache tramp-loaddefs cl-macs gv shell pcomplete format-spec pp misearch multi-isearch python-django sql thingatpt json hippie-exp help-mode haskell-font-lock haskell-mode haskell-string haskell-sort-imports haskell-align-imports cl noutline outline flymake compile dabbrev disp-table python rx comint ring ansi-color sh-script smie executable vc-git util undo-tree diff tabbar indent revbufs recentf tree-widget wid-edit linum ido framemove advice help-fns cl-lib advice-preload fill-column-indicator easy-mmode desktop haskell-mode-autoloads edmacro kmacro info easymenu ov-autoloads finder-inf python-django-autoloads undo-tree-autoloads package misterioso-theme time-date tooltip 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 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 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 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --047d7bb048145fc06e04fabc7d0c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I've seen this most often in Django coding. Suppo= se the following file:
------------------------------ snip -------= -----------------------
from django.conf.urls import patterns, include, = url

from django.contrib import admin

from myapp import views
urlpatterns =3D patterns('',
=C2=A0=C2=A0=C2=A0 url(r'^= $', views.index),
)
------------------------------ snip ---------= ---------------------

When I try to change the "url..." line to
----------------= -------------- snip ------------------------------
=C2=A0=C2=A0=C2=A0 ur= l(r'^$', views.index, name=3D"myapp_index"),
---------= --------------------- snip ------------------------------

the moment I type the comma, the whole line bounces way over to the lef= t.

Is this a bug? Is there a way to turn this off? It is highly
d= istracting.

(For what it is worth, I've seen the same issue in W= indows Emacs.)

If Emacs crashed, and you have the Emacs process in the gdb debugger,please include the output from the following gdb commands:
=C2=A0=C2= =A0=C2=A0 `bt full' and `xbacktrace'.
For information about debu= gging Emacs, please read the file
/usr/share/emacs/24.3/etc/DEBUG.


In GNU Emacs 24.3.1 (x86_64-pc-= linux-gnu, GTK+ Version 3.8.2)
=C2=A0of 2013-07-26 on roseapple, modifie= d by Debian
Windowing system distributor `The X.Org Foundation', ver= sion 11.0.11405000
System Description:=C2=A0=C2=A0=C2=A0 Linux Mint 16 Petra

Configured= using:
=C2=A0`configure '--build' 'x86_64-linux-gnu' &#= 39;--build' 'x86_64-linux-gnu'
=C2=A0'--prefix=3D/usr= 9; '--sharedstatedir=3D/var/lib' '--libexecdir=3D/usr/lib'<= br> =C2=A0'--localstatedir=3D/var/lib' '--infodir=3D/usr/share/info= '
=C2=A0'--mandir=3D/usr/share/man' '--with-pop=3Dyes= 9;
=C2=A0'--enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/loca= l/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/em= acs/24.3/site-lisp:/usr/share/emacs/site-lisp'
=C2=A0'--with-crt-dir=3D/usr/lib/x86_64-linux-gnu' '--with-x=3D= yes'
=C2=A0'--with-x-toolkit=3Dgtk3' '--with-toolkit-scr= oll-bars'
=C2=A0'build_alias=3Dx86_64-linux-gnu' 'CFLAGS= =3D-g -O2 -fstack-protector
=C2=A0--param=3Dssp-buffer-size=3D4 -Wformat -Werror=3Dformat-security -Wal= l'
=C2=A0'LDFLAGS=3D-Wl,-Bsymbolic-functions -Wl,-z,relro'=C2=A0'CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2''

Important se= ttings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-unix
=C2=A0 default enable-multibyte-= characters: t

Major mode: Python

Minor modes in effect:
= =C2=A0 shell-dirtrack-mode: t
=C2=A0 my-keys-minor-mode: t
=C2=A0 glo= bal-undo-tree-mode: t
=C2=A0 tabbar-mode: t
=C2=A0 recentf-mode: t
=C2=A0 global-linum-mode= : t
=C2=A0 linum-mode: t
=C2=A0 fci-mode: t
=C2=A0 desktop-save-mo= de: t
=C2=A0 tooltip-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 men= u-bar-mode: 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-encryptio= n-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: t<= br>=C2=A0 transient-mark-mode: t

Recent input:
s e <down> <down-mouse-1> <mouse-moveme= nt> <mouse-1>
r e s <backspace> t u r n SPC H t t p R e = s p o n s
e ( ' H e l l o ' ) C-x C-s <help-echo> <hel= p-echo>
<down-mouse-1> <mouse-1> <help-echo> <help-echo> &l= t;down-mouse-1>
<mouse-1> <return> C-v C-y <help-echo= > <help-echo>
<down-mouse-1> <mouse-1> <return&= gt; C-y <home> SPC SPC
SPC SPC <down-mouse-1> <mouse-movement> <mouse-1> <bac= kspace>
<backspace> <backspace> <backspace> <ba= ckspace> <backspace>
<backspace> <backspace> <b= ackspace> <right> <down-mouse-1>
<mouse-1> <backspace> <backspace> <backspace> <b= ackspace>
<backspace> <backspace> <backspace> <= backspace> <backspace>
<backspace> <backspace> <= ;backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> r e a l m s _ o
f= _ s o u r <backspace> <backspace> r c e r y ' <home>=
<kp-delete> <kp-delete> <kp-delete> <kp-delete>= ; <kp-delete>
<kp-delete> <kp-delete> <kp-delete> <kp-delete> <= ;kp-delete>
<kp-delete> <kp-delete> <kp-delete> &l= t;kp-delete> <kp-delete>
<kp-delete> <kp-delete> &= lt;kp-delete> <kp-delete> C-x
C-s <help-echo> <help-echo> C-h v i n d e n t - l i
n e - f= u n c t i o n <return> <help-echo> <help-echo>
<d= own-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> <do= wn-mouse-1>
<mouse-1> <return> SPC SPC SPC SPC U <backspace> u
r = l ( ' <backspace> r ' ^ $ ' , SPC v i e w s . i n
d e= x , SPC n a m e <backspace> <home> C-k C-k <down-mouse-1>= ;
<mouse-1> <backspace> <backspace> <backspace> <b= ackspace>
<backspace> <backspace> <backspace> <= backspace> <backspace>
<backspace> <backspace> <= ;backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <= ;backspace>
<backspace> <backspace> <backspace> &l= t;backspace> <backspace>
, SPC <backspace> <backspace= > <home> <kp-delete> <kp-delete>
<kp-delete> <kp-delete> <kp-delete> <kp-delete> <= ;kp-delete>
<kp-delete> <kp-delete> <kp-delete> &l= t;kp-delete> <kp-delete>
<kp-delete> <kp-delete> &= lt;kp-delete> <kp-delete> <kp-delete>
<kp-delete> <kp-delete> <kp-delete> <kp-delete> <= ;kp-delete>
<kp-delete> SPC SPC SPC SPC <down-mouse-1> &= lt;mouse-movement>
<mouse-movement> <drag-mouse-1> M-w &= lt;help-echo> <help-echo>
C-x h M-w <help-echo> <help-echo> <help-echo> <help-ec= ho>
M-x r e p o r t - e m a c s - b u g <return>

Recent= messages:
Can't guess python-indent-offset, using defaults: 4
Saving file /home/adam/django_projs/ros/character/views.py...
Wrote /hom= e/adam/django_projs/ros/character/views.py
scroll-up-command: End of buf= fer
Mark set [2 times]
Auto-saving...done
Saving file /home/adam/d= jango_projs/ros/ros/urls.py...
Wrote /home/adam/django_projs/ros/ros/urls.py
Type "q" in help= window to restore its previous buffer.
Auto-saving...done

Load-p= ath shadows:
/home/adam/.emacs.d/elpa/python-django-20131214.1841/python= -django hides ~/.emacs.d/lib/python-django
/home/adam/.emacs.d/elpa/undo-tree-0.6.5/undo-tree hides ~/.emacs.d/lib/und= o-tree
~/.emacs.d/elisp/virtualenv hides ~/.emacs.d/lib/virtualenv
/u= sr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-li= sp/debian-startup
~/.emacs.d/lib/indent hides /usr/share/emacs/24.3/lisp/indent
/usr/share= /emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/l= isp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/fl= yspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec= mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils m= ailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache tra= mp
tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv
gnus= -util mm-util mail-prsvr password-cache tramp-loaddefs cl-macs gv
shell = pcomplete format-spec pp misearch multi-isearch python-django sql
thinga= tpt json hippie-exp help-mode haskell-font-lock haskell-mode
haskell-string haskell-sort-imports haskell-align-imports cl noutline
ou= tline flymake compile dabbrev disp-table python rx comint ring
ansi-colo= r sh-script smie executable vc-git util undo-tree diff tabbar
indent rev= bufs recentf tree-widget wid-edit linum ido framemove advice
help-fns cl-lib advice-preload fill-column-indicator easy-mmode desktop
= haskell-mode-autoloads edmacro kmacro info easymenu ov-autoloads
finder-= inf python-django-autoloads undo-tree-autoloads package
misterioso-theme= time-date tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulate= d-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer sel= ect 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
eur= opean ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook= help simple abbrev minibuffer loaddefs button faces
cus-face macroexp f= iles text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
mak= e-network-process dbusbind dynamic-setting system-font-setting
font-rend= er-setting move-toolbar gtk x-toolkit x multi-tty emacs)

--047d7bb048145fc06e04fabc7d0c-- ------------=_1404187263-20943-1--