unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Reuben Thomas via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Tor Kringeland <tor.kringeland@ntnu.no>, 52179@debbugs.gnu.org
Subject: bug#52179: Highlighting a word in `ispell' using `enchant'
Date: Tue, 24 May 2022 22:34:14 +0100	[thread overview]
Message-ID: <CAOnWdohqoDULLrZq3XDqbOnTkusPiJzG7FYw8STOJHwLYsiOZQ@mail.gmail.com> (raw)
In-Reply-To: <83v8tu4tac.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1949 bytes --]

On Tue, 24 May 2022 at 20:36, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Tor Kringeland <tor.kringeland@ntnu.no>
> > CC: "52179@debbugs.gnu.org" <52179@debbugs.gnu.org>
> > Date: Tue, 24 May 2022 19:27:58 +0000
> >
> > Aspell works for me, but enchant doesn't. When I change
> `ispell-program-name' to "aspell" ispell starts recognizing full words.
> >
> > Looking into the functions you mentioned, it seems like
> `ispell-find-aspell-dictionaries' explicitly adds an entry for nil, while
> `ispell-find-enchant-dictionaries' doesn't. This is what causes the bug for
> me since I have set `ispell-dictionary' to nil/haven't changed it so the
> resulting regex recognizing words is too strict for my use.
>
> Then maybe ispell-find-enchant-dictionaries should be improved?
>
> > Might there be a reason why `ispell-find-enchant-dictionaries' doesn't
> set a nil entry? For sure I would think it could handle whatever input
> aspell can.
>
> I don't know.  CC'ing Reuben, who might know better.
>

I had a look at the code. I think what is happening is that the default
dictionary in ispell-dictionary-base-alist uses only [A-Za-z] for word
chars and [^A-Za-z] for non-word chars. The assumption is that this works
for ispell (the program). Then, [[:alpha:]] and [^[:alpha:]] are used in
the default 'nil'-keyed entry for aspell. As far as I can tell from the
rather hairy hunspell code, it too does not set a default entry.

Since ispell is the only spellchecker Emacs supports that can't cope with
[[:alpha:]], it would seem more sensible to have a default (nil-keyed)
setting in ispell-dictionary-base-alist, and to overwrite the default with
[A-Za-z] only if the spellchecker is really ispell.

This way, duplicate code can be removed and future spellcheckers will not
need to rediscover this problem.

(I never came across this problem because I have customized
ispell-local-dictionary-alist with my own nil entry!)

-- 
https://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 3487 bytes --]

  reply	other threads:[~2022-05-24 21:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 14:44 bug#52179: Highlighting a word in `ispell' using `enchant' Tor Kringeland
2021-11-29 14:51 ` Eli Zaretskii
2021-11-29 20:46   ` Tor Kringeland
2021-11-30  3:22     ` Eli Zaretskii
2022-05-24 15:49 ` Tor Kringeland
2022-05-24 19:11   ` Eli Zaretskii
2022-05-24 19:27     ` Tor Kringeland
2022-05-24 19:36       ` Eli Zaretskii
2022-05-24 21:34         ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-05-25  2:28           ` Eli Zaretskii
2022-05-25  7:39             ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-25 13:23               ` Eli Zaretskii
2022-05-27 13:45                 ` Tor Kringeland
2022-05-27 14:22                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOnWdohqoDULLrZq3XDqbOnTkusPiJzG7FYw8STOJHwLYsiOZQ@mail.gmail.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=52179@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rrt@sc3d.org \
    --cc=tor.kringeland@ntnu.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).