From: Nick Roberts Date: Sun, 24 Aug 2003 20:41:39 +0000 (+0000) Subject: (gud-display-line): Don't set window-point if X-Git-Tag: ttn-vms-21-2-B4~8990 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37fdcfbc45e639fdde0f53b71225e42565f4fb1e;p=emacs.git (gud-display-line): Don't set window-point if source buffer is not visible. (Only happens with M-x gdba). --- diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 349c78ce3d2..e99fb26cf07 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2524,26 +2524,24 @@ Obeying it means displaying in another window the specified file and line." (if buffer (progn (with-current-buffer buffer - (if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer)) - (progn - (if - (yes-or-no-p + (unless (or (verify-visited-file-modtime buffer) gud-keep-buffer) + (if (yes-or-no-p (format "File %s changed on disk. Reread from disk? " (buffer-name))) (revert-buffer t t) - (setq gud-keep-buffer t)))) + (setq gud-keep-buffer t))) (save-restriction (widen) (goto-line line) (setq pos (point)) (setq overlay-arrow-string "=>") (or overlay-arrow-position - (setq overlay-arrow-position (make-marker))) + (setq overlay-arrow-position (make-marker))) (set-marker overlay-arrow-position (point) (current-buffer))) (cond ((or (< pos (point-min)) (> pos (point-max))) - (widen) - (goto-char pos)))) - (set-window-point window overlay-arrow-position))))) + (widen) + (goto-char pos)))) + (if window (set-window-point window overlay-arrow-position)))))) ;; The gud-call function must do the right thing whether its invoking ;; keystroke is from the GUD buffer itself (via major-mode binding)