Function: cape--debug-table

cape--debug-table is a byte-compiled function defined in cape.el.

Signature

(cape--debug-table TABLE NAME BEG END)

Documentation

Create completion TABLE with debug messages.

NAME is the name of the Capf, BEG and END are the input markers.

Source Code

;; Defined in ~/.emacs.d/elpa/cape-20260804.2303/cape.el
(defun cape--debug-table (table name beg end)
  "Create completion TABLE with debug messages.
NAME is the name of the Capf, BEG and END are the input markers."
  (lambda (str pred action)
    (let ((result (complete-with-action action table str pred)))
      (if (and (eq action 'completion--unquote) (functionp (cadr result)))
          ;; See `cape--wrapped-table'
          (cl-callf cape--debug-table (cadr result) name beg end)
        (cape--debug-message
         "%s(action=%S input=%s:%s:%S prefix=%S ignore-case=%S%s%s) => %s"
         name
         (pcase action
           ('nil 'try)
           ('t 'all)
           ('lambda 'test)
           (_ action))
         (+ beg 0) (+ end 0) (buffer-substring-no-properties beg end)
         str completion-ignore-case
         (if completion-regexp-list
             (concat " regexp=" (cape--debug-print completion-regexp-list t))
           "")
         (if pred
             (concat " predicate=" (cape--debug-print pred))
           "")
         (cape--debug-print result)))
      result)))