all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: 17658@debbugs.gnu.org
Subject: bug#17658: Python mode has odd indentation behavior
Date: Sun, 01 Jun 2014 17:32:02 +0200	[thread overview]
Message-ID: <538B4772.2010109@easy-emacs.de> (raw)
In-Reply-To: <jwvlhthice2.fsf-monnier+emacsbugs@gnu.org>

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-+ <help-echo> <help-echo> <help-echo> <help-echo>
<backspace> , C-x 1 <next> <prior> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <left> C-SPC
M-f M-f M-f M-w <help-echo> <help-echo> <left> C-h
v <return> C-x 1 <next> <prior> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <left> <help-echo>
<help-echo> <help-echo> M-+ C-x b <return> <backspace>
<help-echo> <help-echo> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
, <backspace> C-x b <return> M-x e d e b C-g M-x e
x i t - r <tab> <return> q <left> <left> <up> <up>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <down> <right> <right> <right>
<right> <right> <tab> <tab> <tab> <tab> <tab> <tab>
<tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab>
<tab> <tab> <tab> <tab> <tab> c o u q C-_ M-x c l u
<tab> <backspace> <backspace> o l u <tab> <return>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> , 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 <help-echo> M-x
e <backspace> r e p o r t - e m <tab> <return>

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






  reply	other threads:[~2014-06-01 15:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-01  1:49 bug#17658: Python mode has odd indentation behavior Adam Connor
2014-06-01  2:47 ` Stefan Monnier
2014-06-01 15:32   ` Andreas Röhler [this message]
2014-06-01 21:18     ` Stefan Monnier
2014-06-02  6:19       ` Andreas Röhler
2014-06-02 13:36         ` Stefan Monnier
2014-06-02 16:05           ` Andreas Röhler
2014-07-01  2:33 ` Fabián Ezequiel Gallina
2014-07-01  4:00 ` Fabián Ezequiel Gallina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=538B4772.2010109@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=17658@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

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