branch: externals/cape
commit 6ddd50e7b756c28a0d49b38c1fe2e1d17aa309bb
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
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 1866b23bdb..d98dcfab4d 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 67e6fefcc5..ebedf8b1d5 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