unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "André A. Gomes" <andremegafone@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: ispell.el and pipes
Date: Tue, 16 Nov 2021 22:40:19 +0300	[thread overview]
Message-ID: <87bl2jrisc.fsf@gmail.com> (raw)
In-Reply-To: <871r3grrtd.fsf@gmail.com> ("André A. Gomes"'s message of "Tue, 16 Nov 2021 19:25:18 +0300")

André A. Gomes <andremegafone@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: André A. Gomes <andremegafone@gmail.com>
>>> Date: Tue, 16 Nov 2021 17:42:53 +0300
>>>
>>> In the beginning was Ispell (the spelling program) and ispell.el (the
>>> Emacs interface).  The communication is via pipes or ptys.
>>>
>>> But today there's Aspell (among others), which provides an external C
>>> API.
>>>
>>> Could Emacs leverage it?  What are the pros and cons of pipes/ptys and
>>> the C API for Emacs' sake?
>>
>> The main con is that Someone™ will have to write the code to use the C
>> API and integrate that into ispell.el.  There are also other cons:
>>
>>   . the C API provided by Aspell isn't shared by other spell-checkers
>>     we support (AFAIK)
>>   . using the C API will need Emacs to be linked against the Aspell
>>     library, which makes the build requirements and procedures more
>>     complex
>>   . different versions of Aspell may introduce binary
>>     incompatibilities, whose accommodation in Emacs will complicate
>>     our own code

After some thought and research, the only sane way would be to use the
enchant C API.  It claims to be a wrapper around any spell backend
(ispell, aspell, hunspell, etc).  I can't help with this.  But maybe it
will motivate a soul.

> Ispell.el is quite creepy.  I'm working on some fixes.

Here's the creepiest thing so far, and I must share it so that it will
be properly discussed before I can send patches.

Ispell.el uses ascii characters for the user to choose the right
spelling suggestions.  This was probably OK in the pre-historic era of
ispell (the program), since it only suggests words with
Damerau–Levenshtein distance of 1.  Most of the time, there would be 10
or less suggestions, and that justifies why the documentation
erroneously states that the user must press a digit to choose the right
one.

In reality, the valid ascii characters are those starting at 0 (?0,
i.e. 48) up to ?~ (i.e. 126), minus the characters that are bound to
certain commands obviously.  It is like that since, at least, 1994.  I'm
surprised, to say the least.  Is it even possible to select, i.e. type,
a characters that is above ?~???

A few thoughts below.

Why is there a *Choices* buffer in the first place?  IMO, the
*Completions* buffer should be used.

If the old farts (no offence) insist on using *Choices*, then using
ascii characters is silly.  There should be a variable that gives an
upper-bound for spelling suggestions perhaps.  If that bound would be 10
by default, then just use the digits.  Otherwise, the characters used
should be latin lower-case english letters.  (Typing digits is hard).
Either one or two letters, depending on the number of suggestions.  That
gives as much as (expt 26 2) choices, which is more than enough.

Thoughts?


--
André A. Gomes
"Free Thought, Free World"



  reply	other threads:[~2021-11-16 19:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 14:42 ispell.el and pipes André A. Gomes
2021-11-16 15:22 ` Eli Zaretskii
2021-11-16 16:25   ` André A. Gomes
2021-11-16 19:40     ` André A. Gomes [this message]
2021-11-16 20:00       ` Eli Zaretskii
2021-11-16 20:40         ` André A. Gomes
2021-11-17  9:33           ` Robert Pluim
2021-11-17 10:57             ` tomas
2021-11-17 11:01             ` André A. Gomes
2021-11-17 11:08               ` Robert Pluim
2021-11-17 11:16                 ` André A. Gomes
2021-11-17 11:27                 ` tomas
2021-11-17 12:08             ` dick
2021-11-17 12:48               ` tomas
2021-11-17 12:48           ` Eli Zaretskii
2021-11-17 13:23             ` André A. Gomes
2021-11-17 14:18               ` Eli Zaretskii
2021-11-17 20:19                 ` André A. Gomes

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=87bl2jrisc.fsf@gmail.com \
    --to=andremegafone@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).