(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.
This commit is contained in:
Barry Warsaw 1998-08-10 21:44:37 +00:00
parent 3da987c292
commit 12c9294ea3

View file

@ -305,9 +305,9 @@ the Emacs bell is also rung as a warning."
(defcustom py-jump-on-exception t (defcustom py-jump-on-exception t
"*Jump to innermost exception frame in *Python Output* buffer. "*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 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 :type 'boolean
:group 'python) :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))) (message "Jumping to exception in file %s on line %d" file line)))
(defun py-mouseto-exception (event) (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." EVENT is usually a mouse click."
(interactive "e") (interactive "e")
(cond (cond
@ -1841,12 +1841,18 @@ dedenting."
(forward-comment (- (point-max))) (forward-comment (- (point-max)))
(let (done) (let (done)
(while (not done) (while (not done)
(re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)" (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#\\)" nil 'move)
nil 'move) (setq done (or (bobp)
(setq done (or (eq py-honor-comment-indentation t) (and (eq py-honor-comment-indentation t)
(bobp) (save-excursion
(/= (following-char) ?#) (back-to-indentation)
(not (zerop (current-column))))) (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 ;; if we landed inside a string, go to the beginning of that
;; string. this handles triple quoted, multi-line spanning ;; string. this handles triple quoted, multi-line spanning