]> code.delx.au - gnu-emacs-elpa/blob - company-ispell.el
Fixed accidental "...".
[gnu-emacs-elpa] / company-ispell.el
1 ;;; company-ispell.el --- a company-mode completion back-end using ispell
2 ;;
3 ;; Copyright (C) 2009 Nikolaj Schumacher
4 ;;
5 ;; This file is part of company.
6 ;;
7 ;; This program is free software; you can redistribute it and/or
8 ;; modify it under the terms of the GNU General Public License
9 ;; as published by the Free Software Foundation; either version 2
10 ;; of the License, or (at your option) any later version.
11 ;;
12 ;; This program is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
16 ;;
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 (require 'company)
21 (require 'ispell)
22 (eval-when-compile (require 'cl))
23
24 (defcustom company-ispell-dictionary nil
25 "*Dictionary to use for `company-ispell'.
26 If nil, use `ispell-complete-word-dict'."
27 :group 'company
28 :type '(choice (const :tag "default (nil)" nil)
29 (file :tag "dictionary" t)))
30
31 (defun company-ispell (command &optional arg &rest ignored)
32 (case command
33 ('prefix (company-grab "\\<\\w+\\>"))
34 ('candidates (lookup-words arg (or company-ispell-dictionary
35 ispell-complete-word-dict)))
36 ('sorted t)
37 ('ignore-case t)))
38
39 (provide 'company-ispell)
40 ;;; company-ispell.el ends here