Open coastline9897 opened 10 months ago
Sorry for long delay. Most probably left
that is given as argument of nano-modeline--make is nil such that when it is evaluated, emacs complains it misses one argument (I think). Do you use the lateste GitHub version and how do you start if (which mode ?)
Yes, I am using version 1.0.1 and start it in text mode (nano-modeline-text-mode t)
.
When you start nano-modeline manually, it is your first command? Can you before toggle-debug-on-error
?
Yes, it is the first command. Here is the debugger output.
Debugger entered--Lisp error: (wrong-type-argument listp nano-modeline--empty-face) face-remap-set-base(header-line nano-modeline--empty-face) nano-modeline-header(((nano-modeline-buffer-status) " " (nano-modeline-buffer-name) " " (nano-modeline-git-info)) ((nano-modeline-cursor-position) (nano-modeline-window-dedicated)) t) nano-modeline-text-mode(t) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) command-execute(eval-last-sexp)
Can you evaluate (using M-:
): (face-remap-set-base 'header-line 'nano-modeline--empty-face)
and (face-remap-set-base 'header-line '(nano-modeline--empty-face))
Same error on both.
Debugger entered--Lisp error: (wrong-type-argument listp nano-modeline--empty-face) face-remap-set-base(header-line (nano-modeline--empty-face)) eval-expression((face-remap-set-base 'header-line '(nano-modeline--empty-face)) nil nil 127) funcall-interactively(eval-expression (face-remap-set-base 'header-line '(nano-modeline--empty-face)) nil nil 127) command-execute(eval-expression)
What about (facep 'nano-modeline--empty-face)
?
It returns [face unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified ...]
Weird. Can you try (face-remap-set-base 'header-line 'default)
?
Sorry for delay.
Debugger entered--Lisp error: (wrong-type-argument listp default) face-remap-set-base(header-line default) eval-expression((face-remap-set-base 'header-line 'default) nil nil 127) funcall-interactively(eval-expression (face-remap-set-base 'header-line 'default) nil nil 127) command-execute(eval-expression)
What is the documentation of face-remap-set-base
for you ? Mine is:
Signature
(face-remap-set-base FACE &rest SPECS)
Documentation
Set the base remapping of FACE in the current buffer to SPECS.
This causes the remappings specified by face-remap-add-relative
to apply on top of the face specification given by SPECS.
The remaining arguments, SPECS, specify the base of the remapping.
Each one of SPECS should be either a face name or a property list
of face attribute/value pairs, like in a face text property.
If SPECS is empty or a single face eq to FACE, call face-remap-reset-base
to use the normal definition of FACE as the base remapping; note that
this is different from SPECS containing a single value nil, which means
not to inherit from the global definition of FACE at all.
Yep, same for me.
What about (face-remap-add-relative 'escape-glyph 'highlight 'italic)
(from the manual)
This function is working. I am not sure how to check whether escape-glyph face changed, so I tried the other example in the manual (face-remap-add-relative 'default :height 1.5)
and the text height increased. Let me know if you want me to try the first example in particular.
Sorry for delay. Another try:
(face-remap-set-base 'header-line 'default)
(face-remap-set-base 'header-line '(default))
(face-remap-set-base 'header-line '(:inherit default))
The first two return the same error, i.e., Wrong type argument: listp, default
. The third one returns nil
and the blank modeline disappears (or maybe changes background colour to buffer background thereby "disappearing" or being invisible?) in that particular buffer.
I'm a bit at loss, especially for the second line. The argument is a list and yet emacs complains it is not. Can you try the same with emacs -q
just to make sure there isn't a package that interfere?
Same error with emacs -q as well.
I am assuming this is a generic function call that should run fine on any setup. If so, it is strange that it is returning an error on mine. Since it is happening even on stock emacs without my init settings, maybe this has to do with something specific to my setup outside emacs, however crazy that sounds? You can stop looking into it if you want, since this might be specific to me. We can keep this issue open and see if anyone else comes in with the same issue. I am open to keep trying things you suggest as well if you are okay to continue this exploratory back and forth.
Which one failed? All of them?
Same as with my init file. First and second returned Wrong type argument: listp, default
and third returned nil
.
Does it happen if you test with emacs -q
?
Yes. The last screenshot (20 Feb 2024) was with emacs -q
.
On your last screenshot, do you know why the debug trace ends with nil nil 127
? If I try:
(face-remap-set-base 'default ft)
I get
Debugger entered--Lisp error: (void-variable ft)
(face-remap-set-base 'default ft)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
command-execute(eval-last-sexp)
Do you get the exact smae message or do you still have the nil nil 127
?
I still have nil nil 127
for (face-remap-set-base 'default ft)
too.
I am not sure what the nil nil 127
is. I tried googling and didn't find anything relevant, but I found that it is present even in examples in the manual. See the third codeblock in this page on debugging for example. https://www.gnu.org/software/emacs/manual/html_node/eintr/debug.html
Maybe something to do my emacs version? Mine is 28.2 from the debian stable repository.
Another try (in the terminal):
emacs -q --eval "(face-remap-set-base 'default 'bold)"
You should have an emacs with bold text only. If this does not work, you'll need to open a bug report or ask on Reddit or Stack Overflow because I'm a bit out of options. Maybe there's something obvious I don't see.
Wrong type argument: listp, bold
. Same error again.
I will try at other places and see. One other option is to see if this goes away once debian stable upgrades to emacs 29. I will update here if I find out something. Thanks for your effort looking into this.
Hello. I am on debian bookworm stable and emacs 28.2. I installed the package from elpa but the new modeline is blank.
The empty gray bar at the top is supposed to be the new modeline. I see the following error in the Messages buffer.
It looks related to the modeline issue, so I googled and understood that the error means mapconcat is expecting 2 arguments but it is getting some other number of arguments. Let me know if I'm wrong. I looked at the definition of mapconcat and it has 2 arguments, function and sequence, and 1 optional separator argument. I went to the elisp file and to the section where this sexp in error is.
As can be seen in the above image, my cursor is on the sequence argument as the echo area says and lines 257-260 is the function argument. I googled what ",left" means and it says the comma means lisp should evaluate it and replace it with the value, which is what I can see in the error in the Messages buffer, the left is replaced with a constant list. I don't understand elisp enough yet to understand what the lambda function is doing but looks like mapconcat is getting 2 arguments as expected right? What am I missing here?