Subject: bug#21762: 24.5; python.el indentation error

From: Juanma Barranquero <[email-masked]>
Date: Wed, 28 Oct 2015 11:56:59 +0100

On Mon, Oct 26, 2015 at 1:00 PM, Dixon Ryan (ETAS/ERS-PD2) <
[email-masked]> wrote:

> import re as myre
> var = [
> %
>
> vii. I then press TAB and get the minibuffer message: Wrong type
argument: number-or-marker-p, nil

Yes, reproducible in 25.0.50. `python-syntax-closing-paren-p' needs to
cater for the case that there is no syntax after point...

Perhaps something like this. Fabian?

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 6ff12b5..96342e5 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -490,8 +490,8 @@ python-syntax-comment-or-string-p

 (defsubst python-syntax-closing-paren-p ()
   "Return non-nil if char after point is a closing paren."
-  (= (syntax-class (syntax-after (point)))
-     (syntax-class (string-to-syntax ")"))))
+  (equal (syntax-class (syntax-after (point)))
+      (syntax-class (string-to-syntax ")"))))

 (define-obsolete-function-alias
   'python-info-ppss-context #'python-syntax-context "24.3")