# HG changeset patch # User Richard M. Stallman # Date 838520421 0 # Node ID 0cddfd1a946e983e8bb9119f0af62662c009b3aa # Parent 2f51ebe36ab02126b6330dcc7994cf78994fb3af (gud-display-line): Don't crash if BUFFER is nil. diff -r 2f51ebe36ab0 -r 0cddfd1a946e lisp/gud.el --- a/lisp/gud.el Sun Jul 28 00:48:42 1996 +0000 +++ b/lisp/gud.el Sun Jul 28 02:20:21 1996 +0000 @@ -1355,22 +1355,24 @@ (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)