[Python-checkins] python/dist/src/Misc python-mode.el,4.20,4.21

bwarsaw@sourceforge.net bwarsaw@sourceforge.net
Sun, 12 May 2002 10:37:50 -0700


Update of /cvsroot/python/python/dist/src/Misc
In directory usw-pr-cvs1:/tmp/cvs-serv3313

Modified Files:
	python-mode.el 
Log Message:
(py-execute-region): Do the blank line skipping inside the
save-excursion so that when the function is complete, point is
preserved.


Index: python-mode.el
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/python-mode.el,v
retrieving revision 4.20
retrieving revision 4.21
diff -C2 -d -r4.20 -r4.21
*** python-mode.el	30 Apr 2002 18:58:52 -0000	4.20
--- python-mode.el	12 May 2002 17:37:46 -0000	4.21
***************
*** 1496,1507 ****
    (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"))
    (let* ((proc (get-process py-which-bufname))
  	 (temp (if (memq 'broken-temp-names py-emacs-features)
--- 1496,1499 ----
***************
*** 1521,1524 ****
--- 1513,1523 ----
      (save-excursion
        (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"))
        (let ((needs-if (/= (py-point 'bol) (py-point 'boi))))
  	(set-buffer buf)