unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron <me@eshelyaron.com>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: emacs-devel@gnu.org
Subject: Re: master 47e313e9805: Unbind 'C-M-i' in Text mode
Date: Wed, 06 Dec 2023 14:56:41 +0100	[thread overview]
Message-ID: <m1cyvjl9ie.fsf@sp-byods-145-109-54-47.wireless.uva.nl> (raw)
In-Reply-To: <4db81b72-9a95-0d66-d623-31002ecdff08@gutov.dev> (Dmitry Gutov's message of "Wed, 6 Dec 2023 14:45:27 +0200")

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

Dmitry Gutov <dmitry@gutov.dev> writes:

> On 06/12/2023 09:53, Eshel Yaron wrote:
>> Hi Dmitry,
>> Dmitry Gutov <dmitry@gutov.dev> writes:
>>
>>>> +(defun ispell-completion-at-point ()
>>>> +  "Word completion function for use in `completion-at-point-functions'."
>>>> [...]
>>>> +         (list beg end (cdr all)
>>>> +               :annotation-function (lambda (_) " Dictionary word")
>>>
>>> I have to say that "Dictionary word" is not a great annotation: it's
>>> long, longer than most of the completions coming from that backend, so
>>> these words, repeated, constitute most of the text inside the
>>> Completions buffer. And it's the same string for all completions.
>> I see what you mean.  How do you feel about the following
>> alternatives?
>> - "Word"
>> - "Dict"
>> - "Spell"/"Ispell"
>> - "🕮"
>> - No annotation at all
>> - One of the above, and make it configurable
>
> My preference would be "no annotation at all", if we're talking about
> simple solutions.

Fine by me.  I'm attaching a simple patch that does that.

> The fourth option was a newspaper emoji?

Well, it's supposed to be a book, you get it with `C-x 8 RET book RET`.

> I think the more comprehensive approach here would be to implement
> support for `:company-kind` in the default UI, and then return `text'
> in that function.

I agree, that would be nice in general and help here too.  For this case
I was also thinking about using the common part-of-speech of each word
as its annotation (e.g. "n" for nouns, "v" for verbs...) but we don't
get that information from the spelling dictionary, unfortunately.


Here's that patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Remove-long-annotation-for-word-completion-candidate.patch --]
[-- Type: text/x-patch, Size: 837 bytes --]

From 5055fd663b3e82d752ae7aa3d0cad5d0ea4f87a6 Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@eshelyaron.com>
Date: Wed, 6 Dec 2023 14:41:56 +0100
Subject: [PATCH] ; Remove long annotation for word completion candidates

* lisp/textmodes/ispell.el (ispell-completion-at-point): Remove
':annotation-function' from return value.
---
 lisp/textmodes/ispell.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 4c3b22281bd..2c387342026 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3699,7 +3699,6 @@ ispell-completion-at-point
              (setcdr cur (cddr cur)))
            (setq cur (cdr cur)))
          (list beg end (cdr all)
-               :annotation-function (lambda (_) " Dictionary word")
                :exclusive 'no))))))
 
 
-- 
2.42.0


  reply	other threads:[~2023-12-06 13:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <170099515102.15929.4538081255360222923@vcs2.savannah.gnu.org>
     [not found] ` <20231126103911.6CEAFC25D5B@vcs2.savannah.gnu.org>
2023-11-29 19:11   ` master 47e313e9805: Unbind 'C-M-i' in Text mode Arash Esbati
2023-11-30  6:07     ` Eli Zaretskii
2023-11-30  7:40       ` Arash Esbati
2023-11-30  8:41         ` Eli Zaretskii
2023-11-30 10:46           ` Arash Esbati
2023-11-30 17:17             ` Juri Linkov
2023-12-05 23:26   ` Dmitry Gutov
2023-12-06  7:53     ` Eshel Yaron
2023-12-06 12:45       ` Dmitry Gutov
2023-12-06 13:56         ` Eshel Yaron [this message]
2023-12-06 14:33           ` Dmitry Gutov

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=m1cyvjl9ie.fsf@sp-byods-145-109-54-47.wireless.uva.nl \
    --to=me@eshelyaron.com \
    --cc=dmitry@gutov.dev \
    --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).