From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Andr=C3=A9_A=2E_Gomes?= Newsgroups: gmane.emacs.devel Subject: Re: ispell.el and pipes Date: Tue, 16 Nov 2021 22:40:19 +0300 Message-ID: <87bl2jrisc.fsf@gmail.com> References: <875yssrwk2.fsf@gmail.com> <83ee7g15yf.fsf@gnu.org> <871r3grrtd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13166"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 16 20:46:02 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mn4P4-0003CU-53 for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Nov 2021 20:46:02 +0100 Original-Received: from localhost ([::1]:47782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mn4P2-0001Yj-2v for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Nov 2021 14:46:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mn4Je-0003nv-11 for emacs-devel@gnu.org; Tue, 16 Nov 2021 14:40:26 -0500 Original-Received: from [2a00:1450:4864:20::233] (port=39891 helo=mail-lj1-x233.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mn4Jc-00059f-3j; Tue, 16 Nov 2021 14:40:25 -0500 Original-Received: by mail-lj1-x233.google.com with SMTP id t11so805509ljh.6; Tue, 16 Nov 2021 11:40:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=qZWCBxV3bz9fgar8bZykDeh56zeZXPOQoYZsFJXwNnk=; b=feJXTmWLI/XwCXIzLbQHTh2XRJCJru10z+axApTePSSsUcRjRTPn59UcyiH5Gqu4N9 WMSWyVmyukCA2PUpdmFv1waBnzVJV/By1Ksj7/TQgOhQlxdPIm3GmhDcLjyDz8UxYB22 BfNUkYuZxALp/1LHRDF+cpditQMuuOXNYLl6H2eEgRAGjMvOE+LmTaKEcxzgvs2jXhSs HbZalfAXSnNbohMBppByglnyEyp4BEMMFbNhpPIzYWg4RdEDsc/Qb9HCE8gVnkoXn46T d44EubrCLadwjAZ+Cmxu4DAZkL1S8VNI5wcZB8VXqH+IExucwYnV3EZ6qBaMAo62gci6 nXTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=qZWCBxV3bz9fgar8bZykDeh56zeZXPOQoYZsFJXwNnk=; b=GKIvWnql1Ko9G9RRBdtN4rIQyhPRJNREisOkXktVO/vXT3no7rMuheDxrwKfckEx7C I1fYtCkpSO61vJE3KDovMMq8of9DxGC0jIEEXSAki6X4R9k1MCVdu+q6OHLztFJDkXip 2qA+yxtJNqINyNIXUElKSmU2JfJd9YQLR39opOOrhk8ul2tq5BoG3Kp//l5ZU2IngZmw /VR663hZI2cvhZECCx4pGOVYT+JVGaE0VR9BzEVRLk878C6n9wEC+5uaUu5bUnK8dhPs 3FJDWis35K1tOAZt27NbKc3dyW5Po3w6//ViVUqboDHVElklxa/WsgCQOao2tBHNeiah Q2ug== X-Gm-Message-State: AOAM533JC/nVe0G+yNyxDARQEphTQxxPwKgjjLU/RUHL5UsBWaumwy7x RazMalD+MQCZqfFrcW8WsWeNwyOc4Cg= X-Google-Smtp-Source: ABdhPJxaXWgtP6ZFc9BCK2W45O+Fb1C2jB6j9HgeFDGAdODCW3zxAFf/ymo/1m0Tvfaruj4BxrsEhQ== X-Received: by 2002:a2e:a404:: with SMTP id p4mr1792762ljn.78.1637091621166; Tue, 16 Nov 2021 11:40:21 -0800 (PST) Original-Received: from guix-xps13 ([89.113.47.146]) by smtp.gmail.com with ESMTPSA id 18sm1009692ljd.73.2021.11.16.11.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 11:40:20 -0800 (PST) In-Reply-To: <871r3grrtd.fsf@gmail.com> (=?utf-8?Q?=22Andr=C3=A9?= A. Gomes"'s message of "Tue, 16 Nov 2021 19:25:18 +0300") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::233 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=andremegafone@gmail.com; helo=mail-lj1-x233.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279581 Archived-At: Andr=C3=A9 A. Gomes writes: > Eli Zaretskii writes: > >>> From: Andr=C3=A9 A. Gomes >>> 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=E2=84=A2 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=E2=80=93Levenshtein distance of 1. Most of the time, there would b= e 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=C3=A9 A. Gomes "Free Thought, Free World"