unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello buffer
@ 2012-01-17 19:34 Dmitry Kurochkin
  2012-01-17 19:34 ` [PATCH 2/3] emacs: use a single history for all searches Dmitry Kurochkin
                   ` (4 more replies)
  0 siblings, 5 replies; 28+ messages in thread
From: Dmitry Kurochkin @ 2012-01-17 19:34 UTC (permalink / raw)
  To: notmuch

Before the change, "s" in notmuch-hello buffer would jump to the
search box.  The patch changes the binding to `notmuch-search' which
is consistent with all other notmuch buffers.
---
 emacs/notmuch-hello.el |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 02017ce..08fcd22 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -29,9 +29,6 @@
 (declare-function notmuch-search "notmuch" (query &optional oldest-first target-thread target-line continuation))
 (declare-function notmuch-poll "notmuch" ())
 
-(defvar notmuch-hello-search-bar-marker nil
-  "The position of the search bar within the notmuch-hello buffer.")
-
 (defcustom notmuch-recent-searches-max 10
   "The number of recent searches to store and display."
   :type 'integer
@@ -321,11 +318,6 @@ should be. Returns a cons cell `(tags-per-line width)'."
 	(widget-insert "\n"))
     found-target-pos))
 
-(defun notmuch-hello-goto-search ()
-  "Put point inside the `search' widget."
-  (interactive)
-  (goto-char notmuch-hello-search-bar-marker))
-
 (defimage notmuch-hello-logo ((:type png :file "notmuch-logo.png")))
 
 (defun notmuch-hello-search-continuation()
@@ -355,7 +347,7 @@ should be. Returns a cons cell `(tags-per-line width)'."
     (define-key map "G" 'notmuch-hello-poll-and-update)
     (define-key map (kbd "<C-tab>") 'widget-backward)
     (define-key map "m" 'notmuch-mua-new-mail)
-    (define-key map "s" 'notmuch-hello-goto-search)
+    (define-key map "s" 'notmuch-search)
     map)
   "Keymap for \"notmuch hello\" buffers.")
 (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
@@ -468,7 +460,8 @@ Complete list of currently available key bindings:
       (widget-insert " messages.\n"))
 
     (let ((found-target-pos nil)
-	  (final-target-pos nil))
+	  (final-target-pos nil)
+	  (search-bar-pos))
       (let* ((saved-alist
 	      ;; Filter out empty saved searches if required.
 	      (if notmuch-show-empty-saved-searches
@@ -500,7 +493,7 @@ Complete list of currently available key bindings:
 	    (indent-rigidly start (point) notmuch-hello-indent)))
 
 	(widget-insert "\nSearch: ")
-	(setq notmuch-hello-search-bar-marker (point-marker))
+	(setq search-bar-pos (point-marker))
 	(widget-create 'editable-field
 		       ;; Leave some space at the start and end of the
 		       ;; search boxes.
@@ -589,7 +582,7 @@ Complete list of currently available key bindings:
 	(when notmuch-saved-searches
 	  (widget-insert "Edit saved searches with the `edit' button.\n"))
 	(widget-insert "Hit RET or click on a saved search or tag name to view matching threads.\n")
-	(widget-insert "`=' refreshes this screen. `s' jumps to the search box. `q' to quit.\n")
+	(widget-insert "`=' refreshes this screen. `s' to search messages. `q' to quit.\n")
 	(let ((fill-column (- (window-width) notmuch-hello-indent)))
 	  (center-region start (point))))
 
@@ -601,7 +594,7 @@ Complete list of currently available key bindings:
 	  (widget-forward 1)))
 
       (unless (widget-at)
-	(notmuch-hello-goto-search))))
+	(goto-char search-bar-pos))))
 
   (run-hooks 'notmuch-hello-refresh-hook))
 
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2012-01-26 14:13 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 19:34 [PATCH 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello buffer Dmitry Kurochkin
2012-01-17 19:34 ` [PATCH 2/3] emacs: use a single history for all searches Dmitry Kurochkin
2012-01-18  8:25   ` David Edmondson
2012-01-18 17:57     ` Dmitry Kurochkin
2012-01-18 18:18       ` David Edmondson
2012-01-17 19:34 ` [PATCH 3/3] emacs: bind "s" to `notmuch-hello-search' in notmuch-hello buffer Dmitry Kurochkin
2012-01-18  8:26   ` David Edmondson
2012-01-17 21:22 ` [PATCH 1/3] emacs: bind "s" to `notmuch-search' " Jani Nikula
2012-01-17 21:29   ` Dmitry Kurochkin
2012-01-26 13:48   ` Pieter Praet
2012-01-26 14:13     ` Jani Nikula
2012-01-18  8:20 ` David Edmondson
2012-01-18 20:22 ` [PATCH v2 0/3] emacs: notmuch-hello search cleanup Dmitry Kurochkin
2012-01-18 20:22   ` [PATCH v2 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello buffer Dmitry Kurochkin
2012-01-18 20:22   ` [PATCH v2 2/3] emacs: use a single history for all searches Dmitry Kurochkin
2012-01-18 20:22   ` [PATCH v2 3/3] emacs: bind "s" to `notmuch-hello-search' in notmuch-hello buffer Dmitry Kurochkin
2012-01-19  8:12   ` [PATCH v2 0/3] emacs: notmuch-hello search cleanup David Edmondson
2012-01-23 23:48   ` [PATCH v3 " Dmitry Kurochkin
2012-01-23 23:48     ` [PATCH v3 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello buffer Dmitry Kurochkin
2012-01-23 23:48     ` [PATCH v3 2/3] emacs: use a single history for all searches Dmitry Kurochkin
2012-01-23 23:48     ` [PATCH v3 3/3] emacs: bind "s" to `notmuch-hello-search' in notmuch-hello buffer Dmitry Kurochkin
2012-01-24 15:17     ` [PATCH v3 0/3] emacs: notmuch-hello search cleanup David Edmondson
2012-01-24 15:43     ` Austin Clements
2012-01-25  1:10     ` [PATCH v4 " Dmitry Kurochkin
2012-01-25  1:10       ` [PATCH v4 1/3] emacs: bind "s" to `notmuch-search' in notmuch-hello buffer Dmitry Kurochkin
2012-01-25 12:46         ` David Bremner
2012-01-25  1:10       ` [PATCH v4 2/3] emacs: use a single history for all searches Dmitry Kurochkin
2012-01-25  1:10       ` [PATCH v4 3/3] emacs: bind "s" to `notmuch-hello-search' in notmuch-hello buffer Dmitry Kurochkin

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).