]> git.cworth.org Git - obsolete/notmuch-wiki/blobdiff - emacstips.mdwn
contributing: tabs to spaces -- we get nice 4-char indentation
[obsolete/notmuch-wiki] / emacstips.mdwn
index fa0810470387b9a5a6effcbe269413c69635e5f0..8c8e1688c54fcefb33e7851cf6e6065806b0f337 100644 (file)
@@ -147,6 +147,29 @@ Then, add to `.emacs`:
 
         (autoload 'notmuch "~/.emacs.d/my-notmuch" "notmuch mail" t)
 
+## Initial cursor position in notmuch 0.15 hello window
+
+In notmuch version 0.15 emacs client the handling of cursor position in
+notmuch hello window has been simplified to a version which suits best
+most cases.
+
+Initially the cursor is positioned at the beginning of buffer.
+
+Some users liked the "ancient" version where cursor was moved to the
+first `Saved searches` button.
+
+Add the following code to your notmuch emacs configuration file in
+case you want this behaviour:
+
+        (add-hook 'notmuch-hello-refresh-hook
+                  (lambda ()
+                    (if (and (eq (point) (point-min))
+                             (search-forward "Saved searches:" nil t))
+                        (progn
+                          (forward-line)
+                          (widget-forward 1))
+                      (if (eq (widget-type (widget-at)) 'editable-field)
+                          (beginning-of-line)))))
 
 ## Add a key binding to add/remove/toggle a tag