]> granicus.if.org Git - python/commitdiff
(py-compute-indentation): fix skipping backwards over comments by
authorBarry Warsaw <barry@python.org>
Mon, 4 Mar 1996 17:15:40 +0000 (17:15 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 4 Mar 1996 17:15:40 +0000 (17:15 +0000)
using forward-comment (and Emacs 19 function) if available.

Misc/python-mode.el

index 9d5f514b7efe67bfc09f349cb6817d073fa615ce..3dd533b3e6bd77dd601644d754a547bb1186a547 100644 (file)
@@ -895,8 +895,11 @@ the new line indented."
        (t
        ;; skip back over blank & non-indenting comment lines note:
        ;; will skip a blank or non-indenting comment line that
-       ;; happens to be a continuation line too
-       (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)" nil 'move)
+       ;; happens to be a continuation line too.  use fast Emacs 19
+       ;; function if it's there.
+       (if (fboundp 'forward-comment)
+           (forward-comment (- (point-max)))
+         (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)" nil 'move))
        ;; if we landed inside a string, go to the beginning of that
        ;; string. this handles triple quoted, multi-line spanning
        ;; strings.