all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: rjd <ryan.dixon@etas.com>
To: help-gnu-emacs@gnu.org
Subject: Re: pYthon indentation
Date: Mon, 26 Oct 2015 11:52:21 +0000 (UTC)	[thread overview]
Message-ID: <loom.20151026T124927-994@post.gmane.org> (raw)
In-Reply-To: 871tcman8r.fsf@alphaville.usersys.redhat.com

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)




  reply	other threads:[~2015-10-26 11:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 14:24 pYthon indentation rjd
2015-10-22 15:50 ` Jude DaShiell
2015-10-22 16:04   ` rjd
2015-10-22 16:20 ` Nick Dokos
2015-10-26 11:52   ` rjd [this message]
2015-10-22 17:24 ` Andreas Röhler
2015-10-26 11:05   ` rjd

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=loom.20151026T124927-994@post.gmane.org \
    --to=ryan.dixon@etas.com \
    --cc=help-gnu-emacs@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.