help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pYthon indentation


From: rjd
Subject: Re: pYthon indentation
Date: Thu, 22 Oct 2015 16:04:40 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jude DaShiell <jdashiel <at> panix.com> writes:

> 
> I don't know much python yet but have used python-mode to code in 
> python2.  When I write something for python a.k.a. python3 though the 
> indents are each 2 spaces.  A tab character doesn't work by itself.  For 
> that reason python-mode may need reconfiguration to tell it each indent 
> is two spaces.  I don't know that using the tab key with python-mode can 
> be caused to produce two spaced indents but if so that should solve your 
> problem.
> 


I never use tab characters in python-mode. I have it set so that TAB will
really insert 4 spaces since those are our coding guidelines. This must be
some sort of bug (I have posted at stackoverflow too:
http://stackoverflow.com/questions/33283860/emacs-24-5-python-mode-stock-version-vs-6-2-1
since I was having a hard time posting on gmane).

Thank you for your response.

When I load python-mode from 6.2.1 indentation works, but 6.2.1 IMO contains
regressions that I just do not want. I was thinking about just hacking my
own indentation function - easy when you are indenting from col 0, but there
is complexity when dealing with non col 0 and auto indentation.

Here is my snippet of .emacs:

(c-set-offset 'inline-open '0) ; This one because of indentation INSIDE
class def
(setq-default indent-tabs-mode nil)
(setq-default tab-width 3)
(setq indent-line-function 'insert-tab)
(setq-default c-basic-offset 3)
(setq-default sh-basic-offset 4)
(setq-default sh-indentation 4)
(setq-default python-indent-offset 4)
(setq-default c-default-style "linux")
(setq c-default-style
      '((java-mode . "java")
        (awk-mode . "awk")
        (other . "linux")))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]