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 C7A9B431FAE for ; Tue, 17 Apr 2012 02:18:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 UaWfpiq6PsTA for ; Tue, 17 Apr 2012 02:18:02 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id ECE7D431FB6 for ; Tue, 17 Apr 2012 02:18:01 -0700 (PDT) Received: by lbdb5 with SMTP id b5so1767138lbd.26 for ; Tue, 17 Apr 2012 02:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=hUydSgWoNYFbA+Yje0poLpZRWcurdtkp2FenjtFNnBI=; b=q+2lqM0ARf8O9gOj/gRZhlaeQzNbc00X+jhc5p+KQY3X0+pHWPIOxYSVvsST/qkJCv sFk6Gts06iv1/aR6A9A28vxPmGhSsO1QbSWWcc33iKhhwSMjtVX5Iw9e9HfxMf91zf7a /LnP/bmieL1U2z0Thsh5gB/0O9KxeqTHENXwTkGRyUl0RD46JvN4aNlW45HrJXuJ4TXO zBDwLQKRwMpv13o/NozQangoCkFIhzYKhD5D46mRp4+7n31+Ud0edB9lEyY7b1owKMYe zR2B5RpsnbwqrJMomNU020SZbM8+VjG7PMkahgirJ65NZpUh+IsJzmrx46BJgOoi38Do inXQ== Received: by 10.112.26.197 with SMTP id n5mr6756248lbg.58.1334654280325; Tue, 17 Apr 2012 02:18:00 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id c3sm28125010lbg.6.2012.04.17.02.17.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Apr 2012 02:17:59 -0700 (PDT) From: Dmitry Kurochkin To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget In-Reply-To: References: User-Agent: Notmuch/0.12+104~gf9ad237 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Tue, 17 Apr 2012 13:16:10 +0400 Message-ID: <871unmoh0l.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 09:18:02 -0000 Jani Nikula writes: > Add support for putting point to a widget after refresh through a > hook. This approximates the old behaviour. I may be wrong, but this looks to me like a hack that cannot work well. See my first reply in the thread for ideas on how to better implement this functionality. Regards, Dmitry > --- > 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch