;;; company-ispell.el --- company-mode completion back-end using Ispell
-;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2011, 2013-2015 Free Software Foundation, Inc.
;; Author: Nikolaj Schumacher
;;; Code:
(require 'company)
+(require 'cl-lib)
(require 'ispell)
-(eval-when-compile (require 'cl))
(defgroup company-ispell nil
"Completion back-end using Ispell."
(defun company-ispell (command &optional arg &rest ignored)
"`company-mode' completion back-end using Ispell."
(interactive (list 'interactive))
- (case command
+ (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 t)))
+ (ignore-case 'keep-prefix)))
(provide 'company-ispell)
;;; company-ispell.el ends here