From: Dmitry Kurochkin Date: Sun, 18 Dec 2011 00:21:18 +0000 (+0400) Subject: test: add `notmuch-hello-mode-hook-counter' X-Git-Tag: 0.11_rc1~20 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=33735c28a42d8b4a5432507430aa0000bc9d4ada;p=notmuch test: add `notmuch-hello-mode-hook-counter' 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. --- diff --git a/test/test-lib.el b/test/test-lib.el index 97ae5938..3bca1382 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -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)