(py-process-filter): Make sure current-buffer is restored, even in the

event of error.  Can't use new Emacs primitive save-current-buffer, so
use unwind-protect instead.
This commit is contained in:
Barry Warsaw 1996-09-30 23:00:40 +00:00
parent 24611f80e8
commit 7a73ef852f
1 changed files with 40 additions and 35 deletions

View File

@ -932,8 +932,12 @@ See the `\\[py-shell]' docs for additional warnings."
;; read_process_output has update_mode_lines++ for a similar
;; reason? beats me ...
(unwind-protect
;; make sure current buffer is restored
;; BAW - we want to check to see if this still applies
(if (eq curbuf pbuf) ; mysterious ugly hack
(progn
;; mysterious ugly hack
(if (eq curbuf pbuf)
(set-buffer (get-buffer-create "*scratch*")))
(set-buffer pbuf)
@ -967,7 +971,8 @@ See the `\\[py-shell]' docs for additional warnings."
(and goend
(progn (set-buffer pbuf)
(goto-char (point-max))))
)))
))
(set-buffer curbuf))))
(defun py-execute-buffer ()
"Send the contents of the buffer to a Python interpreter.