rougier / nano-modeline

GNU Emacs / N Λ N O Modeline
GNU General Public License v3.0
169 stars 29 forks source link

Blank modeline #64

Open coastline9897 opened 10 months ago

coastline9897 commented 10 months ago

Hello. I am on debian bookworm stable and emacs 28.2. I installed the package from elpa but the new modeline is blank. Screenshot from 2023-10-23 20-14-49 The empty gray bar at the top is supposed to be the new modeline. I see the following error in the Messages buffer. Screenshot from 2023-10-23 20-18-36 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. Screenshot from 2023-10-23 20-58-03 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?

rougier commented 9 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 ?)

coastline9897 commented 9 months ago

Yes, I am using version 1.0.1 and start it in text mode (nano-modeline-text-mode t).

rougier commented 9 months ago

When you start nano-modeline manually, it is your first command? Can you before toggle-debug-on-error?

coastline9897 commented 9 months ago

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)

rougier commented 9 months ago

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))

coastline9897 commented 9 months ago

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)

rougier commented 9 months ago

What about (facep 'nano-modeline--empty-face)?

coastline9897 commented 9 months ago

It returns [face unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified ...]

rougier commented 8 months ago

Weird. Can you try (face-remap-set-base 'header-line 'default)?

coastline9897 commented 8 months ago

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)

rougier commented 8 months ago

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.
coastline9897 commented 7 months ago

Yep, same for me.

rougier commented 7 months ago

What about (face-remap-add-relative 'escape-glyph 'highlight 'italic) (from the manual)

coastline9897 commented 7 months ago

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.

rougier commented 7 months ago

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))
coastline9897 commented 6 months ago

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.

rougier commented 6 months ago

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?

coastline9897 commented 6 months ago

Same error with emacs -q as well. Screenshot from 2024-02-20 16-31-04

coastline9897 commented 6 months ago

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.

rougier commented 6 months ago

Which one failed? All of them?

coastline9897 commented 6 months ago

Same as with my init file. First and second returned Wrong type argument: listp, default and third returned nil.

rougier commented 5 months ago

Does it happen if you test with emacs -q?

coastline9897 commented 5 months ago

Yes. The last screenshot (20 Feb 2024) was with emacs -q.

rougier commented 5 months ago

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?

coastline9897 commented 5 months ago

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.

rougier commented 4 months ago

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.

coastline9897 commented 4 months ago

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.