[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape be2014538a 144/146: cape-dabbrev: Use thing-at-poi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape be2014538a 144/146: cape-dabbrev: Use thing-at-point-looking-at |
Date: |
Sun, 9 Jan 2022 20:57:50 -0500 (EST) |
branch: externals/cape
commit be2014538af37fdb3cf38b2129c06314644f745f
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
cape-dabbrev: Use thing-at-point-looking-at
Like dabbrev search for symbol and word characters.
---
cape.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/cape.el b/cape.el
index 2aaeb3e22b..63fa9898ec 100644
--- a/cape.el
+++ b/cape.el
@@ -45,6 +45,8 @@
(require 'cl-lib)
(require 'subr-x))
+(autoload 'thing-at-point-looking-at "thingatpt")
+
;;;; Customization
(defgroup cape nil
@@ -491,16 +493,18 @@ If INTERACTIVE is nil the function acts like a capf."
(if interactive
(let ((cape-dabbrev-min-length 0))
(cape--interactive #'cape-dabbrev))
- (when-let (bounds (bounds-of-thing-at-point 'word))
- `(,(car bounds) ,(cdr bounds)
- ,(cape--table-with-properties
- ;; Use equal, if candidates must be longer than
cape-dabbrev-min-length.
- (cape--cached-table (car bounds) (cdr bounds)
- #'cape--dabbrev-list
- (if (> cape-dabbrev-min-length 0)
- 'equal 'prefix))
- :category 'cape-dabbrev)
- :exclusive no ,@cape--dabbrev-properties))))
+ (when (thing-at-point-looking-at "\\(?:\\sw\\|\\s_\\)+")
+ (let ((beg (match-beginning 0))
+ (end (match-end 0)))
+ `(,beg ,end
+ ,(cape--table-with-properties
+ ;; Use equal, if candidates must be longer than
cape-dabbrev-min-length.
+ (cape--cached-table beg end
+ #'cape--dabbrev-list
+ (if (> cape-dabbrev-min-length 0)
+ 'equal 'prefix))
+ :category 'cape-dabbrev)
+ :exclusive no ,@cape--dabbrev-properties)))))
(defun cape--dabbrev-list (word)
"Find all dabbrev expansions for WORD."
@@ -609,7 +613,6 @@ PREFIX is the prefix regular expression."
(kill-buffer)
(sort list (lambda (x y) (string< (car x) (car y)))))))))
-(declare-function thing-at-point-looking-at "thingatpt")
(defmacro cape--char-define (name method prefix)
"Define character translation capf.
NAME is the name of the capf.
@@ -658,7 +661,6 @@ is nil the function acts like a capf." method method)
;; NOTE: Disable cycling since replacement breaks it.
(let (completion-cycle-threshold ,prefix-required)
(cape--interactive #',capf))
- (require 'thingatpt)
(when-let (bounds
(cond
((thing-at-point-looking-at ,(format "%s[^ \n\t]*"
prefix))
- [elpa] externals/cape 1d0d3abbd1 102/146: Use namespaced symbol, (continued)
- [elpa] externals/cape 1d0d3abbd1 102/146: Use namespaced symbol, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 4aec140c08 109/146: Minor cleanup, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b3e2850fcf 108/146: Add unwind-protect, ELPA Syncer, 2022/01/09
- [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 <=
- [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, 2022/01/09
- [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