Closed domtronn closed 7 years ago
I can't seem to reproduce this for windows greater than one? (see the below screenshot)
However, it does seem to throw errors when the window numbers reach 10, I'll look into a fix for this :)
Just updated all of my melpa packages, including all-the-icons
and spaceline-all-the-icons
but the issue remains.
Works fine with other spaceline-all-the-icons-set-window-number
values though :-(
Reinstalled material-icon
just to be sure and played with all-the-icons-window-number
.
Error during redisplay: (eval (spaceline-ml-all-the-icons)) signaled (wrong-type-argument listp (:height 1.2 :inherit)) [16 times]
It comes from https://github.com/domtronn/spaceline-all-the-icons.el/blob/master/spaceline-all-the-icons-segments.el#L374-L398 where plist-put
has wrong argument type.
Removing these two lines, I get the expected result !
Before:
After:
Do you mind a PR ?
Hmm, I don't think this is the expected behaviour though... 😞
You need the plist-put ... :family
in order to set the correct font family to display the icon with, otherwise you run the risk of the system choosing some other unicode character instead of the material-design
icon.
I'm not sure why it won't let you do the plist-put
though? What result do you get when you call
(plist-put '(:height 1.0 :inherit) :family "foo")
It shouldn't error and should return...
(:height 1.0 :family "foo" :inherit)
Basically, plist-put
should allow list
type arguments for the plist value (see the docs for plist-put
)
Change value in PLIST of PROP to VAL.
PLIST is a property list, which is a list of the form (PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object. If PROP is already a property on the list, its value is set to VAL, otherwise the new PROP VAL pair is added. The new plist is returned; use ‘(setq x (plist-put x prop val))’ to be sure to use the new value. The PLIST is modified by side effects.
Completely agree with you ! Just trying to isolate the bug.
Here is the result using C-x C-e
in the scratch buffer. At least it is consistent with the previous one ;-)
That's weird! It works for me 😅 What version of Emacs do you use and what's the result when you (describe-function 'plist-put)
?
The alternative would be to replace the plist-put
s with (setq face (append face '(:family ...)))
, much more verbose, but achieves the same thing :/
But you're right, it'd be nice to understand/isolate why this is happening
As shown in the screenshot: 26.0.50. describe-function
doesn't complain. I do not understand the behaviour then. My emacs-lisp fu is awful, but it seems like a syntax error when it comes to quoting the lists or so ...
Interesting.. I'm still on Emacs 25.1, I'm going to install a copy of emacs-plus
mentioned in your Prolusion ReadMe - Maybe they've changed the implementation/definition of plist-put
?
That way I can confirm if it's the Emacs Version that's the problem 🙂 I'll let you know shortly 👍
Looks like the list isn't changed in place, and that the result should be reafected. What about your plist-put
description ? What about your emacs version ?
I've looked for deprecation, but nothing is mentioned. Quite surprising for emacs API.
I can't install emacs-plus
because my XCode is out of date, and I can't upgrade it on this Mac at the moment... 😒 So yeah, I'd be happy with a PR to swap the plist-put
for append
, or I can pick it up later/tomorrow?
There are 12 occurrences of plist-put
. I can try and update them all (since my anzu-mode is working now ;-)).
Should I update them all ?
And by the way, according to https://www.gnu.org/software/emacs/manual/html_node/elisp/Plist-Access.html, wouldn't it be more appropriate to setq face (plist-put ...)
instead of using append
?
That would be great if you've got time, otherwise I'll pick this up when I get some time tomorrow.
And yes, you'll need to do both... Because the setq
isn't going to stop the error you're getting with incorrect argument type listp, so I would suggest changing all plist-put
calls from
(plist-put 'face :property val)
;; to
(setq face (append '(:property val) 'face))
Bear in mind, that for values that need to be computed i.e. with a function call, you'll need to use backticks and commas to denote a list that has elements that need evaluating, for example
(setq face (append `(:family ,(all-the-icons-material-family)) 'face))
(Quoted @jwintz #7)