From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70010: 30.0.50; completion-preview-mode behaves mode-local, but is global Date: Tue, 26 Mar 2024 20:10:28 +0100 Message-ID: References: <87o7b1gsfp.fsf@posteo.net> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11355"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 70010@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 26 20:11:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rpCCl-0002jE-OS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Mar 2024 20:11:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpCCO-0008VY-5G; Tue, 26 Mar 2024 15:11:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpCCM-0008VL-GI for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 15:11:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpCCM-00017l-8V for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 15:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpCCL-00078v-KG for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 15:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Mar 2024 19:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70010 X-GNU-PR-Package: emacs Original-Received: via spool by 70010-submit@debbugs.gnu.org id=B70010.171148023427367 (code B ref 70010); Tue, 26 Mar 2024 19:11:01 +0000 Original-Received: (at 70010) by debbugs.gnu.org; 26 Mar 2024 19:10:34 +0000 Original-Received: from localhost ([127.0.0.1]:35054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpCBt-00077K-SR for submit@debbugs.gnu.org; Tue, 26 Mar 2024 15:10:34 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:59962 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpCBr-000778-50 for 70010@debbugs.gnu.org; Tue, 26 Mar 2024 15:10:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1711480230; bh=2JqozA6KKvcsBor1Amc1wRtjHDD1FRbfmInTHklC6C8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SvQpm7er/5O14As9yFZ/GFnWk/H84rV4G9XR6/h37n9V/T3OUIaZ9RyzbFlljirh1 EW1KOy7S5KTar7NhjBvp2QQsuFXl9bD8eBoxdk9cnY32S9nfVW9Z5kCNKg146gdwDe p3PaqEVmGkgKrt/gvXN27hHGCz2wqkaudnkVJ0T3VZPf4X7sA4pLMI0+icVUUdtqFP I61VmQ8DeNtSGl62wqnik3DinodTEzEmE4QSNPRHoAoOUCsF8+QQKWgj4UZziyhwmZ HI8dXAxFhKaP3Gk4S2YiJNgyBwoIrM31PH1OHP6gkbFpQf2ob7cmmDgDBIrmg84jq4 HIV3GpYYe4kfg== In-Reply-To: <87o7b1gsfp.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 26 Mar 2024 11:10:02 +0000") X-Hashcash: 1:20:240326:philipk@posteo.net::GrRKz88lnWz77Rx7:6B1R X-Hashcash: 1:20:240326:70010@debbugs.gnu.org::RSRy8g5U8Agbtj1J:32oO X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282105 Archived-At: Hello Philip, Philip Kaludercic 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