Function: gud-gdb-fetch-lines-filter

gud-gdb-fetch-lines-filter is a byte-compiled function defined in gud.el.gz.

Signature

(gud-gdb-fetch-lines-filter STRING)

Documentation

Filter used to read the list of lines output by a command.

STRING is the output to filter. It is passed through gud-gdb-marker-filter before we look at it.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
;; (defun gud-gdb-complete-command ()
;;   "Perform completion on the GDB command preceding point.
;; This is implemented using the GDB `complete' command which isn't
;; available with older versions of GDB."
;;   (interactive)
;;   (apply #'completion-in-region (gud-gdb-completion-at-point)))

;; The completion process filter is installed temporarily to slurp the
;; output of GDB up to the next prompt and build the completion list.
(defun gud-gdb-fetch-lines-filter (string)
  "Filter used to read the list of lines output by a command.
STRING is the output to filter.
It is passed through `gud-gdb-marker-filter' before we look at it."
  (setq string (gud-gdb-marker-filter string))
  (setq string (concat gud-gdb-fetch-lines-string string))
  (while (string-match "\n" string)
    (push (substring string gud-gdb-fetch-lines-break (match-beginning 0))
	  gud-gdb-fetched-lines)
    (setq string (substring string (match-end 0))))
  (if (string-match comint-prompt-regexp string)
      (progn
	(setq gud-gdb-fetch-lines-in-progress nil)
	string)
    (progn
      (setq gud-gdb-fetch-lines-string string)
      "")))