From e5368ba6534f5c05fc23c5be5ac34d7696ecd956 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Mon, 9 Sep 2013 19:59:40 +0300 Subject: [PATCH] Re: [PATCH v2 0/9] emacs: Unify common key bindings and lots more --- c3/24250e814c7c02bd9b1983b3f029c0af5482ab | 142 ++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 c3/24250e814c7c02bd9b1983b3f029c0af5482ab diff --git a/c3/24250e814c7c02bd9b1983b3f029c0af5482ab b/c3/24250e814c7c02bd9b1983b3f029c0af5482ab new file mode 100644 index 000000000..d0321ae08 --- /dev/null +++ b/c3/24250e814c7c02bd9b1983b3f029c0af5482ab @@ -0,0 +1,142 @@ +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 39A13431FAE + for ; Mon, 9 Sep 2013 09:59:58 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 abrW0OqZf7Uj for ; + Mon, 9 Sep 2013 09:59:50 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id C96F9431FB6 + for ; Mon, 9 Sep 2013 09:59:47 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 42A51100090; + Mon, 9 Sep 2013 19:59:41 +0300 (EEST) +From: Tomi Ollila +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.16+68~g2e5340c (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +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: Mon, 09 Sep 2013 16:59:58 -0000 + +On Wed, Sep 04 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). + +I've been using this patch series a few days now it has worked fine. +It took me a while to grok the notmuch-hello-window-configuration-change +which imo provides nice piece of functionality. + +The whole patch series LGTM. + +Tomi + +> +> 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")))) +>=20=20 +> +(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") +>=20=20 +> @@ -478,9 +483,6 @@ Such a list can be computed with `notmuch-hello-query= +-counts'." +> ;; Lazy - rebuild everything. +> (notmuch-hello no-display)) +>=20=20 +> -(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-quer= +y-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: +>=20=20 +> ;; 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*"))) +>=20=20 +> ;; 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)) +>=20=20 +> (let ((target-line (line-number-at-pos)) +> (target-column (current-column)) +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch +> + +--=20 +"kaik on m=C3=A4nt!" -- 2.26.2