diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-18 20:15:55 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-18 20:15:55 +0200 |
| commit | f5364cd1455fae83885092a32ab74e90a177c419 (patch) | |
| tree | 754deed408869b1ac12e45acdf1ae5d6aa5193f4 /README.org | |
| parent | 758b45d133dd96a1787099af329c917d02635d0d (diff) | |
Add cape-wrap-debug and cape-capf-debug
Diffstat (limited to 'README.org')
| -rw-r--r-- | README.org | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -252,6 +252,7 @@ the Capf transformers with =defalias= to a function symbol. - ~cape-interactive-capf~, ~cape-interactive~: Create a Capf which can be called interactively. - ~cape-wrap-accept-all~, ~cape-capf-accept-all~: Create a Capf which accepts every input as valid. +- ~cape-wrap-debug~, ~cape-capf-debug~: Create a Capf which prints debugging messages. - ~cape-wrap-silent~, ~cape-capf-silent~: Wrap a chatty Capf and silence it. - ~cape-wrap-purify~, ~cape-capf-purify~: Purify a broken Capf and ensure that it does not modify the buffer. - ~cape-wrap-nonexclusive~, ~cape-capf-nonexclusive:~ Mark Capf as non-exclusive. @@ -279,11 +280,14 @@ personal configuration. (setq-local completion-at-point-functions (list (cape-capf-prefix-length #'cape-dabbrev 2))) -;; Example 3: Named Capf +;; Example 3: Create a Capf with debugging messages +(setq-local completion-at-point-functions (list (cape-capf-debug #'cape-dict))) + +;; Example 4: Named Capf (defalias 'cape-dabbrev-min-2 (cape-capf-prefix-length #'cape-dabbrev 2)) (setq-local completion-at-point-functions (list #'cape-dabbrev-min-2)) -;; Example 4: Define a defensive Dabbrev Capf, which accepts all inputs. If you +;; Example 5: Define a defensive Dabbrev Capf, which accepts all inputs. If you ;; use Corfu and `corfu-auto=t', the first candidate won't be auto selected if ;; `corfu-preselect=valid', such that it cannot be accidentally committed when ;; pressing RET. @@ -291,12 +295,12 @@ personal configuration. (cape-wrap-accept-all #'cape-dabbrev)) (add-to-list 'completion-at-point-functions #'my-cape-dabbrev-accept-all) -;; Example 5: Define interactive Capf which can be bound to a key. Here we wrap +;; Example 6: Define interactive Capf which can be bound to a key. Here we wrap ;; the `elisp-completion-at-point' such that we can complete Elisp code ;; explicitly in arbitrary buffers. (keymap-global-set "C-c p e" (cape-interactive-capf #'elisp-completion-at-point)) -;; Example 6: Ignore :keywords in Elisp completion. +;; Example 7: Ignore :keywords in Elisp completion. (defun ignore-elisp-keywords (sym) (not (keywordp sym))) (setq-local completion-at-point-functions |
