diff options
| author | Nick Roberts | 2003-08-24 20:41:39 +0000 |
|---|---|---|
| committer | Nick Roberts | 2003-08-24 20:41:39 +0000 |
| commit | 37fdcfbc45e639fdde0f53b71225e42565f4fb1e (patch) | |
| tree | fad8c27a1d0a7e1fce08da740bb617ad11439bcc | |
| parent | 32d369ac52866ddcbbddbbd5d7f40082ad2af57e (diff) | |
| download | emacs-37fdcfbc45e639fdde0f53b71225e42565f4fb1e.tar.gz emacs-37fdcfbc45e639fdde0f53b71225e42565f4fb1e.zip | |
(gud-display-line): Don't set window-point if
source buffer is not visible. (Only happens with M-x gdba).
| -rw-r--r-- | lisp/progmodes/gud.el | 16 |
1 files changed, 7 insertions, 9 deletions
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." | |||
| 2524 | (if buffer | 2524 | (if buffer |
| 2525 | (progn | 2525 | (progn |
| 2526 | (with-current-buffer buffer | 2526 | (with-current-buffer buffer |
| 2527 | (if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer)) | 2527 | (unless (or (verify-visited-file-modtime buffer) gud-keep-buffer) |
| 2528 | (progn | 2528 | (if (yes-or-no-p |
| 2529 | (if | ||
| 2530 | (yes-or-no-p | ||
| 2531 | (format "File %s changed on disk. Reread from disk? " | 2529 | (format "File %s changed on disk. Reread from disk? " |
| 2532 | (buffer-name))) | 2530 | (buffer-name))) |
| 2533 | (revert-buffer t t) | 2531 | (revert-buffer t t) |
| 2534 | (setq gud-keep-buffer t)))) | 2532 | (setq gud-keep-buffer t))) |
| 2535 | (save-restriction | 2533 | (save-restriction |
| 2536 | (widen) | 2534 | (widen) |
| 2537 | (goto-line line) | 2535 | (goto-line line) |
| 2538 | (setq pos (point)) | 2536 | (setq pos (point)) |
| 2539 | (setq overlay-arrow-string "=>") | 2537 | (setq overlay-arrow-string "=>") |
| 2540 | (or overlay-arrow-position | 2538 | (or overlay-arrow-position |
| 2541 | (setq overlay-arrow-position (make-marker))) | 2539 | (setq overlay-arrow-position (make-marker))) |
| 2542 | (set-marker overlay-arrow-position (point) (current-buffer))) | 2540 | (set-marker overlay-arrow-position (point) (current-buffer))) |
| 2543 | (cond ((or (< pos (point-min)) (> pos (point-max))) | 2541 | (cond ((or (< pos (point-min)) (> pos (point-max))) |
| 2544 | (widen) | 2542 | (widen) |
| 2545 | (goto-char pos)))) | 2543 | (goto-char pos)))) |
| 2546 | (set-window-point window overlay-arrow-position))))) | 2544 | (if window (set-window-point window overlay-arrow-position)))))) |
| 2547 | 2545 | ||
| 2548 | ;; The gud-call function must do the right thing whether its invoking | 2546 | ;; The gud-call function must do the right thing whether its invoking |
| 2549 | ;; keystroke is from the GUD buffer itself (via major-mode binding) | 2547 | ;; keystroke is from the GUD buffer itself (via major-mode binding) |