From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Philippe Vaucher Newsgroups: gmane.emacs.devel Subject: Re: tabulated-list sort icon is reversed Date: Fri, 1 Mar 2019 17:34:46 +0100 Message-ID: References: <87d0v1lsns.fsf@fastmail.fm> <532F6D74-E21C-45A2-B85B-01133DE1E8A1@scratch.space> <6e662c5b-3d04-2157-6712-aadcb6077f2b@gmail.com> <83a7j0pzbh.fsf@gnu.org> <83sgwpm92r.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b1170d05830afdfc" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="214819"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 01 17:39:01 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzlBc-000tfo-RW for ged-emacs-devel@m.gmane.org; Fri, 01 Mar 2019 17:39:01 +0100 Original-Received: from localhost ([127.0.0.1]:40438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzlBb-0003nQ-Oa for ged-emacs-devel@m.gmane.org; Fri, 01 Mar 2019 11:38:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzl81-0001sF-FG for emacs-devel@gnu.org; Fri, 01 Mar 2019 11:35:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzl7z-0008Ko-J2 for emacs-devel@gnu.org; Fri, 01 Mar 2019 11:35:17 -0500 Original-Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:43415) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzl7z-0008HG-7o for emacs-devel@gnu.org; Fri, 01 Mar 2019 11:35:15 -0500 Original-Received: by mail-lj1-x22f.google.com with SMTP id z20so20928716ljj.10 for ; Fri, 01 Mar 2019 08:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PewPpUjoKsaDNcUoVRiQFtohY98mjMCm9dag78PBpZ0=; b=Hpumb9LQ0DDVSMFfzXhtKG0eN8WxMJpjokhPuO6eZ7aJlwc9AE9yhanOi80m87yLIg k+lxlXS7B8uNWogIl6MlCqRMp8pUMApuZM9wKl4w6QNl5CKTtQjMmyeIAvfQdqgnra+p +AQ+8gUHoEN+Hy6xMdp1uesbszqHIxhw2WCdfh6MUOzgT8VFz9KOgmHgtwAmlmlH366y Osp0K8wKQ3B9HiPZs1OqSy7YeAtUaQnOblx1sBodhPLt+cXn6ZC7gXSNlRzS/3fiq+2a /oAdI0dPSy1dm9ZogH469D8ViH0G41+MsY64CIORRZG9mT2Y2AfpX9LVT0cQkFnW32fP 7ZQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PewPpUjoKsaDNcUoVRiQFtohY98mjMCm9dag78PBpZ0=; b=hjdZprZke6BGXy/4J5SrGbJ1c0eBhKMxg1kC1b8B2HbzEmyEQNMD7Rl4H+ttrtGPDI wJwU0OcisGkFEdoGiHz2ampMwopklM6MzzqjKZQpfMLxUgU39RMFPLbcLxbNKwwSEdTh FIZ4hNKmGPXbMdsCFplIrpXrLbYz4SP/bt6rXX5++9WLhNuiv7dn34Ak24NaZ1QulfVS Mrn2ZhFkcmebbyccghrXOwqinDWgGJ9x/nRS455n83rT31DVuFpV7SeQcMZU7JRCbhCP qxLdmeW6CoBSuFCMjHLBNb1oWepPG9bg1X5lqiQkxXd4bHUBwYmyLIdVMPbfVMGMQAbS qUhA== X-Gm-Message-State: APjAAAX+QYGOjFQzngXxIYVbIn/jebG7vIhMs9b0WWpTtAtkFiDPqLEl NNhqu0kymDQWv7POJCdOLO9BMVWU1YY8PyPFeuc= X-Google-Smtp-Source: APXvYqxnvcSLaUK5Iuf6rdRhvIthydleylEUia9Jdrk7/76OLtiPnkZUV5LkNrwhql7o8C3zWgY5n4yhdW3+cFXRyx8= X-Received: by 2002:a2e:91d4:: with SMTP id u20mr3482033ljg.54.1551458112705; Fri, 01 Mar 2019 08:35:12 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233738 Archived-At: --000000000000b1170d05830afdfc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > `eval-buffer` will evaluate (defvar ...) in the normal way, which does > *nothing* if the variable is already defined. > Aaaah, with your explanations it clicked. I tested with "emacs -Q" and though tabulated-list was not loaded before my eval-buffer, but I just checked and it is. So we have a problem in the sense that we cannot actually tweak this character through the defcustom like it is done currently: (defcustom tabulated-list-sort-icon-asc ?=E2=96=BC) (defcustom tabulated-list-glyphless-sort-icon-asc ?v) .... (defvar tabulated-list-glyphless-char-display (let ((table (make-char-table 'glyphless-char-display nil))) (aset table tabulated-list-sort-icon-asc (cons nil (char-to-string tabulated-list-glyphless-sort-icon-asc))) I can imagine two solutions: either we make `tabulated-list-glyphless-char-display` "dynamic" everytime it is accessed (is that even possible?) or we do some magic that resets it whenever the custom value changes. Feel free to point me to "the right thing" I have no clue. > So I suspect that "re-eval the whole ..." above meant to use C-M-x which > has special support for `defvar` to force re-evaluation. > Yes this is what I used, ok thanks for the explanation a lot of other weirdnesses make sense now :-) > > Should `make-char-table` purpose really be 'glyphless-char-display? > > Of course, that's what it's for. This "purpose" should be thought > of as a type. > Alright. Thanks, Philippe --000000000000b1170d05830afdfc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
`eval-buffer= ` will evaluate (defvar ...) in the normal way, which does
*nothing* if the variable is already defined.

Aaaah, with your explanations it clicked. I tested with "emacs = -Q" and though tabulated-list was not loaded before my eval-buffer, bu= t I just checked and it is.

So we have a problem i= n the sense that we cannot actually tweak this character through the defcus= tom like it is done currently:

=C2=A0 =C2=A0 = (defcustom tabulated-list-sort-icon-asc ?=E2=96=BC)
=C2=A0 = =C2=A0 (defcustom tabulated-list-glyphless-sort-icon-asc ?v)
= =C2=A0 =C2=A0 ....
=C2=A0 =C2=A0(defvar tabulated-list-glyph= less-char-display
=C2=A0 =C2=A0 =C2=A0(let ((table (make-char-tab= le 'glyphless-char-display nil)))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0(aset table tabulated-list-sort-icon-asc (cons nil (char-to-string ta= bulated-list-glyphless-sort-icon-asc)))

I can = imagine two solutions: either we make `tabulated-list-glyphless-char-displa= y` "dynamic" everytime it is accessed (is that even possible?) or= we do some magic that resets it whenever the custom value changes.

Feel free to point me to "the right thing" I ha= ve no clue.
=C2=A0
So I suspect that "re-eval the whole ..." above mean= t to use C-M-x which
has special support for `defvar` to force re-evaluation.

Yes this is what I used, ok thanks for the explanation a = lot of other weirdnesses make sense now :-)
=C2=A0
> Should `make-char-table` purp= ose really be 'glyphless-char-display?

Of course, that's what it's for.=C2=A0 This "purpose" sho= uld be thought
of as a type.

Alright.

Thanks,
Philippe
--000000000000b1170d05830afdfc--