summaryrefslogtreecommitdiff
path: root/lisp/gud.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-07-28 02:20:21 +0000
committerRichard M. Stallman <rms@gnu.org>1996-07-28 02:20:21 +0000
commitae3bab07db9ce1c5eba7f6ab2a19f7bd1f6603cc (patch)
tree7a455e6eb73033f979d2dc0783d045dfcd1b2b53 /lisp/gud.el
parent05a562ea9c1028fcd9c2bc6b70d38baf0e4ce72c (diff)
downloademacs-ae3bab07db9ce1c5eba7f6ab2a19f7bd1f6603cc.tar.gz
(gud-display-line): Don't crash if BUFFER is nil.
Diffstat (limited to 'lisp/gud.el')
-rw-r--r--lisp/gud.el32
1 files changed, 17 insertions, 15 deletions
diff --git a/lisp/gud.el b/lisp/gud.el
index cbbd4aeb2d9..281ceb50573 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -1355,22 +1355,24 @@ Obeying it means displaying in another window the specified file and line."
(or (eq (current-buffer) gud-comint-buffer)
(set-buffer gud-comint-buffer))
(gud-find-file true-file)))
- (window (display-buffer buffer))
+ (window (and buffer (display-buffer buffer)))
(pos))
- (save-excursion
- (set-buffer buffer)
- (save-restriction
- (widen)
- (goto-line line)
- (setq pos (point))
- (setq overlay-arrow-string "=>")
- (or overlay-arrow-position
- (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)))
+ (if buffer
+ (progn
+ (save-excursion
+ (set-buffer buffer)
+ (save-restriction
+ (widen)
+ (goto-line line)
+ (setq pos (point))
+ (setq overlay-arrow-string "=>")
+ (or overlay-arrow-position
+ (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)))))
;;; The gud-call function must do the right thing whether its invoking
;;; keystroke is from the GUD buffer itself (via major-mode binding)