emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 590a820: Fix bug#21762


From: Juanma Barranquero
Subject: [Emacs-diffs] master 590a820: Fix bug#21762
Date: Sun, 01 Nov 2015 01:56:29 +0000

branch: master
commit 590a820fd9a7a0ab92b4b2927d4ca4a3582af528
Author: Juanma Barranquero <address@hidden>
Commit: Juanma Barranquero <address@hidden>

    Fix bug#21762
    
    * lisp/progmodes/python.el (python-syntax-closing-paren-p): Check with
    `eql' instead of `=' to accommodate the case that (syntax-after (point))
    returns nil.
    
    * test/automated/python-tests.el (python-indent-inside-paren-7):
    New test.
---
 lisp/progmodes/python.el       |    4 ++--
 test/automated/python-tests.el |    8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 6ff12b5..b6f7da6 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -490,8 +490,8 @@ The type returned can be `comment', `string' or `paren'."
 
 (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 ")"))))
+  (eql (syntax-class (syntax-after (point)))
+       (syntax-class (string-to-syntax ")"))))
 
 (define-obsolete-function-alias
   'python-info-ppss-context #'python-syntax-context "24.3")
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index f930ffb..9da6807 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -563,6 +563,14 @@ CHOICES = (('some', 'choice'),
    (should (eq (car (python-indent-context)) :inside-paren))
    (should (= (python-indent-calculate-indentation) 11))))
 
+(ert-deftest python-indent-inside-paren-7 ()
+  "Test for Bug#21762."
+  (python-tests-with-temp-buffer
+   "import re as myre\nvar = [\n"
+   (goto-char (point-max))
+   ;; This signals an error if the test fails
+   (should (eq (car (python-indent-context)) :inside-paren-newline-start))))
+
 (ert-deftest python-indent-after-block-1 ()
   "The most simple after-block case that shouldn't fail."
   (python-tests-with-temp-buffer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]