]> rtime.felk.cvut.cz Git - notmuch.git/commitdiff
test: add `notmuch-hello-mode-hook-counter'
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Sun, 18 Dec 2011 00:21:18 +0000 (04:21 +0400)
committerDavid Bremner <bremner@debian.org>
Tue, 20 Dec 2011 11:41:51 +0000 (07:41 -0400)
Add `notmuch-hello-mode-hook-counter' hook to count how many times
`notmuch-hello-mode-hook' was called.  The counter function increments
`notmuch-hello-mode-hook-counter' variable value if it is bount,
otherwise it does nothing.

test/test-lib.el

index 97ae5938da62a42eb778c626429783350bca93d8..3bca1382bc386a618a867c789bafea25d3e8f18c 100644 (file)
@@ -61,3 +61,12 @@ running, quit if it terminated."
   (if (not (process-attributes pid))
       (kill-emacs)
     (run-at-time "1 min" nil 'orphan-watchdog pid)))
+
+(defun notmuch-hello-mode-hook-counter ()
+  "Count how many times `notmuch-hello-mode-hook' is called.
+Increments `notmuch-hello-mode-hook-counter' variable value if it
+is bound, otherwise does nothing."
+  (if (boundp 'notmuch-hello-mode-hook-counter)
+      (setq notmuch-hello-mode-hook-counter
+           (1+ notmuch-hello-mode-hook-counter))))
+(add-hook 'notmuch-hello-mode-hook 'notmuch-hello-mode-hook-counter)