Function: ghostel-line-mode-complete-at-point

ghostel-line-mode-complete-at-point is an interactive and natively compiled function defined in ghostel-line-mode.el.

Signature

(ghostel-line-mode-complete-at-point)

Documentation

Complete the line-mode input at point.

Completion sees only the editable input, not the prompt or scrollback. When point is in read-only scrollback, completion starts at the end of the input instead.

Key Bindings

ghostel-line-mode-map <tab> ghostel-line-mode-map TAB

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-line-mode.el
(defun ghostel-line-mode-complete-at-point ()
  "Complete the line-mode input at point.
Completion sees only the editable input, not the prompt or scrollback.
When point is in read-only scrollback, completion starts at the end of
the input instead."
  (interactive)
  (let ((start (and (markerp ghostel--line-input-start)
                    (marker-position ghostel--line-input-start)))
        (end   (and (markerp ghostel--line-input-end)
                    (marker-position ghostel--line-input-end))))
    (cond
     ((not (and start end))
      ;; No live input markers — nothing to complete against.
      (user-error "Line mode: no input region to complete"))
     ((or (< (point) start) (> (point) end))
      (deactivate-mark)
      (goto-char end)
      (ghostel-line-mode-complete-at-point))
     (t
      ;; Refresh in case directory tracking flipped between
      ;; local/remote since `shell-completion-vars' first ran.
      (setq-local comint-file-name-prefix
                  (or (file-remote-p default-directory) ""))
      (save-restriction
        (narrow-to-region start end)
        (let ((completion-at-point-functions
               (ghostel--line-mode-effective-capfs)))
          (completion-at-point)))))))