From: Dmitry Gutov <dmitry@gutov.dev>
To: emacs-devel@gnu.org, Eshel Yaron <me@eshelyaron.com>
Subject: Re: master 47e313e9805: Unbind 'C-M-i' in Text mode
Date: Wed, 6 Dec 2023 01:26:41 +0200 [thread overview]
Message-ID: <75c363c1-0dfd-c223-74f1-d98af65b3094@gutov.dev> (raw)
In-Reply-To: <20231126103911.6CEAFC25D5B@vcs2.savannah.gnu.org>
Hi,
On 26/11/2023 12:39, Eli Zaretskii wrote:
> +;;;###autoload
> +(defun ispell-completion-at-point ()
> + "Word completion function for use in `completion-at-point-functions'."
> + (pcase (bounds-of-thing-at-point 'word)
> + (`(,beg . ,end)
> + (when (and (< beg (point)) (<= (point) end))
> + (let* ((word (buffer-substring-no-properties beg end))
> + (len (length word))
> + (inhibit-message t)
> + (all (cons word (ispell-lookup-words word)))
> + (cur all))
> + (while cur
> + (unless (string-prefix-p word (car cur))
> + (setcar cur (concat word (substring (car cur) len))))
> + (while (when-let ((next (cadr cur)))
> + (not (string-prefix-p word next t)))
> + (setcdr cur (cddr cur)))
> + (setq cur (cdr cur)))
> + (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.
next prev parent reply other threads:[~2023-12-05 23:26 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 [this message]
2023-12-06 7:53 ` Eshel Yaron
2023-12-06 12:45 ` Dmitry Gutov
2023-12-06 13:56 ` Eshel Yaron
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=75c363c1-0dfd-c223-74f1-d98af65b3094@gutov.dev \
--to=dmitry@gutov.dev \
--cc=emacs-devel@gnu.org \
--cc=me@eshelyaron.com \
/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).