]> code.delx.au - gnu-emacs-elpa/commitdiff
company-ispell: Filter returned candidates locally
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 22 Jan 2015 21:47:05 +0000 (23:47 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 22 Jan 2015 21:47:05 +0000 (23:47 +0200)
Resolves #284

company-ispell.el

index 1561beef1a1b62e633c79ae4451c5a53d8fa1be8..7334caaae5db8ceb9fba90e28888f85f2ecc7350 100644 (file)
@@ -60,8 +60,15 @@ If nil, use `ispell-complete-word-dict'."
     (interactive (company-begin-backend 'company-ispell))
     (prefix (when (company-ispell-available)
               (company-grab-word)))
-    (candidates (lookup-words arg (or company-ispell-dictionary
-                                      ispell-complete-word-dict)))
+    (candidates
+     (let ((words (lookup-words arg (or company-ispell-dictionary
+                                        ispell-complete-word-dict)))
+           (completion-ignore-case t))
+       (if (string= arg "")
+           ;; Small optimization.
+           words
+         ;; Work around issue #284.
+         (all-completions arg words))))
     (sorted t)
     (ignore-case 'keep-prefix)))