rougier / nano-modeline

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

Incompatible with eldoc in mode-line #36

Closed DamienCassou closed 2 years ago

DamienCassou commented 2 years ago

When nano-modeline is at the top, eldoc stops showing eldoc messages.

How to reproduce:

  1. Start Emacs with emacs -Q
  2. type M-: (string-trim
  3. the mode-line contains the signature of the string-trim function
  4. load nano-modeline and enable it
  5. do step 2 again

expected: the signature of the string-trim function appears somewhere actual: no signature appears

This is because eldoc-minibuffer-message changes mode-line-format but nano-modeline (when nano-modeline-position is top) only displays the header-line.

Possible solutions:

  1. temporarily displaying the mode-line in this scenario and letting eldoc shows its stuff in it
  2. copying the value that eldoc writes in the mode-line to the header-line

I can investigate a PR if you tell me what solution you have in mind.

rougier commented 2 years ago

I confirm the behavior but I think it is an abuse of the modeline. Why not emitting a message that would appear next to the command line?

DamienCassou commented 2 years ago

I think it is an abuse of the modeline

could be but this is how Emacs maintainers have implemented it. Fortunately, there is a eldoc-message-function variable that nano-modeline could override to show the information in a different place (but where?).

Why not emitting a message that would appear next to the command line?

What do you mean by "the command line"?

rougier commented 2 years ago

I meant the minibuffer. When you display a message when the minbuffer is active, it is displayed next to the text.

DamienCassou commented 2 years ago

When you display a message when the minbuffer is active, it is displayed next to the text.

I forgot about that. Then the solution is simple:

(setq eldoc-message-function #'message)

It seems to work well.

rougier commented 2 years ago

Can you make a PR to set it or do we let the user do it?

DamienCassou commented 2 years ago

What do you think about PR #38?