[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pYthon indentation
From: |
rjd |
Subject: |
Re: pYthon indentation |
Date: |
Mon, 26 Oct 2015 11:52:21 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Nick Dokos <ndokos <at> gmail.com> writes:
> There are two competing python modes for emacs, python-mode.el (which is
> what you are talking about IIUC) and python.el which comes with the
> emacs distro. I was using python-mode.el for a while and I always seemed
> to have small annoyances crop up at a regular rate (although I must
> admit, I never did much to improve the situation: they usually cropped
> up when I was under time pressure, so I would just bulldoze my way
> through - by the time I *could* do something about it, I had forgotten
> what the annoyance was - until the next time something bit me...)
>
> So at some point, I chucked it and started using the built-in python.el.
> I'm sure it too has its share of faults, but so far at least (I've been
> using it for the past year or so), I don't remember being really annoyed
> with it, so I'm sticking with it.
>
> My 2 cents and of course, YMMV.
> --
> Nick
>
>
This was the confusion. The error I am talking about is clearly with
python.el. I have never used python-mode.el until trying to solve this
indentation issue.
The steps to reproduce on Windows 7 (64bit):
i. I downloaded
http://ftp.gnu.org/gnu/emacs/windows/emacs-24.5-bin-i686-mingw32.zip.
ii. I extracted zip file to temp folder; completely unmodified.
iii. I opened an MSYS shell and cd'd into the temp/bin folder.
iv. I ran ./emacs.exe -Q.
v. I C-x C-f and call the new file temp.py
vi. I type the following up UNTIL % - which represents the cursor position:
import re as myre
var = [
%
vii. I then press TAB and get the following message in the mini buffer:
python-indent--calculate-indentation: Wrong type argument:
number-or-marker-p, nil
viii. The debug information shows:
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)