Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A hackable minimalist framework for spellchecking

License

NotificationsYou must be signed in to change notification settings

enzuru/company-spell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GNU EmacsMELPA

A dropdown selection in Emacs with word suggestions

If you are happy withcompany-ispell, this package is not for you, and you are encouraged to stick with company-ispell.

company-spell is a hackable minimalist framework for spellchecking.

company-spell directly uses your spellcheck program with no questions asked, and is compatible with ispell, aspell, and hunspell. Unlikecompany-ispell, this works outside of thedefault Emacs ispell machinery.

There are three variables you can modify to adjust how in buffer spellchecking works. This minimalist approach that keeps less machinery between you and your spellchecker, and allows you to cultivate your in buffer spellchecking with a different approach than spellchecking elsewhere.

Due to this minimalist approach, multilingual support is probably not very good yet, as it currently does not track which language you are requesting spellchecking for.

I have not discovered any notable performance issues with this approach, and in fact, I have anecdotally found it to be faster thancompany-ispell (no promises though!). aspell is the default because I find that it returns the best results.

It will automatically run on any buffer that has a major mode derived fromtext-mode, which includes almost all modes meant for human writing.

Instructions

Preparation

Ensure that:

  • A terminal spellchecker is installed (aspell,hunspell,ispell, etc)
  • You have setup access toMELPA
  • Company is installed

Installation

package-install

M-x package-install company-spell(push'company-spell company-backends)

use-package

(use-package company-spell:config (push'company-spell company-backends):ensuret)

Configuration

company-spell-command

Optionally, set a spellchecker that isn't the default value ofaspell:

(setf company-spell-command"hunspell");; or(setf company-spell-command"ispell")

company-spell-args

You can further customize your results by setting custom args (only-a is enabled by default). For instance, search via "soundslike":

(setf company-spell-args"-a soundslike")

company-spell-function

You might want to setup your own function. This is a simple function that calls your spellcheck command with your arguments, and turns it into a list for Company.

(setf company-spell-function#'my-custom-function)

Using with Corfu and Cape

I've started usingCorfu andCape these days, which usecompletion-at-point. Thankfully, this package is easy to adapt tocompletion-at-point. With Cape installed, just write a hook like this for various text editing modes likemarkdown-mode:

(setq-local completion-at-point-functions              (mapcar#'cape-company-to-capf (list#'company-spell)))

License

Licensed under the GPLv3; copyright is assigned to my eponymous charityenzu.ru

About

A hackable minimalist framework for spellchecking

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp