[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape bc1c1ee9fc 140/146: Make cape-tex etc less aggress
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape bc1c1ee9fc 140/146: Make cape-tex etc less aggressive, add cape-tex-prefix-required variable |
Date: |
Sun, 9 Jan 2022 20:57:49 -0500 (EST) |
branch: externals/cape
commit bc1c1ee9fc015815b1c3a0e5a704002bd63cf8cc
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Make cape-tex etc less aggressive, add cape-tex-prefix-required variable
---
cape.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/cape.el b/cape.el
index dad2bae588..8623e908e3 100644
--- a/cape.el
+++ b/cape.el
@@ -627,6 +627,7 @@ NAME is the name of the capf.
METHOD is the input method.
PREFIX is the prefix regular expression."
(let ((capf (intern (format "cape-%s" name)))
+ (prefix-required (intern (format "cape-%s-prefix-required" name)))
(list (intern (format "cape--%s-list" name)))
(ann (intern (format "cape--%s-annotation" name)))
(docsig (intern (format "cape--%s-docsig" name)))
@@ -634,6 +635,9 @@ PREFIX is the prefix regular expression."
(properties (intern (format "cape--%s-properties" name))))
`(progn
(defvar ,list (cape--char-translation ,method ,prefix))
+ (defcustom ,prefix-required t
+ ,(format "Initial prefix is required for `%s' to trigger." capf)
+ :type 'boolean)
(defun ,ann (name)
(when-let (char (cdr (assoc name ,list)))
(format " %c" char)))
@@ -663,12 +667,14 @@ is nil the function acts like a capf." method method)
(interactive (list t))
(if interactive
;; NOTE: Disable cycling since replacement breaks it.
- (let (completion-cycle-threshold)
+ (let (completion-cycle-threshold ,prefix-required)
(cape--interactive #',capf))
(require 'thingatpt)
- (let ((bounds (if (thing-at-point-looking-at ,(format "%s[^ \n\t]*"
prefix))
- (cons (match-beginning 0) (match-end 0))
- (cons (point) (point)))))
+ (when-let (bounds
+ (cond
+ ((thing-at-point-looking-at ,(format "%s[^ \n\t]*"
prefix))
+ (cons (match-beginning 0) (match-end 0)))
+ ((not ,prefix-required) (cons (point) (point)))))
(append
(list (car bounds) (cdr bounds)
(cape--table-with-properties ,list :category ',capf)
- [elpa] externals/cape e81e3cfd4e 112/146: Indent, (continued)
- [elpa] externals/cape e81e3cfd4e 112/146: Indent, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b895c8cf28 114/146: cape-capf-case-fold: Add dont-fold, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c0343a247c 123/146: cape-tex/sgml: Improve docsig, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 6d076f2480 129/146: README: Document company--multi-backend-adapter, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c8c0a9f9a6 134/146: Simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 5319e343bb 136/146: Improve repair function, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 12b00151d1 143/146: Improve and simplify cape-dabbrev, ELPA Syncer, 2022/01/09
- [elpa] externals/cape be2014538a 144/146: cape-dabbrev: Use thing-at-point-looking-at, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 5ccece0e34 146/146: Add to GNU ELPA, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 700c9d7bc2 137/146: Remove cape-repair-misbehaving-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape bc1c1ee9fc 140/146: Make cape-tex etc less aggressive, add cape-tex-prefix-required variable,
ELPA Syncer <=
- [elpa] externals/cape 8726bc7246 138/146: cape--interactive: Simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ac65f2acdf 048/146: Add autoloads, renamings, README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 0a05e51d2a 053/146: Add cape-capf-with-predicate (See #9), ELPA Syncer, 2022/01/09
- [elpa] externals/cape 75cb8c799a 071/146: Unify cape-file and cape-file-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 1d72f84b64 046/146: Add cape-capf-with-properties and cape-silent-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 693a376913 054/146: Revert "Add cape-capf-with-predicate (See #9)", ELPA Syncer, 2022/01/09
- [elpa] externals/cape 8a2cc4c7bb 060/146: Add completion categories, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 496bb4a5e4 065/146: Rename function, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ba85197981 075/146: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 202345e954 083/146: cape-capf-with-properties: Add support for :sort and :category, ELPA Syncer, 2022/01/09