From 6ddd50e7b756c28a0d49b38c1fe2e1d17aa309bb Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Wed, 8 Dec 2021 13:38:17 +0100 Subject: Improve prefix setting of file capf --- README.org | 2 +- cape.el | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 1866b23..d98dcfa 100644 --- a/README.org +++ b/README.org @@ -41,7 +41,7 @@ backends into Capfs and merge multiple Capfs into a Super-Capf! * ~cape-ispell~: Complete word from Ispell dictionary * ~cape-dict~: Complete word from dictionary file * ~cape-line~: Complete entire line from file -* ~cape-tex~: Complete unicode char from TeX command, e.g. ~\hbar~, +* ~cape-tex~: Complete unicode char from TeX command, e.g. ~\hbar~. * ~cape-sgml~: Complete unicode char from Sgml entity, e.g., ~&alpha~. * Configuration diff --git a/cape.el b/cape.el index 67e6fef..ebedf8b 100644 --- a/cape.el +++ b/cape.el @@ -412,7 +412,8 @@ If INTERACTIVE is nil the function acts like a capf." (when (or (not cape-file-directory-must-exist) (and (string-match-p "/" file) (file-exists-p (file-name-directory file)))) `(,(car bounds) ,(cdr bounds) ,#'read-file-name-internal - :company-prefix-length ,(and (not (equal file "/")) (string-suffix-p "/" file)) + ,@(and (not (equal file "/")) (string-suffix-p "/" file) + '(:company-prefix-length t)) :exclusive no ,@cape--file-properties))))) ;;;;; cape-symbol -- cgit v1.0