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 D72F0431FDD for ; Thu, 5 Sep 2013 02:27:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 VP6FhZqdq3P7 for ; Thu, 5 Sep 2013 02:27:52 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id B901F431FDB for ; Thu, 5 Sep 2013 02:27:51 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1VHVqv-0004lu-VU; Thu, 05 Sep 2013 10:27:50 +0100 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1VHVqv-0002fT-JS; Thu, 05 Sep 2013 10:27:49 +0100 From: Mark Walters To: Austin Clements , notmuch@notmuchmail.org Subject: Re: [PATCH v2 0/9] emacs: Unify common key bindings and lots more In-Reply-To: <1378244725-18846-1-git-send-email-amdragon@mit.edu> References: <1378244725-18846-1-git-send-email-amdragon@mit.edu> User-Agent: Notmuch/0.15.2+269~g01f5508 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Thu, 05 Sep 2013 10:27:48 +0100 Message-ID: <87a9jrlisr.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: a3869301cd9ea9a0870e2c28bb776844 (of first 20000 bytes) X-SpamAssassin-Score: 0.0 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored 0.0 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.0 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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: Thu, 05 Sep 2013 09:27:58 -0000 LGTM +1. (The defcustom is a nice addition) Mark On Tue, 03 Sep 2013, Austin Clements wrote: > This is v2 of id:1377793557-28878-1-git-send-email-amdragon@mit.edu. > This fixes a problem found by Jani where notmuch-hello would reset > point placement when refreshing in Emacs 24. It also inverts the > sense of notmuch-hello-auto-refresh and makes it a defcustom > (originally I'd intended notmuch-hello-inhibit-auto-refresh for > internal use only, but both Mark and Jani expressed interest in > setting it). > > The diff from v1 follows > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index 1d6c3a2..55c416a 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -232,6 +232,11 @@ supported for \"Customized queries section\" items." > notmuch-hello-query-section > (function :tag "Custom section")))) > > +(defcustom notmuch-hello-auto-refresh t > + "Automatically refresh when returning to the notmuch-hello buffer." > + :group 'notmuch-hello > + :type 'boolean) > + > (defvar notmuch-hello-hidden-sections nil > "List of sections titles whose contents are hidden") > > @@ -478,9 +483,6 @@ Such a list can be computed with `notmuch-hello-query-counts'." > ;; Lazy - rebuild everything. > (notmuch-hello no-display)) > > -(defvar notmuch-hello-inhibit-auto-refresh nil > - "Don't refresh notmuch-hello on window configuration changes.") > - > (defun notmuch-hello-window-configuration-change () > "Hook function to update the hello buffer when it is switched to." > (let ((hello-buf (get-buffer "*notmuch-hello*")) > @@ -501,8 +503,11 @@ Such a list can be computed with `notmuch-hello-query-counts'." > ;; is currently visible, was not visible on the last > ;; configuration change, and this is not a new window) > (setq do-refresh t))))) > - (when (and do-refresh (not notmuch-hello-inhibit-auto-refresh)) > - (notmuch-hello t)) > + (when (and do-refresh notmuch-hello-auto-refresh) > + ;; Refresh hello as soon as we get back to redisplay. On Emacs > + ;; 24, we can't do it right here because something in this > + ;; hook's call stack overrides hello's point placement. > + (run-at-time nil nil #'notmuch-hello t)) > (when (null hello-buf) > ;; Clean up hook > (remove-hook 'window-configuration-change-hook > @@ -785,14 +790,15 @@ following: > > ;; This may cause a window configuration change, so if the > ;; auto-refresh hook is already installed, avoid recursive refresh. > - (let ((notmuch-hello-inhibit-auto-refresh t)) > + (let ((notmuch-hello-auto-refresh nil)) > (if no-display > (set-buffer "*notmuch-hello*") > (switch-to-buffer "*notmuch-hello*"))) > > ;; Install auto-refresh hook > - (add-hook 'window-configuration-change-hook > - #'notmuch-hello-window-configuration-change) > + (when notmuch-hello-auto-refresh > + (add-hook 'window-configuration-change-hook > + #'notmuch-hello-window-configuration-change)) > > (let ((target-line (line-number-at-pos)) > (target-column (current-column)) >