LoginSignup
1
1

More than 5 years have passed since last update.

ファイルを保存した時にFlymakeの結果をGrowlで通知する

Posted at

flymakeでエラーが検出されると通知される奴は自分には少しアクティブすぎたので保存した段階でエラーが検出されると通知されるようにした。

(when (executable-find "growlnotify")
  (defun flymake-growlnotify ()
    (let ((count (length flymake-err-info)))
      (when (> count 0)
        (dolist (err-info flymake-err-info)
          (let* ((line    (car err-info))
                 (text    (flymake-ler-text (caadr err-info)))
                 (title   (concat (buffer-name (current-buffer)) ":" (int-to-string line))))
            (start-process-shell-command "emacs-flymake" nil "growlnotify"
                                         "-a" "Emacs" "-n" "'Emacs - Flymake'" "-p" "2" "-s"
                                         "-t" title "-m" (shell-quote-argument text)))))))
  (add-hook 'after-save-hook 'flymake-growlnotify))

後会社ではimacで開発してるのでGrowlでEmacs - Flymakeの通知をMusic Videoにするとかなり目立つのでオススメ

flymake-after-save-hookが反応しなかったので普通にafter-save-hookで書いているけど想像したhookとは別なのだろうか。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1