From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rjd Newsgroups: gmane.emacs.help Subject: Re: pYthon indentation Date: Thu, 22 Oct 2015 16:04:40 +0000 (UTC) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1445529958 14044 80.91.229.3 (22 Oct 2015 16:05:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 16:05:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 22 18:05:37 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZpIMw-0000pZ-7f for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 18:05:34 +0200 Original-Received: from localhost ([::1]:32809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpIMv-0006B6-G7 for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 12:05:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpIMi-0006B1-5s for help-gnu-emacs@gnu.org; Thu, 22 Oct 2015 12:05:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpIMe-0004NW-Vu for help-gnu-emacs@gnu.org; Thu, 22 Oct 2015 12:05:20 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpIMe-0004NN-Oy for help-gnu-emacs@gnu.org; Thu, 22 Oct 2015 12:05:16 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZpIMP-0000FD-UR for help-gnu-emacs@gnu.org; Thu, 22 Oct 2015 18:05:01 +0200 Original-Received: from http-v.fe.bosch.de ([194.39.218.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Oct 2015 18:05:01 +0200 Original-Received: from ryan.dixon by http-v.fe.bosch.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Oct 2015 18:05:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 194.39.218.10 (Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107783 Archived-At: Jude DaShiell 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")))