From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jude DaShiell Newsgroups: gmane.emacs.help Subject: Re: pYthon indentation Date: Thu, 22 Oct 2015 11:50:35 -0400 (EDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: ger.gmane.org 1445529090 29115 80.91.229.3 (22 Oct 2015 15:51:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 15:51:30 +0000 (UTC) To: rjd , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 22 17:51:19 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 1ZpI97-0001tV-1C for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 17:51:17 +0200 Original-Received: from localhost ([::1]:60827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpI96-0002PL-F9 for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 11:51:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpI8W-0001tg-Vt for help-gnu-emacs@gnu.org; Thu, 22 Oct 2015 11:50:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpI8S-0007UV-D6 for help-gnu-emacs@gnu.org; Thu, 22 Oct 2015 11:50:40 -0400 Original-Received: from mailbackend.panix.com ([166.84.1.89]:45042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpI8S-0007UR-7k for help-gnu-emacs@gnu.org; Thu, 22 Oct 2015 11:50:36 -0400 Original-Received: from panix1.panix.com (panix1.panix.com [166.84.1.1]) by mailbackend.panix.com (Postfix) with ESMTP id A96D7170FC; Thu, 22 Oct 2015 11:50:35 -0400 (EDT) Original-Received: by panix1.panix.com (Postfix, from userid 20712) id 96CD214B9A; Thu, 22 Oct 2015 11:50:35 -0400 (EDT) Original-Received: from localhost (localhost [127.0.0.1]) by panix1.panix.com (Postfix) with ESMTP id 9636914B7F; Thu, 22 Oct 2015 11:50:35 -0400 (EDT) In-Reply-To: User-Agent: Alpine 2.11 (NEB 23 2013-08-11) X-detected-operating-system: by eggs.gnu.org: GNU/Linux (Android) X-Received-From: 166.84.1.89 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:107781 Archived-At: 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. On Thu, 22 Oct 2015, rjd wrote: > Date: Thu, 22 Oct 2015 10:24:10 > From: rjd > To: help-gnu-emacs@gnu.org > Subject: pYthon indentation > > I have discovered an issue with python-mode in emacs. I generally c++ > develop and seldom do python (I have to say that I am not much of a fan, but > our testing framework uses it). > > I have recently discovered this issue: > > I emacs ?Q > > I open a python file > > It contains: > > Import re as myre > > Var = [ > % > > The % represents the cursor location. Then, at that location I try to tab > and get this error: > > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) > python-indent-context() > python-indent--calculate-indentation() > python-indent-calculate-indentation(nil) > python-indent-line(nil) > python-indent-line-function() > indent-for-tab-command(nil) > call-interactively(indent-for-tab-command nil nil) > command-execute(indent-for-tab-command) > > > I have not developed in python for a month or so but I cannot remember this > being an issue. > I am using emacs 24.5.1 windows 7 64 (unfortunately) and ? of course - -Q so > no configuration. > > Now, I try to apply python-mode 6.2.1 by running this > > Emacs ?Q > In *scratch* > (setq load-path (append load-path (list "~/.emacs.d/python-mode.el-6.2.1"))) > (require 'python-mode) > > I open up a python file (the same as above) then I CAN indent. This is all > well and good, so if I load python-mode 6.2.1 el file in my NORMAL > configuration this solve the issue, BUT now with the new 6.2.1 I do not get > the same theme coloring as before, which-function-mode seems to be broke > (again) and developing in python is sluggish. > > For me, unfortunately, 6.2.1 solves one issue but creates others. > > If, instead, I can just have the patch that solves the indentation issue, > that would be great. > > Thank you. --