comparison lisp/gud.el @ 15185:44305fd68269

(gud-filter): Move the call to gud-display-frame outside of the save-excursion.
author Richard M. Stallman <rms@gnu.org>
date Wed, 08 May 1996 04:36:21 +0000
parents 654bc3990b4d
children c595cb576143
comparison
equal deleted inserted replaced
15184:43360e066486 15185:44305fd68269
1223 (if gud-filter-defer-flag 1223 (if gud-filter-defer-flag
1224 ;; If we can't process any text now, 1224 ;; If we can't process any text now,
1225 ;; save it for later. 1225 ;; save it for later.
1226 (setq gud-filter-pending-text 1226 (setq gud-filter-pending-text
1227 (concat (or gud-filter-pending-text "") string)) 1227 (concat (or gud-filter-pending-text "") string))
1228 (save-excursion 1228
1229 ;; If we have to ask a question during the processing, 1229 ;; If we have to ask a question during the processing,
1230 ;; defer any additional text that comes from the debugger 1230 ;; defer any additional text that comes from the debugger
1231 ;; during that time. 1231 ;; during that time.
1232 (let ((gud-filter-defer-flag t)) 1232 (let ((gud-filter-defer-flag t))
1233 ;; Process now any text we previously saved up. 1233 ;; Process now any text we previously saved up.
1234 (if gud-filter-pending-text 1234 (if gud-filter-pending-text
1235 (setq string (concat gud-filter-pending-text string) 1235 (setq string (concat gud-filter-pending-text string)
1236 gud-filter-pending-text nil)) 1236 gud-filter-pending-text nil))
1237 (save-excursion
1237 (set-buffer (process-buffer proc)) 1238 (set-buffer (process-buffer proc))
1238 ;; If we have been so requested, delete the debugger prompt. 1239 ;; If we have been so requested, delete the debugger prompt.
1239 (if (marker-buffer gud-delete-prompt-marker) 1240 (if (marker-buffer gud-delete-prompt-marker)
1240 (progn 1241 (progn
1241 (delete-region (process-mark proc) gud-delete-prompt-marker) 1242 (delete-region (process-mark proc) gud-delete-prompt-marker)
1247 ;; unless (1) point is at or after the position where output appears 1248 ;; unless (1) point is at or after the position where output appears
1248 ;; and (2) this buffer is on the screen. 1249 ;; and (2) this buffer is on the screen.
1249 (setq process-window 1250 (setq process-window
1250 (and gud-last-frame 1251 (and gud-last-frame
1251 (>= (point) (process-mark proc)) 1252 (>= (point) (process-mark proc))
1252 (get-buffer-window (current-buffer))))) 1253 (get-buffer-window (current-buffer))))
1253 (if process-window 1254
1254 (save-selected-window 1255 ;; Let the comint filter do the actual insertion.
1255 (select-window process-window) 1256 ;; That lets us inherit various comint features.
1256 (gud-display-frame))) 1257 (comint-output-filter proc output)))
1257 1258
1258 ;; Let the comint filter do the actual insertion. 1259 ;; Put the arrow on the source line.
1259 ;; That lets us inherit various comint features. 1260 :; This must be outside of the save-excursion
1260 (comint-output-filter proc output) 1261 ;; in case the source file is our current buffer.
1261 1262 (if process-window
1262 ;; If we deferred text that arrived during this processing, 1263 (save-selected-window
1263 ;; handle it now. 1264 (select-window process-window)
1264 (if gud-filter-pending-text 1265 (gud-display-frame)))
1265 (gud-filter proc ""))))))) 1266
1267 ;; If we deferred text that arrived during this processing,
1268 ;; handle it now.
1269 (if gud-filter-pending-text
1270 (gud-filter proc ""))))))
1266 1271
1267 (defun gud-sentinel (proc msg) 1272 (defun gud-sentinel (proc msg)
1268 (cond ((null (buffer-name (process-buffer proc))) 1273 (cond ((null (buffer-name (process-buffer proc)))
1269 ;; buffer killed 1274 ;; buffer killed
1270 ;; Stop displaying an arrow in a source file. 1275 ;; Stop displaying an arrow in a source file.
1323 (or (eq (current-buffer) gud-comint-buffer) 1328 (or (eq (current-buffer) gud-comint-buffer)
1324 (set-buffer gud-comint-buffer)) 1329 (set-buffer gud-comint-buffer))
1325 (gud-find-file true-file))) 1330 (gud-find-file true-file)))
1326 (window (display-buffer buffer)) 1331 (window (display-buffer buffer))
1327 (pos)) 1332 (pos))
1328 ;;; (if (equal buffer (current-buffer))
1329 ;;; nil
1330 ;;; (setq buffer-read-only nil))
1331 (save-excursion 1333 (save-excursion
1332 ;;; (setq buffer-read-only t)
1333 (set-buffer buffer) 1334 (set-buffer buffer)
1334 (save-restriction 1335 (save-restriction
1335 (widen) 1336 (widen)
1336 (goto-line line) 1337 (goto-line line)
1337 (setq pos (point)) 1338 (setq pos (point))