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 02:58:16 +0000 Message-ID: <87sex3caif.fsf@posteo.net> References: <877ceftlof.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7899"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?Q?K=C3=A9vin?= Le Gouguec , help-gnu-emacs@gnu.org To: Justin Burkett Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 24 04:58:56 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 1sLZuy-0001rI-M2 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 24 Jun 2024 04:58:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLZuV-0000YE-PM; Sun, 23 Jun 2024 22:58:27 -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 1sLZuU-0000Xc-Bm for help-gnu-emacs@gnu.org; Sun, 23 Jun 2024 22:58:26 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLZuS-000484-A7 for help-gnu-emacs@gnu.org; Sun, 23 Jun 2024 22:58:26 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1B6D6240027 for ; Mon, 24 Jun 2024 04:58:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1719197899; bh=sMo+zfY5NEyWCkdN1qc0Oyl5rl0dSICa3HSnqYHEz3o=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=R0y2n/BtAYoWRVK2ZUYgyoIbWv0PO6s30V3GoYmPPz/V2n30X43BbpnP+nCvgXgOT 4rndEHTlk3yUtX4dF1HB3xpo7qQMTD/3y+EhFArfhiJykVV+mTpVn+1BWkSt8wP0RJ ZGsNOjvmYnMxI/EUyFHpCT3TBC2zkKVdsughYL0NOSLqg/1uUCz+IxCKlXA0OfgsNM c0djvrRpmgudQXWZbDPxWE4pr2R1rlTn3UQLVcjAxwzqRwlAxogO9cFy27+9PsWGzc 0gHXUO0VM0C3jCZw6cWnJn3nzWH//QUpO0MGdM0rrKEC5IY4pEiihFZETTb/sOfVSI 3EQ9w5BKyNCgA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W6t20651Vz9rxD; Mon, 24 Jun 2024 04:58:16 +0200 (CEST) In-Reply-To: (Justin Burkett's message of "Sun, 23 Jun 2024 21:44:44 -0400") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.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:146970 Archived-At: --=-=-= Content-Type: text/plain Justin Burkett writes: > Hi, > > First, don't set which-key-mode as a custom variable. This is a > function that should be called after which-key is loaded. That is actually fine, since every minor mode is also a user option. > For your original question, the important thing is that > which-key-dont-use-unicode is set before which-key is loaded. We can easily fix this by adding a custom setter: --=-=-= Content-Type: text/plain Content-Disposition: inline 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-ellipsis' `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") --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Using Emacs -Q and (setopt which-key-mode t ;loads which-key.el which-key-dont-use-unicode nil) I get the expected behaviour. > (c) > definitely won't work for this reason. The fact that (d) is working, > which takes this logic to the extreme, but the others are not suggests > that something is causing which-key to load before the variable is > set. > > Combining the two ideas, try > > (use-package which-key > :custom > (which-key-dont-use-unicode nil) > :config > (which-key-mode t)) > > If that doesn't work, look for another culprit that might be loading > which-key (perhaps because it depends on it) earlier. > > Justin > > On Sun, Jun 23, 2024 at 5:05=E2=80=AFPM K=C3=A9vin Le Gouguec > wrote: >> >> Hello! >> >> Paging help-gnu-emacs before filing a bug because I'm not sure of the >> intended behavior. After seeing 2024-06-18 "Disable usage of unicode >> for which-key by default" (cc0a3a5f65b), I promptly went to my .emacs to >> opt in to Unicode symbols, and was surprised to meet some resistance. >> >> In an Emacs built from 2024-06-23 "; Fix typos" (fb11294d415) on the >> emacs-30 branch, I tried >> >> (a) this .emacs: >> >> (use-package which-key >> :custom >> (which-key-dont-use-unicode nil) >> (which-key-mode t)) >> >> (b) this .emacs: >> >> (custom-set-variables >> '(which-key-dont-use-unicode nil) >> '(which-key-mode t)) >> >> (c) an empty .emacs, then >> >> M-x which-key-mode >> M-x toggle-option which-key-dont-use-unicode >> >> (d) a combination of this .emacs: >> >> (use-package which-key >> :custom >> (which-key-mode t)) >> >> with this .emacs.d/early-init.el: >> >> (setq which-key-dont-use-unicode nil) >> >> and only attempt (d) yielded which-key messages with '=E2=86=92' instead= of ':' >> for the separator symbol (resp. '=E2=80=A6' instead of '..' for truncat= ion). >> >> Wondering if I am doing something wrong (a definite possibility, the >> perils of juggling ${HOME}s for repro purposes), if (d) really is the >> intended way to effectively unset which-key-dont-use-unicode, or if this >> is a potential bug report or feature request? --=20 Philip Kaludercic on peregrine --=-=-=--