実行させると、下の図のようにカーソルの移動ごとにモードラインが変化します。
パッケージ化などしていないので、遊び終わったら一番下のS式を評価して片付けてください。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let ((i 0)) | |
(unless (get 'mode-line-format 'save) | |
(setf (get 'mode-line-format 'save) mode-line-format)) | |
(defun u-nya- () | |
(let ((pattern '("(」・ω・)」うー!" | |
"(/・ω・)/にゃー!" | |
"(」・ω・)」うー!" | |
"(/・ω・)/にゃー!" | |
"(」・ω・)」うー!" | |
"(/・ω・)/にゃー!" | |
"Let's\(・ω・)/にゃー!") | |
)) | |
(setq mode-line-format (concat (get 'mode-line-format 'save) " " (nth i pattern))) | |
(setq i (rem (1+ i) (length pattern))))) | |
(add-hook '*post-command-hook* 'u-nya-)) | |
;; お片づけ | |
(progn | |
(delete-hook '*post-command-hook* 'u-nya-) | |
(setf mode-line-format (get 'mode-line-format 'save))) |
てか、半年ぶりの更新がこれだよ!