GNU bug report logs - #70010
30.0.50; completion-preview-mode behaves mode-local, but is global

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Tue, 26 Mar 2024 15:54:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 30.1

Done: Eshel Yaron <me <at> eshelyaron.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eshel Yaron <me <at> eshelyaron.com>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 70010 <at> debbugs.gnu.org
Subject: bug#70010: 30.0.50; completion-preview-mode behaves mode-local, but is global
Date: Tue, 26 Mar 2024 20:10:28 +0100
Hello Philip,

Philip Kaludercic <philipk <at> posteo.net> writes:

> I tried to enable `completion-preview-mode' by adding
>
>   (setopt completion-preview-mode t)
>
> in my init, but it had not effect.

Indeed, it is a minor mode, so one normally enables it by calling the
function completion-preview-mode, perhaps interactively via M-x.

> When I check the implementation, I noticed that it modifies
> `post-command-hook' locally.  I think it would make sense to rename
> the current `completion-preview-mode' to
> `completion-preview-local-mode', and then use
> `define-globalized-minor-mode' to define `completion-preview-mode'.

We can add a global variant, although IMO the natural scope for
completion-preview-mode is per major mode: for some kinds of content you
want to have completion preview, and for others you may want it off.
Note that a necessary condition for completion-preview-mode to be useful
in a certain context is that completion-at-point is useful in that
context, since otherwise there's nothing to preview.

Therefore, I recommend enabling completion-preview-mode by adding it to
major mode hooks, such as prog-mode-hook or comint-mode-hook.
Admittedly, if you do want to enable it for all buffers, the major mode
hook approach would require adding it to four or five hooks, which is a
bit less elegant than enabling a global minor mode once.

So I suggest we keep completion-preview-mode local and add a global
variant, say, completion-preview-global-mode, for enabling it globally.
WDYT?


Best,

Eshel




This bug report was last modified 1 year and 51 days ago.

Previous Next


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