CVS update by aroehler packages/xemacs-packages/python-modes ...

[email protected] 28 Sep 2009 10:44:11 -0000
Newsgroups gmane.emacs.xemacs.cvs
Message-ID <[email protected]>
  User: aroehler
  Date: 09/09/28 12:44:11

  Modified:    packages/xemacs-packages/python-modes python-mode.el
Log:
patch attached fixes

https://bugs.launchpad.net/python-mode/+bug/350467

in python-mode.el

=== modified file 'python-mode.el'
--- python-mode.el	2009-03-20 01:37:21 +0000
+++ python-mode.el	2009-05-20 09:03:25 +0000
@@ -2153,7 +2153,9 @@
             ;; that happens to be a continuation line too
             (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)" nil 'move)
             (back-to-indentation)
-            (current-column))))
+            (if (py-statement-opens-block-p)
+                (+ (current-column) py-indent-offset)
+              (current-column)))))
        ;; are we on a continuation line?
        ((py-continuation-line-p)
         (let ((startpos (point))

Bug Description

Using the word "class" as the first word of a line in a """...""" comment affects indenting of CODE.

    def f():
        """
        class blah blah
        """
        if a:
        hi <<<<<<< NOTE problem!

    def f():
        """
        a class blah blah
        """
        if a:
            hi <<<<<<<<< OK!

Revision  Changes    Path
4.55      +3 -1      XEmacs/packages/xemacs-packages/python-modes/python-mode.el

Index: python-mode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/python-modes/python-mode.el,v
retrieving revision 4.54
retrieving revision 4.55
diff -u -p -r4.54 -r4.55
--- python-mode.el	2008/11/28 22:30:37	4.54
+++ python-mode.el	2009/09/28 10:44:10	4.55
@@ -2144,7 +2144,9 @@ dedenting."
             ;; that happens to be a continuation line too
             (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)" nil 'move)
             (back-to-indentation)
-            (current-column))))
+            (if (py-statement-opens-block-p)
+                (+ (current-column) py-indent-offset)
+              (current-column)))))
        ;; are we on a continuation line?
        ((py-continuation-line-p)
         (let ((startpos (point))