update packages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
;;; company-ispell.el --- company-mode completion backend using Ispell
|
||||
;;; company-ispell.el --- company-mode completion backend using Ispell -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2018, 2021, 2023 Free Software Foundation, Inc.
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
|
||||
(defcustom company-ispell-dictionary nil
|
||||
"Dictionary to use for `company-ispell'.
|
||||
If nil, use `ispell-complete-word-dict'."
|
||||
|
||||
If nil, use `ispell-complete-word-dict' or `ispell-alternate-dictionary'."
|
||||
:type '(choice (const :tag "default (nil)" nil)
|
||||
(file :tag "dictionary" t))
|
||||
:set #'company--set-dictionary)
|
||||
@@ -58,18 +59,23 @@ If nil, use `ispell-complete-word-dict'."
|
||||
company-ispell-available)
|
||||
|
||||
(defun company--ispell-dict ()
|
||||
(or company-ispell-dictionary
|
||||
ispell-complete-word-dict
|
||||
ispell-alternate-dictionary))
|
||||
"Determine which dictionary to use."
|
||||
(let ((dict (or company-ispell-dictionary
|
||||
ispell-complete-word-dict
|
||||
ispell-alternate-dictionary)))
|
||||
(when dict
|
||||
(expand-file-name dict))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-ispell (command &optional arg &rest ignored)
|
||||
(defun company-ispell (command &optional arg &rest _ignored)
|
||||
"`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)))
|
||||
(list
|
||||
(company-grab-word)
|
||||
(company-grab-word-suffix))))
|
||||
(candidates
|
||||
(let* ((dict (company--ispell-dict))
|
||||
(all-words
|
||||
@@ -77,7 +83,7 @@ If nil, use `ispell-complete-word-dict'."
|
||||
(lambda () (ispell-lookup-words "" dict))
|
||||
:check-tag dict))
|
||||
(completion-ignore-case t))
|
||||
(if (string= arg "")
|
||||
(if (string-empty-p arg)
|
||||
;; Small optimization.
|
||||
all-words
|
||||
(company-substitute-prefix
|
||||
|
||||
Reference in New Issue
Block a user