diff Misc/python-mode.el @ 3426:6402be2689c5 legacy-trunk

(py-compute-indentation): fix skipping backwards over comments by using forward-comment (and Emacs 19 function) if available.
author Barry Warsaw <barry@python.org>
date Mon, 04 Mar 1996 17:15:40 +0000
parents efdde1d7424b
children af5ff5231d4a
line wrap: on
line diff
--- a/Misc/python-mode.el	Thu Feb 29 16:11:32 1996 +0000
+++ b/Misc/python-mode.el	Mon Mar 04 17:15:40 1996 +0000
@@ -895,8 +895,11 @@
        (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.