GNU bug report logs - #20870
24.5; Options presented in ispell *Choices* should be accessible via keyboard

Previous Next

Package: emacs;

Reported by: Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>

Date: Mon, 22 Jun 2015 09:17:01 UTC

Severity: minor

Tags: wontfix

Found in version 24.5

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20870 in the body.
You can then email your comments to 20870 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20870; Package emacs. (Mon, 22 Jun 2015 09:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 22 Jun 2015 09:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 24.5; Options presented in ispell *Choices* should be accessible
 via keyboard
Date: Mon, 22 Jun 2015 11:08:12 +0200
When ispell offers more than 67 options in its buffer *Choices*, it uses keys
like ^? or \200 that are hard (or impossible) to enter via keyboard. Here is
an example of the *Choices* content in such a case, where Hunspell and a
German alternate dictionary was used to complete the word "Abf":

-----------------------------------------------------------------------------
(0) Abfälle  (1) Abfällen  (2) Abfahrt  (3) Abfahrten  (4) Abfahrtshänge
(5) Abfahrtshängen  (6) Abfahrtshang  (7) Abfahrtsläufer
(8) Abfahrtsläuferin  (9) Abfahrtsläuferinnen  (:) Abfahrtsläufern
(;) Abfahrtsrennen  (<) Abfahrtsstelle  (=) Abfahrtsstellen
(>) Abfahrtsstrecke  (@) Abfahrtsstrecken  (B) Abfall  (C) Abfalls
(D) Abfallaufbereitung  (E) Abfalleimer  (F) Abfalleimern
(G) Abfallgraben  (H) Abfallkurve  (I) Abfallkurven  (J) Abfallpapier
(K) Abfallpapiers  (L) Abfallprodukt  (M) Abfallprodukten
(N) Abfallprodukts  (O) Abfallproduktes  (P) Abfallstoffe
(Q) Abfallstoffen  (S) Abfangjäger  (T) Abfangjägern  (U) Abfangjägers
(V) Abfangrakete  (W) Abfangraketen  (Y) Abfassung  (Z) Abfassungen
([) Abfertigung  (\) Abfertigungen  (]) Abfertigungsschalter
(^) Abfertigungsschaltern  (_) Abfertigungsschalters
(`) Abfertigungsstelle  (b) Abfertigungsstellen  (c) Abfindung
(d) Abfindungen  (e) Abflachung  (f) Abflachungen  (g) Abflüge
(h) Abflügen  (j) Abflüsse  (k) Abflüssen  (n) Abflug  (o) Abflugs
(p) Abflugflughafen  (s) Abflugland  (t) Abfluß  (v) Abflusses
(w) Abfördermenge  (y) Abfördermengen  (z) Abfolge  ({) Abfolgen
(|) Abfragesprache  (}) Abfragesprachen  (~) Abführmittel
(^?) Abführmitteln  (\200) Abführmittels  (\201) Abführung
(\202) Abfüllanlage  (\203) Abfüllanlagen  (\204) Abfüllfiliale
(\205) Abfüllfilialen  (\206) Abfüllstation  (\207) Abfüllstationen
(\210) Abfuhr  (\211) Abfuhren
-----------------------------------------------------------------------------

It is not straight forward to reproduce this example, since it depends on
the chosen dictionary. But we can do it in laboratory conditions, if we
generate an artificial dictionary.

For that, just redirect the output of the following shell script to a file
that we call /tmp/dict:

-----------------------------------------------------------------------------
#!/bin/sh

letters="a b c d e f g h i"

for i in $letters; do
    for j in $letters; do
    echo "aaa$i$j"
    done
done
-----------------------------------------------------------------------------

With that we can go to Emacs:

* Open Emacs 24.5 via

     LC_ALL=C ./emacs -Q

* Load the ispell library: M-x load-library RET ispell RET

* Open customization buffer for variable ispell-alternate-dictionary:
  M-x customize-variable RET ispell-alternate-dictionary RET

* Enter /tmp/dict as the variable's value and accept it for the current
  session. (Remember: /tmp/dict is the dictionary that we just generated.)

* Make a new Buffer and call it "text": C-x b RET text RET

* Change major mode of this buffer to text-mode.

* Enter "aaa" (without quotes) in the first line of the buffer text.

* With point immediately after the third letter a, start ispell-complete-word
  by C-M-i.

This should bring you a *Choices* buffer with a contents like that:

------------------------------------------------------------
(0) aaaaa  (1) aaaab  (2) aaaac  (3) aaaad  (4) aaaae
(5) aaaaf  (6) aaaag  (7) aaaah  (8) aaaai  (9) aaaba
(:) aaabb  (;) aaabc  (<) aaabd  (=) aaabe  (>) aaabf
(@) aaabg  (B) aaabh  (C) aaabi  (D) aaaca  (E) aaacb
(F) aaacc  (G) aaacd  (H) aaace  (I) aaacf  (J) aaacg
(K) aaach  (L) aaaci  (M) aaada  (N) aaadb  (O) aaadc
(P) aaadd  (Q) aaade  (S) aaadf  (T) aaadg  (U) aaadh
(V) aaadi  (W) aaaea  (Y) aaaeb  (Z) aaaec  ([) aaaed
(\) aaaee  (]) aaaef  (^) aaaeg  (_) aaaeh  (`) aaaei
(b) aaafa  (c) aaafb  (d) aaafc  (e) aaafd  (f) aaafe
(g) aaaff  (h) aaafg  (j) aaafh  (k) aaafi  (n) aaaga
(o) aaagb  (p) aaagc  (s) aaagd  (t) aaage  (v) aaagf
(w) aaagg  (y) aaagh  (z) aaagi  ({) aaaha  (|) aaahb
(}) aaahc  (~) aaahd  (^?) aaahe  (\200) aaahf  (\201) aaahg
(\202) aaahh  (\203) aaahi  (\204) aaaia  (\205) aaaib
(\206) aaaic  (\207) aaaid  (\210) aaaie  (\211) aaaif
(\212) aaaig  (\213) aaaih  (\214) aaaii
------------------------------------------------------------

which shows the problem.

Juergen

 		 	   		  



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20870; Package emacs. (Sat, 27 Jun 2015 10:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 20870 <at> debbugs.gnu.org (full text, mbox):

From: Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>
To: "20870 <at> debbugs.gnu.org" <20870 <at> debbugs.gnu.org>
Subject: RE: bug#20870: 24.5; [PATCH] Options presented in ispell *Choices*
 should be accessible via keyboard
Date: Sat, 27 Jun 2015 12:36:13 +0200
[Message part 1 (text/plain, inline)]
The attached patch tries to offer a workaround for this bug and to provide a
feature that was asked for by Emanuel Berg in

   http://lists.gnu.org/archive/html/help-gnu-emacs/2015-06/msg00363.html

i.e. that Ispell uses certain keys in a certain order for the offers in its
*Choices* buffer.

Therefore, the idea is to use a customizable variable to hold a vector of key
specifications that are used by ispell-command-loop in the given order to
assemble its options.

The patch alters ispell-command-loop accordingly introducing
ispell-option-keys as that customizable variable. Its default value is chosen
such, that the first keys in the vector are digits and lowercase letters,
since these are directly accessible on most keyboards without using any
modifiers.

As a minor detail the patch defines the inline function ispell-insert-choices
to hold some code that is used repetitively in ispell-command-loop.

The patch applies to the version of ispell.el that was shipped with the Emacs
24.4 release. And that is also the Emacs version the patch was tested on.

Juergen

 		 	   		  
[choices-patch.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20870; Package emacs. (Sat, 27 Jun 2015 11:48:02 GMT) Full text and rfc822 format available.

Message #11 received at 20870 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>
Cc: 20870 <at> debbugs.gnu.org
Subject: Re: bug#20870: 24.5;
 [PATCH] Options presented in ispell *Choices* should be
 accessible	via keyboard
Date: Sat, 27 Jun 2015 14:47:28 +0300
> From: Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>
> Date: Sat, 27 Jun 2015 12:36:13 +0200
> 
> The attached patch tries to offer a workaround for this bug and to provide a
> feature that was asked for by Emanuel Berg in
> 
>    http://lists.gnu.org/archive/html/help-gnu-emacs/2015-06/msg00363.html
> 
> i.e. that Ispell uses certain keys in a certain order for the offers in its
> *Choices* buffer.
> 
> Therefore, the idea is to use a customizable variable to hold a vector of key
> specifications that are used by ispell-command-loop in the given order to
> assemble its options.

Thanks, but isn't it better to simply use numbers longer than one
digit?  E.g., if the number of choices is more than 10, use 00, 01,
etc.; if the number of choices is more than 100, use 000, 001,
etc., and so on and so forth?  Bonus points for being able to support
responses like 1 and 10 when the number of choices is more than 100
(but this is a nicety, not really required IMO).

I just cannot imagine anyone in the need for customizing this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20870; Package emacs. (Sun, 28 Jun 2015 05:03:01 GMT) Full text and rfc822 format available.

Message #14 received at 20870 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>,
 20870 <at> debbugs.gnu.org
Subject: Re: bug#20870: 24.5;
 [PATCH] Options presented in ispell *Choices* should be
 accessible	via keyboard
Date: Sun, 28 Jun 2015 01:02:08 -0400
> Thanks, but isn't it better to simply use numbers longer than one
> digit?  E.g., if the number of choices is more than 10, use 00, 01,
> etc.; if the number of choices is more than 100, use 000, 001,
> etc., and so on and so forth?  Bonus points for being able to support
> responses like 1 and 10 when the number of choices is more than 100
> (but this is a nicety, not really required IMO).

That's right.  And we can even combine these numbers with other schemes
(e.g. ido/icomplete/avy style selection) if we want.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20870; Package emacs. (Tue, 25 Aug 2020 09:08:01 GMT) Full text and rfc822 format available.

Message #17 received at 20870 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com>,
 20870 <at> debbugs.gnu.org
Subject: Re: bug#20870: 24.5; [PATCH] Options presented in ispell *Choices*
 should be accessible	via keyboard
Date: Tue, 25 Aug 2020 11:07:29 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Therefore, the idea is to use a customizable variable to hold a vector of key
>> specifications that are used by ispell-command-loop in the given order to
>> assemble its options.
>
> Thanks, but isn't it better to simply use numbers longer than one
> digit?  E.g., if the number of choices is more than 10, use 00, 01,
> etc.; if the number of choices is more than 100, use 000, 001,
> etc., and so on and so forth?  Bonus points for being able to support
> responses like 1 and 10 when the number of choices is more than 100
> (but this is a nicety, not really required IMO).
>
> I just cannot imagine anyone in the need for customizing this.

I think that would be a better interface, too, so the patch isn't ideal,
and I'm closing this bug report.  If somebody wants to work on Eli's
suggestion, a new bug report would perhaps be appropriate.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 09:08:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 20870 <at> debbugs.gnu.org and Jürgen Hartmann <juergen_hartmann_ <at> hotmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Aug 2020 09:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Sep 2020 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.