X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/24149b0db155f9669e830474567527450d3f842f..7a2deffbe4a7865b42e31ad2eabd05221468f07c:/packages/company/company-ispell.el diff --git a/packages/company/company-ispell.el b/packages/company/company-ispell.el index 4ce8dfc11..c275bbe41 100644 --- a/packages/company/company-ispell.el +++ b/packages/company/company-ispell.el @@ -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, 2013-2015 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011, 2013-2016 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 @@ -41,11 +41,16 @@ If nil, use `ispell-complete-word-dict'." (defvar company-ispell-available 'unknown) +(defalias 'company-ispell--lookup-words + (if (fboundp 'ispell-lookup-words) + 'ispell-lookup-words + 'lookup-words)) + (defun company-ispell-available () (when (eq company-ispell-available 'unknown) (condition-case err (progn - (lookup-words "WHATEVER") + (company-ispell--lookup-words "WHATEVER") (setq company-ispell-available t)) (error (message "Company: ispell-look-command not found") @@ -54,15 +59,16 @@ 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 - (let ((words (lookup-words arg (or company-ispell-dictionary - ispell-complete-word-dict))) + (let ((words (company-ispell--lookup-words + arg + (or company-ispell-dictionary ispell-complete-word-dict))) (completion-ignore-case t)) (if (string= arg "") ;; Small optimization.