Function: gud-gdb-completion-at-point
gud-gdb-completion-at-point is a byte-compiled function defined in
gud.el.gz.
Signature
(gud-gdb-completion-at-point)
Documentation
Return the data to complete the GDB command before point.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
(defun gud-gdb-completion-at-point ()
"Return the data to complete the GDB command before point."
(let ((end (point))
(start
(save-excursion
(skip-chars-backward "^ " (comint-line-beginning-position))
(point))))
;; FIXME: `gud-gdb-run-command-fetch-lines' has some nasty side-effects on
;; the buffer (via `gud-delete-prompt-marker'): it removes the prompt and
;; then re-adds it later, thus messing up markers and overlays along the
;; way (bug#18282).
;; We use an "insert-before" marker for `start', since it's typically right
;; after the prompt, which works around the problem, but is a hack (and
;; comes with other downsides, e.g. if completion adds text at `start').
(list (copy-marker start t) end
(completion-table-dynamic
(apply-partially gud-gdb-completion-function
(buffer-substring (comint-line-beginning-position)
start))))))