From 84aee22426361a90f9bd328a645a91a5e428147e Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 17 Apr 2012 08:35:25 +0000 Subject: [PATCH] [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget --- 72/acfc07557416113866b55b78f5faf77570e692 | 107 ++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 72/acfc07557416113866b55b78f5faf77570e692 diff --git a/72/acfc07557416113866b55b78f5faf77570e692 b/72/acfc07557416113866b55b78f5faf77570e692 new file mode 100644 index 000000000..4ca039a62 --- /dev/null +++ b/72/acfc07557416113866b55b78f5faf77570e692 @@ -0,0 +1,107 @@ +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 D5B67431FC7 + for ; Tue, 17 Apr 2012 01:35:44 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +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 JBtSyiWSWup6 for ; + Tue, 17 Apr 2012 01:35:43 -0700 (PDT) +Received: from mail-qc0-f181.google.com (mail-qc0-f181.google.com + [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id DE4B6431FCB + for ; Tue, 17 Apr 2012 01:35:39 -0700 (PDT) +Received: by mail-qc0-f181.google.com with SMTP id k26so4608191qcs.26 + for ; Tue, 17 Apr 2012 01:35:39 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references + :in-reply-to:references:x-gm-message-state; + bh=9jyVHuPJah+agZjkc2BgwHJ1f4IInR1ml8EZTVVyC2Y=; + b=OPYzZYPDccarm1UJEFcpgzfg6jQsJtlSpGlYtUpJUt6mRJwdMqM65Nu6lEk0xIZhoJ + eRz1uj1pAMVkYrTV2BSB93uX/H2pTMWOCy9OdnraaJ9e5TEhahj4YQJZTdpOaOZIGLyz + 32VA3WBL4IYIEjfpAJniK61weJmHL53xpmGnhyoCOQ6t9VBLa7zwso1bFteFPCUNsUPn + rhhT7A9owdrBwvT7el6XwiZw3E2g0a5IseDum6EE6mtdV6GyZB9FdTkKXT4riNncmqBX + cOyZ9+/Ew/gxQqrpBinTSIsaDoH6AA0w1T1PP7maExl8LdP9SKvojIMBzVtOtiMYlywn + BpTw== +Received: by 10.229.137.147 with SMTP id w19mr5885686qct.132.1334651739517; + Tue, 17 Apr 2012 01:35:39 -0700 (PDT) +Received: from localhost (nikula.org. [92.243.24.172]) + by mx.google.com with ESMTPS id dx8sm30146864qab.5.2012.04.17.01.35.38 + (version=SSLv3 cipher=OTHER); Tue, 17 Apr 2012 01:35:38 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +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 +Message-Id: + +X-Mailer: git-send-email 1.7.1 +In-Reply-To: + +References: + +In-Reply-To: + +References: + +X-Gm-Message-State: + ALoCoQkbuKr3XjXeywYEX3SNAc8Dv2Xt46hFiApavYY2a23ViD9sJV3/VnQGuZUGlDsRkwnRXRag +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: Tue, 17 Apr 2012 08:35:45 -0000 + +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 + -- 2.26.2