help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to enter for example \200 offered by ispell in its buffer *Choic


From: Jürgen Hartmann
Subject: RE: How to enter for example \200 offered by ispell in its buffer *Choices*
Date: Sat, 27 Jun 2015 13:34:53 +0200

Thank you Oleh Krehel for your suggestion:

> The selection itself should be possible to achieve with avy.el
> (https://elpa.gnu.org/packages/avy.html). It extends to as many
> candidates as you can fit on a screen, and the decision chars are
> composed of a user-defined set, e.g. "a", "s", "d", "fa", "fs", "fd".

The package avy.el seems to provide the tools for a very professional
solution for such kind of issues.

> In case the
> dictionary is "[a-zA-Z]", it's likely that most candidates can be
> selected with just one char, just like with `ispell' currently.

I don't think that short key sequences would be a big obstacle here. After
all, they are easier to perform than C-M-AltGr-something-else-<single key>,
which would be the necessary if one tries to map many options to a rather
limited number of single keys. So this also pleads for avy.el.

> Here's a crude (but working) implementation:
>
> (defun ispell-command-loop (miss guess word start end)
> (let ((wnd (selected-window)))
> (pop-to-buffer "*avy-ispell*")
> (erase-buffer)
> (insert (mapconcat #'identity miss " "))
> (setq truncate-lines nil)
> (avy-goto-word-0 nil)
> (let ((selected (thing-at-point 'word)))
> (select-window wnd)
> selected)))

Good enough to show the principle.

> Maybe someone interested and more knowledgeable about ispell.el could
> refine this implementation.

That would be great. Unfortunately I am not able to do that myself, but I
have posted a crude workaround for the issues at hand in

   http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-06/msg00981.html

that is by far not so professional as an avy.el solution would be.

Juergen

                                          


reply via email to

[Prev in Thread] Current Thread [Next in Thread]