[Python-mode] Error during indentation

Andrea Crotti andrea.crotti.0 at gmail.com
Sun Mar 13 12:49:44 CET 2011


I get a strange error when I have a situation like this:
--8<---------------cut here---------------start------------->8---
     1	class Foo(object):
     2	    """
     3	    Some doc
     4	    """
     5	
--8<---------------cut here---------------end--------------->8---
if I go to line 5 and press tab I get the error as below, using:
GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of
2011-03-04
and python-mode from bzr (can I get automatically the revision from emacs?)

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument integerp t)
  make-string(1 t)
  py-goto-beginning-of-tqs(t)
  py-compute-indentation(t)
  py-indent-line()
  indent-for-tab-command(nil)
  call-interactively(indent-for-tab-command)
  (progn (setq this-command command) (call-interactively command))
  (if (and (commandp command) (not (string-match "yas/expand" (symbol-name command)))) (progn (setq this-command command) (call-interactively command)))
  (when (and (commandp command) (not (string-match "yas/expand" (symbol-name command)))) (setq this-command command) (call-interactively command))
  (let* ((yas/minor-mode nil) (yas/direct-keymaps nil) (keys-1 (this-command-keys-vector)) (keys-2 (and yas/trigger-key from-trigger-key-p (stringp yas/trigger-key) (read-kbd-macro yas/trigger-key))) (command-1 (and keys-1 (key-binding keys-1))) (command-2 (and keys-2 (key-binding keys-2))) (command (or (and (symbolp command-1) (not (string-match "yas/expand" (symbol-name command-1))) command-1) (and (symbolp command-2) command-2)))) (when (and (commandp command) (not (string-match "yas/expand" (symbol-name command)))) (setq this-command command) (call-interactively command)))
  (cond ((eq yas/fallback-behavior (quote return-nil)) nil) ((eq yas/fallback-behavior (quote call-other-command)) (let* ((yas/minor-mode nil) (yas/direct-keymaps nil) (keys-1 (this-command-keys-vector)) (keys-2 (and yas/trigger-key from-trigger-key-p (stringp yas/trigger-key) (read-kbd-macro yas/trigger-key))) (command-1 (and keys-1 (key-binding keys-1))) (command-2 (and keys-2 (key-binding keys-2))) (command (or (and (symbolp command-1) (not ...) command-1) (and (symbolp command-2) command-2)))) (when (and (commandp command) (not (string-match "yas/expand" (symbol-name command)))) (setq this-command command) (call-interactively command)))) ((and (listp yas/fallback-behavior) (cdr yas/fallback-behavior) (eq (quote apply) (car yas/fallback-behavior))) (if (cddr yas/fallback-behavior) (apply (cadr yas/fallback-behavior) (cddr yas/fallback-behavior)) (when (commandp (cadr yas/fallback-behavior)) (setq this-command (cadr yas/fallback-behavior)) (call-interactively (cadr yas/fallback-behavior))))) (t nil))
  yas/fallback(trigger-key)
  (if (and templates-and-pos (first templates-and-pos)) (yas/expand-or-prompt-for-template (first templates-and-pos) (second templates-and-pos) (third templates-and-pos)) (yas/fallback (quote trigger-key)))
  (let (templates-and-pos) (unless (and yas/expand-only-for-last-commands (not (member last-command yas/expand-only-for-last-commands))) (setq templates-and-pos (if field (save-restriction (narrow-to-region (yas/field-start field) (yas/field-end field)) (yas/current-key)) (yas/current-key)))) (if (and templates-and-pos (first templates-and-pos)) (yas/expand-or-prompt-for-template (first templates-and-pos) (second templates-and-pos) (third templates-and-pos)) (yas/fallback (quote trigger-key))))
  yas/expand()
  call-interactively(yas/expand nil nil)

--8<---------------cut here---------------end--------------->8---


More information about the Python-mode mailing list