Function: gdb-delchar-or-quit

gdb-delchar-or-quit is an interactive and byte-compiled function defined in gdb-mi.el.gz.

Signature

(gdb-delchar-or-quit ARG)

Documentation

Delete ARG characters or send a quit command to GDB.

Send a quit only if point is at the end of the buffer, there is no input, and GDB is waiting for input.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
(defun gdb-delchar-or-quit (arg)
  "Delete ARG characters or send a quit command to GDB.
Send a quit only if point is at the end of the buffer, there is
no input, and GDB is waiting for input."
  (interactive "p")
  (unless (and (eq (current-buffer) gud-comint-buffer)
	       (eq gud-minor-mode 'gdbmi))
    (error "Not in a GDB-MI buffer"))
  (let ((proc (get-buffer-process gud-comint-buffer)))
    (if (and (eobp)
             (process-live-p proc)
	     (not gud-running)
	     (= (point) (marker-position (process-mark proc))))
	;; Sending an EOF does not work with GDB-MI; submit an
	;; explicit quit command.
	(progn
          (if (> gdb-control-level 0)
              (process-send-eof proc)
            (insert "quit")
            (comint-send-input t t)))
      (delete-char arg))))