Make Enchant the default for ispell-program-name when available

To decide the default value of ispell-program-name, Emacs looks in turn for a number of different binaries, and uses whichever it finds first.  The snag with this approach is that, just because a binary is installed, doesnʼt mean that a dictionary in your language is installed for that binary.

Since https://bugzilla.redhat.com/show_bug.cgi?id=713600 weʼve been patching the search list to look for Hunspell before Aspell, presumably because Hunspell dictionaries were considered more likely to be installed than the Aspell dictionaries.

However, now we have Enchant, which will automatically select a backend based on a configuration preference, skipping over any backends for which youʼre missing a dictionary.  This seems to be exactly what we want, so letʼs use it here.
This commit is contained in:
Peter Oliver 2021-02-05 19:56:18 +00:00
parent 746bf11c12
commit 14924f48f8
2 changed files with 18 additions and 8 deletions

View File

@ -1,16 +1,22 @@
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 1d28de7..1daec44 100644 index 65f61644b6..254c3e6a82 100644
--- a/lisp/textmodes/ispell.el --- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el
@@ -200,9 +200,9 @@ @@ -197,14 +197,11 @@ ispell-choices-win-default-height
;; cause an error; and one of the other spelling engines below is :type 'integer
;; almost certainly installed in any case, for enchant to use. :group 'ispell)
-;; XXX Add enchant to this list once enchant >= 2.1.0 is widespread.
-;; Before that, adding it is useless, as if it is found, it will just
-;; cause an error; and one of the other spelling engines below is
-;; almost certainly installed in any case, for enchant to use.
(defcustom ispell-program-name (defcustom ispell-program-name
- (or (executable-find "aspell") - (or (executable-find "aspell")
+ (or (executable-find "hunspell") - (executable-find "ispell")
+ (or (executable-find "enchant-2")
(executable-find "hunspell")
+ (executable-find "aspell") + (executable-find "aspell")
(executable-find "ispell") + (executable-find "ispell")
- (executable-find "hunspell")
"ispell") "ispell")
"Program invoked by \\[ispell-word] and \\[ispell-region] commands." "Program invoked by \\[ispell-word] and \\[ispell-region] commands."
:type 'string :type 'string

View File

@ -5,7 +5,7 @@ Summary: GNU Emacs text editor
Name: emacs Name: emacs
Epoch: 1 Epoch: 1
Version: 27.1 Version: 27.1
Release: 3%{?dist} Release: 4%{?dist}
License: GPLv3+ and CC0-1.0 License: GPLv3+ and CC0-1.0
URL: http://www.gnu.org/software/emacs/ URL: http://www.gnu.org/software/emacs/
Source0: https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz Source0: https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz
@ -145,6 +145,7 @@ License: GPLv3+ and GFDL and BSD
Requires(preun): %{_sbindir}/alternatives Requires(preun): %{_sbindir}/alternatives
Requires(posttrans): %{_sbindir}/alternatives Requires(posttrans): %{_sbindir}/alternatives
Requires: %{name}-filesystem = %{epoch}:%{version}-%{release} Requires: %{name}-filesystem = %{epoch}:%{version}-%{release}
Recommends: enchant2
Provides: %{name}-el = %{epoch}:%{version}-%{release} Provides: %{name}-el = %{epoch}:%{version}-%{release}
Obsoletes: emacs-el < 1:24.3-29 Obsoletes: emacs-el < 1:24.3-29
@ -483,6 +484,9 @@ rm %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document23.svg
%{_includedir}/emacs-module.h %{_includedir}/emacs-module.h
%changelog %changelog
* Fri Feb 05 2021 Peter Oliver <rpm@mavit.org.uk> - 1:27.1-4
- Make Enchant the default for ispell-program-name when available.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:27.1-3 * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:27.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild