title: emacs 24.5 python-mode (stock version Vs 6.2.1)
body: <p>I have discovered an issue with python-mode in emacs. I generally c++ develop and seldom do python.</p>
  
  <p>I have recently discovered this issue:</p>
  
  <p>I emacs –Q</p>
  
  <p>I open a python file </p>
  
  <p>It contains:</p>
  
  <pre><code>import re as myre
  
  Var = [
  %
  </code></pre>
  
  <p>The % represents the cursor location. Then, at that location I try to tab and get this error:</p>
  
  <p><code>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)</code></p>
  
  <p>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, python 2.7.3 and – of course - -Q so no configuration.</p>
  
  <p>Now, I try to apply python-mode 6.2.1 by running this</p>
  
  <p>Emacs –Q
  In <em>scratch</em>
  (setq load-path (append load-path (list "~/.emacs.d/python-mode.el-6.2.1")))
  (require 'python-mode)</p>
  
  <p>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 (it is now bland and variable are just the same colour as other text, rather than standing out. Also which-function-mode seems to be broke (again) and developing in python is sluggish (when you open a large file) - I remember python-mode and which-function-mode not being friendly with each other in 24.3, but it was solved with STOCK el 24.5</p>
  
  <p>For me, unfortunately, 6.2.1 solves one issue but creates others - INCLUDING regressions.</p>
  
  <p>If, instead, I can just have the patch that solves the indentation issue, that would be great.</p>
  
  <p>Thank you.</p>