Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 04E1C409DF8 for ; Wed, 19 May 2010 01:53:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iFpGc1beXrQB for ; Wed, 19 May 2010 01:53:43 -0700 (PDT) Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com [209.85.219.213]) by olra.theworths.org (Postfix) with ESMTP id DEA914196F2 for ; Wed, 19 May 2010 01:53:42 -0700 (PDT) Received: by ewy5 with SMTP id 5so1814149ewy.0 for ; Wed, 19 May 2010 01:53:41 -0700 (PDT) Received: by 10.213.57.136 with SMTP id c8mr3261408ebh.5.1274259221225; Wed, 19 May 2010 01:53:41 -0700 (PDT) Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com [83.217.165.81]) by mx.google.com with ESMTPS id 16sm3523041ewy.3.2010.05.19.01.53.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 May 2010 01:53:39 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id 3F675594099; Wed, 19 May 2010 08:03:45 +0100 (BST) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH 01/13] emacs: Usability improvements for `notmuch-hello'. Date: Wed, 19 May 2010 08:03:28 +0100 Message-Id: <1274252620-1249-2-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274252620-1249-1-git-send-email-dme@dme.org> References: <1274252620-1249-1-git-send-email-dme@dme.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2010 08:53:55 -0000 - If no saved searches exist or are displayed, don't signal an error, - If no saved searches exist or are displayed, leave the cursor in the search bar, - Minor layout improvements. --- emacs/notmuch-hello.el | 36 +++++++++++++++++++----------------- 1 files changed, 19 insertions(+), 17 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 6a1c56e..1358387 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -273,7 +273,7 @@ diagonal." (notmuch-hello-update)) :help-echo "Refresh" (car (process-lines notmuch-command "count"))) - (widget-insert " messages (that's not much mail).\n\n")) + (widget-insert " messages (that's not much mail).\n")) (let ((found-target-pos nil) (final-target-pos nil)) @@ -292,7 +292,7 @@ diagonal." (widest (max saved-widest alltags-widest))) (when saved-alist - (widget-insert "Saved searches: ") + (widget-insert "\nSaved searches: ") (widget-create 'push-button :notify (lambda (&rest ignore) (customize-variable 'notmuch-saved-searches)) @@ -305,18 +305,16 @@ diagonal." (setq final-target-pos found-target-pos)) (indent-rigidly start (point) notmuch-hello-indent))) - (let ((start (point))) - (widget-insert "\nSearch: ") - (setq notmuch-hello-search-bar-marker (point-marker)) - (widget-create 'editable-field - ;; Leave some space at the start and end of the - ;; search boxes. - :size (max 8 (- (window-width) (* 2 notmuch-hello-indent) - (length "Search: "))) - :action (lambda (widget &rest ignore) - (notmuch-hello-search (widget-value widget)))) - (widget-insert "\n") - (indent-rigidly start (point) notmuch-hello-indent)) + (widget-insert "\nSearch: ") + (setq notmuch-hello-search-bar-marker (point-marker)) + (widget-create 'editable-field + ;; Leave some space at the start and end of the + ;; search boxes. + :size (max 8 (- (window-width) notmuch-hello-indent + (length "Search: "))) + :action (lambda (widget &rest ignore) + (notmuch-hello-search (widget-value widget)))) + (widget-insert "\n") (when notmuch-hello-recent-searches (widget-insert "\nRecent searches: ") @@ -408,9 +406,13 @@ diagonal." (widget-setup) - (goto-char final-target-pos) - (if (not (widget-at)) - (widget-forward 1))))) + (when final-target-pos + (goto-char final-target-pos) + (unless (widget-at) + (widget-forward 1))) + + (unless (widget-at) + (notmuch-hello-goto-search))))) ;;;###autoload (defun notmuch-folder () -- 1.7.1