diff options
| author | Richard M. Stallman | 1996-07-28 02:20:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-07-28 02:20:21 +0000 |
| commit | 87a3fd191da333803fe18a7c34d784fd022989fd (patch) | |
| tree | 1753092a3d6cf92812a143b0b9cb2cf40f21eebb | |
| parent | faf8a408ee61eee90e9badc8b96afbb48909c581 (diff) | |
| download | emacs-87a3fd191da333803fe18a7c34d784fd022989fd.tar.gz emacs-87a3fd191da333803fe18a7c34d784fd022989fd.zip | |
(gud-display-line): Don't crash if BUFFER is nil.
| -rw-r--r-- | lisp/gud.el | 32 |
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." | |||
| 1355 | (or (eq (current-buffer) gud-comint-buffer) | 1355 | (or (eq (current-buffer) gud-comint-buffer) |
| 1356 | (set-buffer gud-comint-buffer)) | 1356 | (set-buffer gud-comint-buffer)) |
| 1357 | (gud-find-file true-file))) | 1357 | (gud-find-file true-file))) |
| 1358 | (window (display-buffer buffer)) | 1358 | (window (and buffer (display-buffer buffer))) |
| 1359 | (pos)) | 1359 | (pos)) |
| 1360 | (save-excursion | 1360 | (if buffer |
| 1361 | (set-buffer buffer) | 1361 | (progn |
| 1362 | (save-restriction | 1362 | (save-excursion |
| 1363 | (widen) | 1363 | (set-buffer buffer) |
| 1364 | (goto-line line) | 1364 | (save-restriction |
| 1365 | (setq pos (point)) | 1365 | (widen) |
| 1366 | (setq overlay-arrow-string "=>") | 1366 | (goto-line line) |
| 1367 | (or overlay-arrow-position | 1367 | (setq pos (point)) |
| 1368 | (setq overlay-arrow-position (make-marker))) | 1368 | (setq overlay-arrow-string "=>") |
| 1369 | (set-marker overlay-arrow-position (point) (current-buffer))) | 1369 | (or overlay-arrow-position |
| 1370 | (cond ((or (< pos (point-min)) (> pos (point-max))) | 1370 | (setq overlay-arrow-position (make-marker))) |
| 1371 | (widen) | 1371 | (set-marker overlay-arrow-position (point) (current-buffer))) |
| 1372 | (goto-char pos)))) | 1372 | (cond ((or (< pos (point-min)) (> pos (point-max))) |
| 1373 | (set-window-point window overlay-arrow-position))) | 1373 | (widen) |
| 1374 | (goto-char pos)))) | ||
| 1375 | (set-window-point window overlay-arrow-position))))) | ||
| 1374 | 1376 | ||
| 1375 | ;;; The gud-call function must do the right thing whether its invoking | 1377 | ;;; The gud-call function must do the right thing whether its invoking |
| 1376 | ;;; keystroke is from the GUD buffer itself (via major-mode binding) | 1378 | ;;; keystroke is from the GUD buffer itself (via major-mode binding) |