# HG changeset patch # User Richard M. Stallman # Date 1119707535 0 # Node ID b0c4ce512db495f2a5287e13c184d2f1421fa0df # Parent 73e0fc286df5b86823b3d697da39537199d0f177 (gud-filter): Simplify using with-selected-window and with-current-buffer. diff -r 73e0fc286df5 -r b0c4ce512db4 lisp/progmodes/gud.el --- a/lisp/progmodes/gud.el Sat Jun 25 13:41:59 2005 +0000 +++ b/lisp/progmodes/gud.el Sat Jun 25 13:52:15 2005 +0000 @@ -2534,16 +2534,12 @@ ;; 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.