]> code.delx.au - gnu-emacs-elpa/blobdiff - company-ispell.el
Use company-dabbrev-char-regexp more consistently (#433)
[gnu-emacs-elpa] / company-ispell.el
index 1561beef1a1b62e633c79ae4451c5a53d8fa1be8..91f43df9bb10c9cb384a6960c9ebc1b6a383fe24 100644 (file)
@@ -1,6 +1,6 @@
-;;; company-ispell.el --- company-mode completion back-end using Ispell
+;;; company-ispell.el --- company-mode completion backend using Ispell
 
-;; Copyright (C) 2009-2011  Free Software Foundation, Inc.
+;; Copyright (C) 2009-2011, 2013-2015  Free Software Foundation, Inc.
 
 ;; Author: Nikolaj Schumacher
 
@@ -30,7 +30,7 @@
 (require 'ispell)
 
 (defgroup company-ispell nil
-  "Completion back-end using Ispell."
+  "Completion backend using Ispell."
   :group 'company)
 
 (defcustom company-ispell-dictionary nil
@@ -54,14 +54,21 @@ If nil, use `ispell-complete-word-dict'."
 
 ;;;###autoload
 (defun company-ispell (command &optional arg &rest ignored)
-  "`company-mode' completion back-end using Ispell."
+  "`company-mode' completion backend using Ispell."
   (interactive (list 'interactive))
   (cl-case command
     (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)))