Closed moyotar closed 7 years ago
I assume you mean https://github.com/hbin/molokai-theme/.
Try adding
(list '(:eval (list (nyan-create))))
somewhere in the molokai-theme-kit.el in between other stuff set in the mode line. Of course ensure nyan-mode is loaded before molokai-theme-kit.el.
I followed it and got errors.
Debugger entered--Lisp error: (wrong-type-argument symbolp (list (quote (:eval (list (nyan-create)))))) (setq-default mode-line-format (list " " (quote (:eval (propertize "%b " (quote face) (quote font-lock-keyword-face) (quote help-echo) (buffer-file-name)))) "(" (propertize "%l" (quote face) (quote font-lock-type-face)) "," (propertize "%c" (quote face) (quote font-lock-type-face)) ") " "[" (propertize "%p" (quote face) (quote font-lock-constant-face)) "/" (propertize "%I" (quote face) (quote font-lock-constant-face)) "] " "[" (quote (:eval (propertize "%m" (quote face) (quote font-lock-string-face) (quote help-echo) buffer-file-coding-system))) "] " "[" (quote (:eval (propertize (if overwrite-mode "Ovr" "Ins") (quote face) (quote font-lock-preprocessor-face) (quote help-echo) (concat "Buffer is in " (if overwrite-mode "overwrite" "insert") " mode")))) (quote (:eval (when (buffer-modified-p) (concat "," (propertize "Mod" (quote face) (quote font-lock-warning-face) (quote help-echo) "Buffer has been modified"))))) (quote (:eval (when buffer-read-only (concat "," (propertize "RO" (quote face) (quote font-lock-type-face) (quote help-echo) "Buffer is read-only"))))) "] " (quote (:eval (propertize (format-time-string "%H:%M") (quote help-echo) (concat (format-time-string "%c; ") (emacs-uptime "Uptime:%hh"))))) " --" "%-") (list (quote (:eval (list (nyan-create))))))
Try just:
(:eval (list (nyan-create)))
Or better yet, post the whole code that you use to change mode-line-format
.
eval-buffer: Wrong type argument: symbolp, (:eval (list (nyan-create)))
This try failed again. And this is the whole code in molokai-theme-kit.el
.
(require 'linum)
(setq linum-format "%4d ")
(toggle-indicate-empty-lines nil)
;;
;; mode-line
;;
;; http://emacs-fu.blogspot.com/2011/08/customizing-mode-line.html
(setq-default mode-line-format
(list
;; the buffer name; the file name as a tool tip
" " '(:eval (propertize "%b " 'face 'font-lock-keyword-face 'help-echo (buffer-file-name)))
;; line and column
"(" (propertize "%l" 'face 'font-lock-type-face) "," (propertize "%c" 'face 'font-lock-type-face) ") "
;; relative position, size of file
"[" (propertize "%p" 'face 'font-lock-constant-face) "/" (propertize "%I" 'face 'font-lock-constant-face) "] "
;; the current major mode for the buffer.
"[" '(:eval (propertize "%m" 'face 'font-lock-string-face 'help-echo buffer-file-coding-system)) "] "
"[" ;; insert vs overwrite mode, input-method in a tooltip
'(:eval (propertize (if overwrite-mode "Ovr" "Ins")
'face 'font-lock-preprocessor-face
'help-echo (concat "Buffer is in "
(if overwrite-mode "overwrite" "insert") " mode")))
;; was this buffer modified since the last save?
'(:eval (when (buffer-modified-p)
(concat "," (propertize "Mod"
'face 'font-lock-warning-face
'help-echo "Buffer has been modified"))))
;; is this buffer read-only?
'(:eval (when buffer-read-only
(concat "," (propertize "RO"
'face 'font-lock-type-face
'help-echo "Buffer is read-only"))))
"] "
;; add the time, with the date and the emacs uptime in the tooltip
'(:eval (propertize (format-time-string "%H:%M")
'help-echo
(concat (format-time-string "%c; ")
(emacs-uptime "Uptime:%hh"))))
" --"
;; i don't want to see minor-modes; but if you want, uncomment this:
;; minor-mode-alist ;; list of minor modes
"%-" ;; fill with '-'
)
(:eval (list (nyan-create)))
)
(provide 'molokai-theme-kit)
"[" ;; insert vs overwrite mode, input-method in a tooltip
'(:eval (propertize (if overwrite-mode "Ovr" "Ins")
'face 'font-lock-preprocessor-face
'help-echo (concat "Buffer is in "
(if overwrite-mode "overwrite" "insert") " mode")))
;; was this buffer modified since the last save?
'(:eval (when (buffer-modified-p)
(concat "," (propertize "Mod"
'face 'font-lock-warning-face
'help-echo "Buffer has been modified"))))
;; is this buffer read-only?
'(:eval (when buffer-read-only
(concat "," (propertize "RO"
'face 'font-lock-type-face
'help-echo "Buffer is read-only"))))
"] "
;; add the time, with the date and the emacs uptime in the tooltip
'(:eval (propertize (format-time-string "%H:%M")
'help-echo
(concat (format-time-string "%c; ")
(emacs-uptime "Uptime:%hh"))))
" --"
;; i don't want to see minor-modes; but if you want, uncomment this:
;; minor-mode-alist ;; list of minor modes
"%-" ;; fill with '-'
)
(:eval (list (nyan-create)))
)
(provide 'molokai-theme-kit)
You're putting it in a wrong place. Try putting it after " --"
, on the same list level.
Thanks! It works.
I want to make both of molokai-theme-kit(a mode-line theme) and nyan work. How to do this?