aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2003-01-20 22:03:50 +0000
committerNick Roberts2003-01-20 22:03:50 +0000
commit7461cbeb210de27bb62f1bbccdbad963fa9613a4 (patch)
treed726d1b09992813296aeb49f73da8f22168ab255
parentddef3b66d398eb94ba0134e7ad9537d02f953cd5 (diff)
downloademacs-7461cbeb210de27bb62f1bbccdbad963fa9613a4.tar.gz
emacs-7461cbeb210de27bb62f1bbccdbad963fa9613a4.zip
(gud-display-line): If the current file is newer than its
buffer, offer to reread the file. (gud-keep-buffer): New buffer local variable. Ensures offer to reread file is made just once.
-rw-r--r--lisp/gud.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/gud.el b/lisp/gud.el
index 08b0ee92f33..862ecd3e38f 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -71,6 +71,8 @@ Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb, and b
71(defvar gud-minor-mode nil) 71(defvar gud-minor-mode nil)
72(put 'gud-minor-mode 'permanent-local t) 72(put 'gud-minor-mode 'permanent-local t)
73 73
74(defvar gud-keep-buffer nil)
75
74(defun gud-symbol (sym &optional soft minor-mode) 76(defun gud-symbol (sym &optional soft minor-mode)
75 "Return the symbol used for SYM in MINOR-MODE. 77 "Return the symbol used for SYM in MINOR-MODE.
76MINOR-MODE defaults to `gud-minor-mode. 78MINOR-MODE defaults to `gud-minor-mode.
@@ -188,7 +190,8 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
188 ;; Copy `gud-minor-mode' to the found buffer to turn on the menu. 190 ;; Copy `gud-minor-mode' to the found buffer to turn on the menu.
189 (with-current-buffer buf 191 (with-current-buffer buf
190 (set (make-local-variable 'gud-minor-mode) minor-mode) 192 (set (make-local-variable 'gud-minor-mode) minor-mode)
191 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)) 193 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
194 (make-local-variable 'gud-keep-buffer))
192 buf))) 195 buf)))
193 196
194;; ====================================================================== 197;; ======================================================================
@@ -2513,17 +2516,25 @@ Obeying it means displaying in another window the specified file and line."
2513 (progn 2516 (progn
2514 (save-excursion 2517 (save-excursion
2515 (set-buffer buffer) 2518 (set-buffer buffer)
2519 (if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer))
2520 (progn
2521 (if
2522 (yes-or-no-p
2523 (format "File %s changed on disk. Reread from disk? "
2524 (buffer-name)))
2525 (revert-buffer t t)
2526 (setq gud-keep-buffer t))))
2516 (save-restriction 2527 (save-restriction
2517 (widen) 2528 (widen)
2518 (goto-line line) 2529 (goto-line line)
2519 (setq pos (point)) 2530 (setq pos (point))
2520 (setq overlay-arrow-string "=>") 2531 (setq overlay-arrow-string "=>")
2521 (or overlay-arrow-position 2532 (or overlay-arrow-position
2522 (setq overlay-arrow-position (make-marker))) 2533 (setq overlay-arrow-position (make-marker)))
2523 (set-marker overlay-arrow-position (point) (current-buffer))) 2534 (set-marker overlay-arrow-position (point) (current-buffer)))
2524 (cond ((or (< pos (point-min)) (> pos (point-max))) 2535 (cond ((or (< pos (point-min)) (> pos (point-max)))
2525 (widen) 2536 (widen)
2526 (goto-char pos)))) 2537 (goto-char pos))))
2527 (set-window-point window overlay-arrow-position))))) 2538 (set-window-point window overlay-arrow-position)))))
2528 2539
2529;; The gud-call function must do the right thing whether its invoking 2540;; The gud-call function must do the right thing whether its invoking