From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68929: [PATCH] Copy which-key from GNU ELPA into core Date: Thu, 08 Feb 2024 11:10:44 -0500 Message-ID: References: <871q9rvqbi.fsf@jeremybryant.net> <86wmrj148c.fsf@gnu.org> <87plx8rkps.fsf@jeremybryant.net> <86cyt7xyy7.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18916"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 68929@debbugs.gnu.org, Jeremy Bryant To: Justin Burkett Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 08 17:12:19 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 1rY70c-0004fg-MP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Feb 2024 17:12:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rY70F-00088F-LM; Thu, 08 Feb 2024 11:11:55 -0500 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 1rY709-00087y-VX for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 11:11:49 -0500 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 1rY708-0001fJ-3Z for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 11:11:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rY70L-00051s-Ne for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 11:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Feb 2024 16:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68929 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68929-submit@debbugs.gnu.org id=B68929.170740866919269 (code B ref 68929); Thu, 08 Feb 2024 16:12:01 +0000 Original-Received: (at 68929) by debbugs.gnu.org; 8 Feb 2024 16:11:09 +0000 Original-Received: from localhost ([127.0.0.1]:33460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rY6zU-00050j-Rz for submit@debbugs.gnu.org; Thu, 08 Feb 2024 11:11:09 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rY6zT-00050X-9k for 68929@debbugs.gnu.org; Thu, 08 Feb 2024 11:11:07 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C8C3F10009E; Thu, 8 Feb 2024 11:10:46 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1707408645; bh=S4czLC5j8UhjLXxZ+60CIIzTtokCWOJSPO6O89MNSSg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Jn+uznqh71iBoQKlAzgYYDsgmHLh6oQIQMY+5Wnp87ilKnxzreX4An8QWYtl+QjRS uaepsMrZbqMb2WDUsSP5eNBbdqvr5VNz/451CSXBz9MlC+2B33+3WiVVaAeUnlq5Ze r8QdWJKCLmGvi2sui8i36V+01XaDBpclO8Y0ySYjOUjpnTNtg0eO5KqsdCm1YxZq4s f6esgqP0XhAlZ8fcV5Jn51+ERsatUZ9NDeHwN5Z5qhJppV6SLy7IYCgUWAIoC3L+8D XAeFSsHslBiIVx1PkuH+XWo7WiKYJm5EdiCoe43n7c8Sl/f95Oe82Tx5EU9El7hkro gq3/c20FEBiWg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CF3CA10001D; Thu, 8 Feb 2024 11:10:45 -0500 (EST) Original-Received: from pastel (unknown [104.247.238.113]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A1A9312032C; Thu, 8 Feb 2024 11:10:45 -0500 (EST) In-Reply-To: (Justin Burkett's message of "Thu, 8 Feb 2024 10:42:15 -0500") 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:279644 Archived-At: > 1. I think replacing third-party support with hooks that will allow > whatever package to insert code where needed is a good idea, although > some of these packages (like evil) have some pretty idiosyncratic > needs if I remember correctly. Indeed, resolving such issues can be non-trivial (especially when they require synchronization with other packages). Often we end up doing it in two steps: first introduce the hook (making sure that it is flexible enough that it can cover our needs and those of other packages), then later remove the ad-hoc third-party support. > 3. There were some oddities that we ran into early on around computing > the width of unicode characters that I did not fully understand, which > is why there are some clunky options for those. The main issue was > some characters came out wider than anticipated, breaking the width > calculations for the table shown by which-key. I would be happy to > improve those with guidance. For monospace fonts, `string-width` *should* give you the information you need. > 4. I never really liked the timer mechanism either, but I didn't find > an alternative to detecting when emacs was in the middle of reading a > key sequence. I like the idea of which-key as simply being a different > describe-prefix-bindings function, but my sense is that novices > appreciate the automatic popup. I'm wondering if anyone has any other > ideas. In principle, one could have a hook that emacs uses to notify > which-key that emacs is waiting on a key sequence, but maybe that is > overkill. I don't have a strong opinion about the use of a timer. But maybe we could hook into the `echo-keystrokes` mechanism (and thus reuse its timer, which also defaults to 1s). Stefan