[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tabulated-list sort icon is reversed

From: Philippe Vaucher
Subject: Re: tabulated-list sort icon is reversed
Date: Fri, 1 Mar 2019 17:34:46 +0100

`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 ?▼)
    (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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]