[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115477: * lisp/progmodes/python.el (python-indent-c
From: |
Fabián Ezequiel Gallina |
Subject: |
[Emacs-diffs] trunk r115477: * lisp/progmodes/python.el (python-indent-calculate-indentation): When |
Date: |
Thu, 12 Dec 2013 03:48:07 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115477
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15812
author: Nathan Trapuzzano <address@hidden>
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: trunk
timestamp: Thu 2013-12-12 00:47:41 -0300
message:
* lisp/progmodes/python.el (python-indent-calculate-indentation): When
determining indentation, don't treat "return", "pass", etc., as
operators when they are just string constituents.
* automated/python-test.el (python-indent-block-enders-1): Rename
from python-indent-block-enders.
(python-indent-block-enders-2): New test.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/progmodes/python.el python.el-20091113204419-o5vbwnq5f7feedwu-3008
test/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-8588
test/automated/python-tests.el
pythontests.el-20130220195218-kqcioz3fssz9hwe1-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-12-12 00:42:16 +0000
+++ b/lisp/ChangeLog 2013-12-12 03:47:41 +0000
@@ -1,3 +1,9 @@
+2013-12-12 Nathan Trapuzzano <address@hidden>
+
+ * progmodes/python.el (python-indent-calculate-indentation): When
+ determining indentation, don't treat "return", "pass", etc., as
+ operators when they are just string constituents. (Bug#15812)
+
2013-12-12 Juri Linkov <address@hidden>
* uniquify.el (uniquify-buffer-name-style): Change default to
=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el 2013-11-29 02:03:39 +0000
+++ b/lisp/progmodes/python.el 2013-12-12 03:47:41 +0000
@@ -774,7 +774,7 @@
(save-excursion
(python-util-forward-comment -1)
(python-nav-beginning-of-statement)
- (member (current-word) python-indent-block-enders)))
+ (looking-at (regexp-opt python-indent-block-enders))))
python-indent-offset
0)))
;; When inside of a string, do nothing. just use the current
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog 2013-12-08 16:11:08 +0000
+++ b/test/ChangeLog 2013-12-12 03:47:41 +0000
@@ -1,3 +1,9 @@
+2013-12-12 Nathan Trapuzzano <address@hidden>
+
+ * automated/python-test.el (python-indent-block-enders-1): Rename
+ from python-indent-block-enders.
+ (python-indent-block-enders-2): New test.
+
2013-12-08 Dmitry Gutov <address@hidden>
* indent/js.js: New file.
=== modified file 'test/automated/python-tests.el'
--- a/test/automated/python-tests.el 2013-11-23 20:46:43 +0000
+++ b/test/automated/python-tests.el 2013-12-12 03:47:41 +0000
@@ -447,7 +447,7 @@
(should (eq (car (python-indent-context)) 'after-line))
(should (= (python-indent-calculate-indentation) 0))))
-(ert-deftest python-indent-block-enders ()
+(ert-deftest python-indent-block-enders-1 ()
"Test `python-indent-block-enders' value honoring."
(python-tests-with-temp-buffer
"
@@ -469,6 +469,27 @@
(forward-line 1)
(should (= (python-indent-calculate-indentation) 8))))
+(ert-deftest python-indent-block-enders-2 ()
+ "Test `python-indent-block-enders' value honoring."
+ (python-tests-with-temp-buffer
+ "
+Class foo(object):
+ '''raise lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+
+ eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ '''
+ def bar(self):
+ \"return (1, 2, 3).\"
+ if self.baz:
+ return (1,
+ 2,
+ 3)
+"
+ (python-tests-look-at "def")
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "if")
+ (should (= (python-indent-calculate-indentation) 8))))
+
;;; Navigation
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115477: * lisp/progmodes/python.el (python-indent-calculate-indentation): When,
Fabián Ezequiel Gallina <=