branch: externals/cape
commit f083d0b21063f6519b8c5aaf5f1b15644d6e7d75
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Update documentation
---
README.org | 6 ++++--
cape.el | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/README.org b/README.org
index eaeadbb167..532e311f9e 100644
--- a/README.org
+++ b/README.org
@@ -209,7 +209,8 @@ its own sorting.
(list (cape-capf-sort (cape-capf-super #'cape-dabbrev
#'cape-dict))))
;; Trigger completion only after trigger character.
-(setq-local completion-at-point-functions
+(setq-local corfu-auto-trigger "/"
+ completion-at-point-functions
(list (cape-capf-trigger (cape-capf-super #'cape-abbrev
#'tempel-complete) ?/)))
;; Define named Capf instead of using the anonymous Capf directly.
@@ -271,7 +272,8 @@ personal configuration.
#+begin_src emacs-lisp
;; Example 1: Configure a merged Capf with a trigger prefix character.
-(setq-local completion-at-point-functions
+(setq-local corfu-auto-trigger "/"
+ completion-at-point-functions
(list (cape-capf-trigger (cape-capf-super #'cape-abbrev
#'tempel-complete) ?/)))
;; Example 2: Configure a Capf with a specific auto completion prefix length.
diff --git a/cape.el b/cape.el
index 638e522a06..8bbbf664e6 100644
--- a/cape.el
+++ b/cape.el
@@ -1223,9 +1223,11 @@ This function can be used as an advice around an
existing Capf."
;;;###autoload
(defun cape-wrap-trigger (capf trigger)
"Ensure that TRIGGER character occurs before point and then call CAPF.
+See also `corfu-auto-trigger'.
Example:
- (setq completion-at-point-functions
- (list (cape-capf-trigger \\='cape-abbrev ?/)))"
+ (setq corfu-auto-trigger \"/\"
+ completion-at-point-functions
+ (list (cape-capf-trigger \\='cape-abbrev ?/)))"
(when-let ((pos (save-excursion (search-backward (char-to-string trigger)
(pos-bol) 'noerror)))
((save-excursion (not (re-search-backward "\\s-" pos 'noerror)))))
(pcase