From 14924f48f8e3d7ce5791527427421ed49fdb98c7 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Fri, 5 Feb 2021 19:56:18 +0000 Subject: [PATCH] Make Enchant the default for ispell-program-name when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- emacs-spellchecker.patch | 20 +++++++++++++------- emacs.spec | 6 +++++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/emacs-spellchecker.patch b/emacs-spellchecker.patch index 48c2b57..4551dcb 100644 --- a/emacs-spellchecker.patch +++ b/emacs-spellchecker.patch @@ -1,16 +1,22 @@ 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 +++ b/lisp/textmodes/ispell.el -@@ -200,9 +200,9 @@ - ;; cause an error; and one of the other spelling engines below is - ;; almost certainly installed in any case, for enchant to use. +@@ -197,14 +197,11 @@ ispell-choices-win-default-height + :type 'integer + :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 - (or (executable-find "aspell") -+ (or (executable-find "hunspell") +- (executable-find "ispell") ++ (or (executable-find "enchant-2") + (executable-find "hunspell") + (executable-find "aspell") - (executable-find "ispell") -- (executable-find "hunspell") ++ (executable-find "ispell") "ispell") "Program invoked by \\[ispell-word] and \\[ispell-region] commands." :type 'string diff --git a/emacs.spec b/emacs.spec index 0199e84..d28721b 100644 --- a/emacs.spec +++ b/emacs.spec @@ -5,7 +5,7 @@ Summary: GNU Emacs text editor Name: emacs Epoch: 1 Version: 27.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ and CC0-1.0 URL: http://www.gnu.org/software/emacs/ 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(posttrans): %{_sbindir}/alternatives Requires: %{name}-filesystem = %{epoch}:%{version}-%{release} +Recommends: enchant2 Provides: %{name}-el = %{epoch}:%{version}-%{release} 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 %changelog +* Fri Feb 05 2021 Peter Oliver - 1:27.1-4 +- Make Enchant the default for ispell-program-name when available. + * Tue Jan 26 2021 Fedora Release Engineering - 1:27.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild