[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape b1f57d79ba 009/146: Improve ispell
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape b1f57d79ba 009/146: Improve ispell |
Date: |
Sun, 9 Jan 2022 20:57:38 -0500 (EST) |
branch: externals/cape
commit b1f57d79ba136bff93c4ca571027356905055fac
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Improve ispell
---
cape.el | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/cape.el b/cape.el
index 33ee2918ee..90447354b0 100644
--- a/cape.el
+++ b/cape.el
@@ -343,30 +343,36 @@
(unless (string-match-p "\n" (buffer-substring beg end))
`(,beg ,end ,words :exclusive no
,@cape--dabbrev-properties)))))))))
-(autoload 'ispell-lookup-words "ispell")
(defvar cape--ispell-properties
(list :annotation-function (lambda (_) " Ispell")
:company-kind (lambda (_) 'text)))
+(autoload 'ispell-lookup-words "ispell")
+(defun cape--ispell-words (bounds)
+ "Return words from Ispell which match the string within BOUNDS."
+ (with-demoted-errors
+ (let ((message-log-max nil)
+ (inhibit-message t))
+ (ispell-lookup-words
+ (format "*%s*" (buffer-substring-no-properties
+ (car bounds) (cdr bounds)))))))
+
;;;###autoload
(defun cape-ispell-capf ()
"Ispell completion-at-point-function."
(when-let* ((bounds (bounds-of-thing-at-point 'word))
- (table (with-demoted-errors
- (let ((message-log-max nil)
- (inhibit-message t))
- (ispell-lookup-words
- (format "*%s*"
- (buffer-substring-no-properties (car
bounds) (cdr bounds))))))))
+ (table (cape--ispell-words bounds)))
`(,(car bounds) ,(cdr bounds) ,table :exclusive no
,@cape--ispell-properties)))
;;;###autoload
(defun cape-ispell ()
"Complete with Ispell at point."
(interactive)
- (let ((completion-at-point-functions (list #'cape-ispell-capf)))
- (completion-at-point)))
+ (let ((bounds (or (bounds-of-thing-at-point 'word) (cons (point) (point))))
+ (completion-extra-properties cape--ispell-properties))
+ (when-let (table (cape--ispell-words bounds))
+ (completion-in-region (car bounds) (cdr bounds) (cape--ispell-words
bounds)))))
(defvar cape--dict-properties
(list :annotation-function (lambda (_) " Dict")
- [elpa] externals/cape 63ded5fde4 028/146: Improve cape-company-to-capf, (continued)
- [elpa] externals/cape 63ded5fde4 028/146: Improve cape-company-to-capf, ELPA Syncer, 2022/01/09
- [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 <=
- [elpa] externals/cape ae136b6ba4 010/146: Improve dabbrev lazy loading, ELPA Syncer, 2022/01/09
- [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