]> git.cworth.org Git - obsolete/notmuch-wiki/commitdiff
emacstips: initial cursor position in 0.15 notmuch hello window
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 20 Jan 2013 03:59:22 +0000 (05:59 +0200)
committerTomi Ollila <tomi.ollila@iki.fi>
Sun, 20 Jan 2013 03:59:22 +0000 (05:59 +0200)
emacstips.mdwn

index fa0810470387b9a5a6effcbe269413c69635e5f0..5eef0f96ce2dd81e45dffb804e4e28c52618a4a4 100644 (file)
@@ -147,6 +147,28 @@ Then, add to `.emacs`:
 
         (autoload 'notmuch "~/.emacs.d/my-notmuch" "notmuch mail" t)
 
+## 0.15: Initial cursor position in notmuch hello window
+
+In notmuch 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 in 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