From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.help Subject: Re: Setting 'which-key-dont-use-unicode' Date: Mon, 24 Jun 2024 07:12:27 +0000 Message-ID: <87frt2ddb8.fsf@posteo.net> References: <877ceftlof.fsf@gmail.com> <87sex3caif.fsf@posteo.net> <8734p2swml.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37978"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Justin Burkett , help-gnu-emacs@gnu.org To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 24 09:13:03 2024 Return-path: Envelope-to: geh-help-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 1sLdst-0009Yt-Ob for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 24 Jun 2024 09:13:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLdsS-0000Lr-RY; Mon, 24 Jun 2024 03:12:36 -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 1sLdsR-0000LP-Ey for help-gnu-emacs@gnu.org; Mon, 24 Jun 2024 03:12:35 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLdsO-0005Pg-Sq for help-gnu-emacs@gnu.org; Mon, 24 Jun 2024 03:12:35 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B63E2240104 for ; Mon, 24 Jun 2024 09:12:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719213150; bh=3fA1aZugN9e32X3WcBgc9TLiNYKn2VYOfAp1Aha/P/0=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=aw1XnAMqHiMu9Lkp/zyrTvpeWFHnrU9xP43+7EaYby6fBBrqJ+jJ7Ap10sINaLAqD kKRQ6AILnZNSNRiaw2XZYwTvFU9gswXWxg0ER+pyqVRpBkkU+fxRwyu1ZUukPHvmch ArGdz1u8SdUruIC6ZhXqdUdibIxLVj8MYyBKy2GhE48Xz+EQhLxpHjoOFFaDfkjFKh uC00dCe2j2c/uXnDi0ZoIiigxyo0VBrBbm5Mr7roBBowIh5vuGDIe84fHZoO1JEFXh ouACfoX/2KPWFa5LEMmds7Ul0sMwIWC1jtWSzdOQuzo4Ov3q4BFczWvJvRUeNJYHZY eSXWUWgWHuk5A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W6zgK44mhz6twB; Mon, 24 Jun 2024 09:12:28 +0200 (CEST) In-Reply-To: <8734p2swml.fsf@gmail.com> (=?utf-8?Q?=22K=C3=A9vin?= Le Gouguec"'s message of "Mon, 24 Jun 2024 08:06:10 +0200") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146974 Archived-At: K=C3=A9vin Le Gouguec writes: > Thank you both for the prompt responses! > > Philip Kaludercic writes: > >>> For your original question, the important thing is that >>> which-key-dont-use-unicode is set before which-key is loaded.=20 >> >> We can easily fix this by adding a custom setter: >> >> diff --git a/lisp/which-key.el b/lisp/which-key.el >> index e9567d262c6..33fa67e9bac 100644 >> --- a/lisp/which-key.el >> +++ b/lisp/which-key.el >> @@ -128,6 +128,11 @@ which-key-dont-use-unicode >> "If non-nil, don't use any unicode characters in default setup. >> For affected settings, see `which-key-replacement-alist', `which-key-el= lipsis' >> `which-key-separator'." >> + :set (lambda (sym val) >> + (prog1 (custom-set-default sym val) >> + (dolist (sym '(which-key-separator >> + which-key-ellipsis)) >> + (custom-set-default sym (custom-reevaluate-setting sym))))) >> :type 'boolean >> :package-version "1.0" :version "30.1") >>=20=20 >> >> >> Using Emacs -Q and >> >> (setopt which-key-mode t ;loads which-key.el >> which-key-dont-use-unicode nil) >> >> I get the expected behaviour. > > Thanks; I rebuilt emacs-30 (2024-06-24 "Fix omission of updates to child > frames on Android" (73a58329a69)) with this patch on top; AFAICT it lets > Emacs DTRT with all three "customization idioms", i.e. > > ;; Custom > (custom-set-variables > '(which-key-dont-use-unicode nil) > '(which-key-mode t)) > > ;; setopt > (setopt which-key-mode t > which-key-dont-use-unicode nil) > > ;; use-package > (use-package which-key > :custom > (which-key-dont-use-unicode nil) > (which-key-mode t)) > > And FWIW there does seem to be precedent for that approach: > e.g. ls-lisp-emulation's setter calls ls-lisp-set-options, which resets > all variables tagged :set-after '(ls-lisp-emulation)=E2=80=A6 except > ls-lisp-use-string-collate; wondering if that's intentional =F0=9F=A4=94 I think that was a mistake. `ls-lisp-emulation' was added in 2010, where all the options it reeevaluates already existed, and `ls-lisp-use-string-collate' was added in 2014, and it was forgotten to update `ls-lisp-set-options' as well. > (And now wondering if :set-after '(SYMS=E2=80=A6) should make this pattern > easier by storing the reverse dependency, e.g. in a new > 'custom-dependents property attached to each symbol in SYMS=E2=80=A6 Cou= ld that > make these setters easier to maintain?) > > Anyhoo; straying far from the original report. Thanks again for > confirming & proposing a fix! I have a few ideas on this topic, and we can gladly discuss it in a bug report. Until then I'll push a variation on the fix I proposed in my previous message, and close.... I just realised that this wasn't a bug report, so never mind that ^^ But if we discuss generalising this fix, we should do so in a proper bug report that is easy to link to. --=20 Philip Kaludercic on peregrine