From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 5F6A56DE0A9A for ; Sat, 17 Sep 2016 01:21:13 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.672 X-Spam-Level: X-Spam-Status: No, score=-0.672 tagged_above=-999 required=5 tests=[AWL=0.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XatvlsELsY4a for ; Sat, 17 Sep 2016 01:21:12 -0700 (PDT) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id C762B6DE0A89 for ; Sat, 17 Sep 2016 01:21:11 -0700 (PDT) Received: by mail-wm0-f68.google.com with SMTP id b187so6854367wme.0 for ; Sat, 17 Sep 2016 01:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adirat-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=OThJLygT6z0l6ZRMxshJQ90Jy+FCzMypOTp+rBPU+nU=; b=h5fYio1Taxowe8oA6bNLONQyVfsLeuegXNifGpor4WmJK5102SPa0FNFn8PRW9RWFN Uz/f4mB746dkTgPZfhorox2CdVywpPs3sSgQuf7l/Q3GMSz3HvCTpO77FkTykJpeT1vH sDwELpmuWKbj633OjkV6p8f8pChuXe4F2EYawlIEsIG0HkRl0BY5YbAPisGya17qU0Em gdEk/B+OHGf/qgp/PAM9f9iFbusUv2fEH08lm7B+yD0Z1KiXG7IZHpBS2lzo3tvnBZiM s9eHYJRf3U14WYBGIoMFLI+4RI+G6CkGTC1HzGSI0BZdcf4Yf+IWjPOD//eRnGreInuv jKIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=OThJLygT6z0l6ZRMxshJQ90Jy+FCzMypOTp+rBPU+nU=; b=OXB/hz4ELuY2ES7tMvTT8ffKbDc+8/aQyaUc3MhKNLGxvQQjQxjS72E7R5u0a1I+a6 NF+xyHQGJR0y/+AtkbAz4i63+QMJ+UnmOB51obQaV9oIV50foMkLFS+ytnWktrFP4UwR gGGm2iZnVikPeXruoqMMorgnF9iKzR1XmTAJHq2upXmOi3pba2LsIT54ayNKjs6XHjyc endYFf372AmIYOBGtkrpIjWYskS+CZxIbOsNE8IH7KmQnxbWybLDpDWgpbuqjCmUmiK6 hNObihTfYVVemS0WVv2gChuiQog4HgtZE90jPekkbg8JF7KNL3PnwWe9DsTz4UvdftQY Dv3g== X-Gm-Message-State: AE9vXwMJnZcHZ5JbG907aftSDnjktLGcapd3h0gBWO3FKqijjhswSSLOQxtAi/eX9it4Cw== X-Received: by 10.28.197.76 with SMTP id v73mr1150571wmf.100.1474100469574; Sat, 17 Sep 2016 01:21:09 -0700 (PDT) Received: from adiPC ([188.24.78.211]) by smtp.gmail.com with ESMTPSA id a5sm12077396wjd.9.2016.09.17.01.21.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Sep 2016 01:21:08 -0700 (PDT) From: Ioan-Adrian Ratiu To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH 2/4] emacs: adjust all types of notmuch show buffers In-Reply-To: <87d1k3bn3v.fsf@qmul.ac.uk> References: <20160910142819.19349-1-adi@adirat.com> <20160910142819.19349-3-adi@adirat.com> <87d1k3bn3v.fsf@qmul.ac.uk> Date: Sat, 17 Sep 2016 11:21:06 +0300 Message-ID: <87r38jdjil.fsf@adiPC.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sat, 17 Sep 2016 08:21:13 -0000 Hi and thank you for the feedback! On Fri, 16 Sep 2016, Mark Walters wrote: > On Sat, 10 Sep 2016, Ioan-Adrian Ratiu wrote: >> The current notmuch-show-message-adjust logic only adjusts the buffer >> focused in the current window. Extend it to adjust any kind of buffer, >> even buffers in a window without focus or in a different frame or even >> not shown at all. >> >> This new logic is very useful to build upon for the auto-refresh all >> buffers feature because you can use similar code to refresh any buffer: >> >> (with-current-buffer "*random show buffer*" >> (notmuch-refresh-this-buffer)) >> >> Signed-off-by: Ioan-Adrian Ratiu >> --- >> emacs/notmuch-show.el | 11 ++++++++++- >> 1 file changed, 10 insertions(+), 1 deletion(-) >> >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el >> index 6d3149b..74818cc 100644 >> --- a/emacs/notmuch-show.el >> +++ b/emacs/notmuch-show.el >> @@ -1505,7 +1505,16 @@ All currently available key bindings: >> (goto-char (notmuch-show-message-bottom))) >> >> (defun notmuch-show-message-adjust () >> - (recenter 0)) >> + (let ((buffer-window (get-buffer-window (current-buffer) t)) >> + (msg-position (point))) >> + (if buffer-window >> + (with-selected-window buffer-window >> + (goto-char msg-position) >> + (recenter 0)) >> + (save-window-excursion >> + (select-window (display-buffer (current-buffer))) >> + (goto-char msg-position) >> + (recenter 0))))) > > Hi > > I haven't tested things yet, but what happens if the buffer is open in > multiple windows? Good catch. If one of the windows has focus, its point gets reset to the message containing point before the refresh call (the standard notmuch-show current refresh behaviour). The windows which don't have focus get reset to the first message. We want to make all windows showing a buffer get adjusted, right? I can add this to v2. > > I think it would be worth adding something to the commit message along > the lines of > > notmuch-show-refresh-view calls notmuch-show-message-adjust in its > call chain. Since we want to call notmuch-show-refresh-view on > buffers than are not displayed we need to modify > notmuch-show-message-adjust to work in this case. Yes, this is much clearer, I will update in v2. > > Best wishes > > Mark > > >> ;; Movement related functions. >> >> -- >> 2.9.3 >> >> _______________________________________________ >> notmuch mailing list >> notmuch@notmuchmail.org >> https://notmuchmail.org/mailman/listinfo/notmuch