rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.52k stars 195 forks source link

Doesn't work with keycast: Wrong type argument: listp, "%-" #33

Closed chemtov closed 3 years ago

chemtov commented 3 years ago

Hi,

Using keycast like this:

(use-package keycast
  :config
  :ensure t)

When enabling keycast using M-x keycast I get:

keycast-mode: Wrong type argument: listp, "%-"

In nano I randomly tried this:

modified   nano-modeline.el
@@ -496,7 +496,7 @@
          (eq (window-in-direction 'below) (minibuffer-window))
          (not (window-in-direction 'below)))
          (with-current-buffer (window-buffer window)
-           (setq mode-line-format "%-"))
+           (setq mode-line-format '("%-")))
        (with-current-buffer (window-buffer window)
          (setq mode-line-format nil)))
 ;;      (if (window-in-direction 'above)
@@ -506,7 +506,7 @@
 (add-hook 'window-configuration-change-hook 'nano-modeline-update-windows)

 (setq eshell-status-in-modeline nil)
-(setq-default mode-line-format "%-")
+(setq-default mode-line-format '("%-"))
 (nano-modeline)

 (provide 'nano-modeline)

But then I got:

funcall-interactively: Wrong type argument: consp, nil
user-error: Cannot turn on keycast-mode.  mode-line-buffer-identification not found in mode-line-format.  Try customizing keycast-insert-after.

The keycast function is defined there https://github.com/tarsius/keycast/blob/master/keycast.el#L41-L52 but I'm not fluent enough in elisp to fix this.

chemtov commented 3 years ago

Eventually I tried:

(setq keycast-insert-after "%-")

No error, but no key cast into the modeline neither.

rougier commented 3 years ago

I think it has been fixed by https://github.com/rougier/nano-emacs/pull/31. I did not know the modeline was supposed to be a list.