unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jude DaShiell <jdashiel@panix.com>
To: rjd <ryan.dixon@etas.com>, help-gnu-emacs@gnu.org
Subject: Re: pYthon indentation
Date: Thu, 22 Oct 2015 11:50:35 -0400 (EDT)	[thread overview]
Message-ID: <alpine.NEB.2.11.1510221147100.3857@panix1.panix.com> (raw)
In-Reply-To: <loom.20151022T162351-647@post.gmane.org>

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 <ryan.dixon@etas.com>
> 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.

-- 




  reply	other threads:[~2015-10-22 15:50 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 [this message]
2015-10-22 16:04   ` rjd
2015-10-22 16:20 ` Nick Dokos
2015-10-26 11:52   ` rjd
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.NEB.2.11.1510221147100.3857@panix1.panix.com \
    --to=jdashiel@panix.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ryan.dixon@etas.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).