comparison lisp/comint/gdbsrc.el @ 104:cf808b4c4290 r20-1b4

Import from CVS: tag r20-1b4
author cvs
date Mon, 13 Aug 2007 09:16:51 +0200
parents 131b0175ea99
children b980b6286996
comparison
equal deleted inserted replaced
103:30eda07fe280 104:cf808b4c4290
370 ;; Sends commands to gdb process. 370 ;; Sends commands to gdb process.
371 371
372 (defun gdb-call-from-src (command) 372 (defun gdb-call-from-src (command)
373 "Send associated gdb process COMMAND displaying source in this window." 373 "Send associated gdb process COMMAND displaying source in this window."
374 (setq gdbsrc-call-p t) 374 (setq gdbsrc-call-p t)
375 (let ((buf (or gdbsrc-associated-buffer current-gdb-buffer))) 375 (let ((src-win (selected-window))
376 (or (buffer-name buf) 376 (buf (or gdbsrc-associated-buffer current-gdb-buffer)))
377 (error "GDB buffer deleted")) 377 (or (buffer-name buf)
378 (pop-to-buffer buf)) 378 (error "GDB buffer deleted"))
379 (goto-char (point-max)) 379 (pop-to-buffer buf)
380 (beginning-of-line) 380 (goto-char (point-max))
381 ;; Go past gdb prompt 381 (beginning-of-line)
382 (re-search-forward 382 ;; Go past gdb prompt
383 gdb-prompt-pattern (save-excursion (end-of-line) (point)) t) 383 (re-search-forward
384 ;; Delete any not-supposed-to-be-there text 384 gdb-prompt-pattern (save-excursion (end-of-line) (point)) t)
385 (delete-region (point) (point-max)) 385 ;; Delete any not-supposed-to-be-there text
386 (insert command) 386 (delete-region (point) (point-max))
387 (comint-send-input)) 387 (insert command)
388 (comint-send-input)
389 (select-window src-win)
390 ))
388 391
389 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 392 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
390 ;;; 393 ;;;
391 ;;; Define Commands for GDB SRC Mode Buffer 394 ;;; Define Commands for GDB SRC Mode Buffer
392 ;;; 395 ;;;