[RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

Subject: [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget

Date: Tue, 17 Apr 2012 08:35:25 +0000

To: notmuch@notmuchmail.org

Cc:

From: Jani Nikula


Add support for putting point to a widget after refresh through a
hook. This approximates the old behaviour.
---
 emacs/notmuch-hello.el |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 13da146..07e64d4 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -148,7 +148,8 @@ International Bureau of Weights and Measures."
 (defcustom notmuch-hello-refresh-hook nil
   "Functions called after updating a `notmuch-hello' buffer."
   :type 'hook
-  :options '(notmuch-hello-refresh-status-message)
+  :options '(notmuch-hello-refresh-status-message
+	     notmuch-hello-refresh-point-to-widget)
   :group 'notmuch-hello
   :group 'notmuch-hooks)
 
@@ -752,6 +753,11 @@ Used internally by `notmuch-hello-refresh-status-message'.")
 		       (notmuch-hello-nice-number (- diff-count))))))
       (setq notmuch-hello-refresh-count new-count))))
 
+(defun notmuch-hello-refresh-point-to-widget (no-display)
+  "Hook to place point to widget after notmuch-hello refresh."
+  (widget-backward 1)
+  (widget-forward 1))
+
 ;;;###autoload
 (defun notmuch-hello (&optional no-display)
   "Run notmuch and display saved searches, known tags, etc."
-- 
1.7.1


Thread: