diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 471d3b308ec..dc7e64e6e35 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2534,8 +2534,9 @@ 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 - (with-selected-window - (gud-display-frame)) + (progn + (with-selected-window process-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. (with-current-buffer (process-buffer proc)