Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank modeline #64

Open
coastline9897 opened this issue Oct 23, 2023 · 27 comments
Open

Blank modeline #64

coastline9897 opened this issue Oct 23, 2023 · 27 comments

Comments

@coastline9897
Copy link

coastline9897 commented Oct 23, 2023

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
Copy link
Owner

rougier commented Nov 16, 2023

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
Copy link
Author

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

@rougier
Copy link
Owner

rougier commented Nov 22, 2023

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

@coastline9897
Copy link
Author

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
Copy link
Owner

rougier commented Dec 4, 2023

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
Copy link
Author

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
Copy link
Owner

rougier commented Dec 6, 2023

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

@coastline9897
Copy link
Author

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

@rougier
Copy link
Owner

rougier commented Dec 13, 2023

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

@coastline9897
Copy link
Author

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
Copy link
Owner

rougier commented Jan 9, 2024

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
Copy link
Author

Yep, same for me.

@rougier
Copy link
Owner

rougier commented Jan 22, 2024

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

@coastline9897
Copy link
Author

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
Copy link
Owner

rougier commented Feb 5, 2024

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
Copy link
Author

coastline9897 commented Feb 16, 2024

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
Copy link
Owner

rougier commented Feb 19, 2024

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
Copy link
Author

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

@coastline9897
Copy link
Author

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
Copy link
Owner

rougier commented Feb 26, 2024

Which one failed? All of them?

@coastline9897
Copy link
Author

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

@rougier
Copy link
Owner

rougier commented Mar 18, 2024

Does it happen if you test with emacs -q?

@coastline9897
Copy link
Author

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

@rougier
Copy link
Owner

rougier commented Mar 19, 2024

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
Copy link
Author

coastline9897 commented Mar 20, 2024

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
Copy link
Owner

rougier commented Apr 29, 2024

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants