Mailing List Archive

python/dist/src/Misc python-mode.el,4.15,4.16
Update of /cvsroot/python/python/dist/src/Misc
In directory usw-pr-cvs1:/tmp/cvs-serv29578

Modified Files:
python-mode.el
Log Message:
(py-execute-region): Alexander Schmolck points out that leading
whitespace can hose the needs-if test. So just skip all blank lines
at the start of the region right off the bat.


Index: python-mode.el
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/python-mode.el,v
retrieving revision 4.15
retrieving revision 4.16
diff -C2 -d -r4.15 -r4.16
*** python-mode.el 25 Apr 2002 16:26:38 -0000 4.15
--- python-mode.el 25 Apr 2002 19:17:42 -0000 4.16
***************
*** 1379,1382 ****
--- 1379,1389 ----
is inserted at the end. See also the command `py-clear-queue'."
(interactive "r\nP")
+ ;; Skip ahead to the first non-blank line
+ (goto-char start)
+ (beginning-of-line)
+ (while (and (looking-at "\\s *$")
+ (< (point) end))
+ (forward-line 1))
+ (setq start (point))
(or (< start end)
(error "Region is empty"))