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 EC4E3431FB6 for ; Tue, 17 Apr 2012 02:39:04 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 mznhgNfTAXqU for ; Tue, 17 Apr 2012 02:39:01 -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 205B2431FAE for ; Tue, 17 Apr 2012 02:39:01 -0700 (PDT) Received: by qcsk26 with SMTP id k26so4638238qcs.26 for ; Tue, 17 Apr 2012 02:39:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type:x-gm-message-state; bh=bsGv5q6ei3tbgBTSC50ZRzS/yPrawFYCzUzN4/jmAas=; b=Ng0X64m6mT5k3Q6ATESHfXS0l+JiX5OEHwWZnteGK8SsZCBNinSrYCr2dgOH8zSwR2 btbji+gGbgPd/Pj+MYAy5QLGMxGEyD/XatxkGXUngrmfS9ATcbdn9loMfW1Whx73L3Z/ WActgZ9p7KfZMF29Vxg2x3usg1u9JlGZ9Q4zWYJ8mLgZ4RCkSoRnSgZJvz1kUgIY+Xiv q6KpA3bnWOlkoHZyCdXiYl+iaELn4p92LCrcSx7uoOF2AGkzTMt5GVAT6VMCIqUrhQM/ LQFs364C/ah56V2lmvnOVZt5GKZ70qhn35b2RmtS4zVhx9EC3Xqrhar9yqbv4AN8cuLi 6Paw== Received: by 10.224.185.201 with SMTP id cp9mr20101814qab.91.1334655540436; Tue, 17 Apr 2012 02:39:00 -0700 (PDT) Received: from localhost (nikula.org. [92.243.24.172]) by mx.google.com with ESMTPS id z3sm4640951qao.9.2012.04.17.02.38.58 (version=SSLv3 cipher=OTHER); Tue, 17 Apr 2012 02:38:59 -0700 (PDT) From: Jani Nikula To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [RFC PATCH 4/4] emacs: add notmuch hello refresh hook to place point in a widget In-Reply-To: <871unmoh0l.fsf@gmail.com> References: <871unmoh0l.fsf@gmail.com> User-Agent: Notmuch/0.11.1+222~ga47a98c (http://notmuchmail.org) Emacs/23.1.1 (i686-pc-linux-gnu) Date: Tue, 17 Apr 2012 09:38:57 +0000 Message-ID: <87bomqvgsu.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQl3wXVOV9KkEujknCKIpvJuy2DBN79IcE92zuP2MJ7KPwKdabAGArqvoilawaryBP2AuX0B 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:39:05 -0000 On Tue, 17 Apr 2012 13:16:10 +0400, Dmitry Kurochkin wrote: > 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. This isn't very much unlike how the current code finds a widget before refreshing. The difference is that this is based on a saved and restored point, which indeed does have it's inaccuracies. Jani. > > 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