[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape ae136b6ba4 010/146: Improve dabbrev lazy loading
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape ae136b6ba4 010/146: Improve dabbrev lazy loading |
Date: |
Sun, 9 Jan 2022 20:57:38 -0500 (EST) |
branch: externals/cape
commit ae136b6ba4db0dbc612897751eacfa4df7f8b725
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Improve dabbrev lazy loading
---
cape.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/cape.el b/cape.el
index 90447354b0..4a3e367f88 100644
--- a/cape.el
+++ b/cape.el
@@ -29,8 +29,6 @@
;;; Code:
-(require 'dabbrev)
-
(defgroup cape nil
"Completion At Point Extensions."
:group 'convenience
@@ -316,14 +314,22 @@
(list :annotation-function (lambda (_) " Dabbrev")
:company-kind (lambda (_) 'text)))
+(defvar dabbrev-check-all-buffers)
+(defvar dabbrev-check-other-buffers)
+(declare-function dabbrev--abbrev-at-point "dabbrev")
+(declare-function dabbrev--ignore-case-p "dabbrev")
+(declare-function dabbrev--find-all-expansions "dabbrev")
+(declare-function dabbrev--reset-global-variables "dabbrev")
+
;;;###autoload
(defun cape-dabbrev-capf ()
"Dabbrev completion-at-point-function."
+ (require 'dabbrev)
(let ((dabbrev-check-all-buffers nil)
(dabbrev-check-other-buffers nil))
(dabbrev--reset-global-variables))
(let ((abbrev (ignore-errors (dabbrev--abbrev-at-point))))
- (when (and abbrev (not (string-match-p "[ \t]" abbrev)))
+ (when (and abbrev (not (string-match-p "[ \t\n]" abbrev)))
(pcase ;; Interruptible scanning
(while-no-input
(let ((inhibit-message t)
@@ -343,14 +349,14 @@
(unless (string-match-p "\n" (buffer-substring beg end))
`(,beg ,end ,words :exclusive no
,@cape--dabbrev-properties)))))))))
-
(defvar cape--ispell-properties
(list :annotation-function (lambda (_) " Ispell")
:company-kind (lambda (_) 'text)))
-(autoload 'ispell-lookup-words "ispell")
+(declare-function ispell-lookup-words "ispell")
(defun cape--ispell-words (bounds)
"Return words from Ispell which match the string within BOUNDS."
+ (require 'ispell)
(with-demoted-errors
(let ((message-log-max nil)
(inhibit-message t))
- [elpa] externals/cape f270456b5d 041/146: Improve cape-dabbrev-capf, (continued)
- [elpa] externals/cape f270456b5d 041/146: Improve cape-dabbrev-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape a8e10cf7ae 014/146: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape d6b13d3055 027/146: Fix no-cache call, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 0e60999893 032/146: cape-ispell: Fix caching, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 7325c5002f 035/146: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 0a374042c9 003/146: README: Update configuration, ELPA Syncer, 2022/01/09
- [elpa] externals/cape d7c765d057 004/146: Add cape-keyword and cape-keyword-capf (Fix #3), ELPA Syncer, 2022/01/09
- [elpa] externals/cape 1aaca0fd74 008/146: Expand comment, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 38802ada22 007/146: Add kinds, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b1f57d79ba 009/146: Improve ispell, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ae136b6ba4 010/146: Improve dabbrev lazy loading,
ELPA Syncer <=
- [elpa] externals/cape 0cc116b29c 012/146: Implement company adapter (See #1), ELPA Syncer, 2022/01/09
- [elpa] externals/cape 845f3483f1 019/146: company-merge-capfs: Add support for :company-prefix-length, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 31acb66152 021/146: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape adb54fc562 020/146: Add missing autoload, ELPA Syncer, 2022/01/09
- [elpa] externals/cape d098cc3cba 023/146: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ff5b19afc0 025/146: Add missing omit-nulls, ELPA Syncer, 2022/01/09
- [elpa] externals/cape a54a512030 030/146: cape-merge-capfs: Compute candidates later, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 0bdc6ae05c 034/146: README: Mention cape-capf-buster, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 8fd6c17a01 033/146: Add cape-capf-buster, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 90ad5d68d5 037/146: Extract cape--cached-table, ELPA Syncer, 2022/01/09