diff options
author | Barry Warsaw <barry@python.org> | 1998-08-10 21:44:37 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1998-08-10 21:44:37 (GMT) |
commit | 12c9294ea395100ca24ba90af2798e8b7ca968b5 (patch) | |
tree | 9eaa91edb0a5b83e96d748c229a0aab00d68ca3c /Misc | |
parent | 3da987c292eded268bd06d70d892930796898d61 (diff) | |
download | cpython-12c9294ea395100ca24ba90af2798e8b7ca968b5.zip cpython-12c9294ea395100ca24ba90af2798e8b7ca968b5.tar.gz cpython-12c9294ea395100ca24ba90af2798e8b7ca968b5.tar.bz2 |
(py-compute-indentation): Changes to the `t' condition which affect
indetnation of normal statements: The regular expression that searches
for indenting comment lines has been changed to not require a
space/tab after the first `#'. We then explicitly look for
py-block-comment-prefix depending on the value of
py-honor-comment-indentation.
I think this more accurately reflects the documentation for
py-honor-comment-indentation.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/python-mode.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el index 9d42b0c..7c02026 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -305,9 +305,9 @@ the Emacs bell is also rung as a warning." (defcustom py-jump-on-exception t "*Jump to innermost exception frame in *Python Output* buffer. -When this variable is non-nil and ane exception occurs when running +When this variable is non-nil and an exception occurs when running Python code synchronously in a subprocess, jump immediately to the -source code of the innermost frame." +source code of the innermost traceback frame." :type 'boolean :group 'python) @@ -1506,7 +1506,7 @@ subtleties, including the use of the optional ASYNC argument." (message "Jumping to exception in file %s on line %d" file line))) (defun py-mouseto-exception (event) - "Jump to the code which cased the Python exception at EVENT. + "Jump to the code which caused the Python exception at EVENT. EVENT is usually a mouse click." (interactive "e") (cond @@ -1841,12 +1841,18 @@ dedenting." (forward-comment (- (point-max))) (let (done) (while (not done) - (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)" - nil 'move) - (setq done (or (eq py-honor-comment-indentation t) - (bobp) - (/= (following-char) ?#) - (not (zerop (current-column))))) + (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#\\)" nil 'move) + (setq done (or (bobp) + (and (eq py-honor-comment-indentation t) + (save-excursion + (back-to-indentation) + (not (looking-at py-block-comment-prefix)) + )) + (and (not (eq py-honor-comment-indentation t)) + (save-excursion + (back-to-indentation) + (not (zerop (current-column))))) + )) ))) ;; if we landed inside a string, go to the beginning of that ;; string. this handles triple quoted, multi-line spanning |