From: Richard M. Stallman Date: Sat, 25 Jun 2005 13:52:15 +0000 (+0000) Subject: (gud-filter): Simplify using with-selected-window and with-current-buffer. X-Git-Tag: emacs-pretest-22.0.90~8651 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3e215e3007e1fafab6c19731e3cdeb2fbab7dc6b;p=emacs.git (gud-filter): Simplify using with-selected-window and with-current-buffer. --- diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index c6e85934db4..471d3b308ec 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2534,16 +2534,12 @@ It is saved for when this flag is not set.") ;; This must be outside of the save-excursion ;; in case the source file is our current buffer. (if process-window - (save-selected-window - (select-window process-window) + (with-selected-window (gud-display-frame)) ;; We have to be in the proper buffer, (process-buffer proc), ;; but not in a save-excursion, because that would restore point. - (let ((old-buf (current-buffer))) - (set-buffer (process-buffer proc)) - (unwind-protect - (gud-display-frame) - (set-buffer old-buf))))) + (with-current-buffer (process-buffer proc) + (gud-display-frame)))) ;; If we deferred text that arrived during this processing, ;; handle it now.