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 C9E826DE102D for ; Mon, 25 Mar 2019 08:17:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.395 X-Spam-Level: X-Spam-Status: No, score=-0.395 tagged_above=-999 required=5 tests=[AWL=-0.195, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 i0MShaQ2GRfg for ; Mon, 25 Mar 2019 08:17:01 -0700 (PDT) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by arlo.cworth.org (Postfix) with ESMTPS id 854B86DE0A7E for ; Mon, 25 Mar 2019 08:17:00 -0700 (PDT) Received: by mail-wm1-f66.google.com with SMTP id z24so6242174wmi.5 for ; Mon, 25 Mar 2019 08:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=UX6JQnFUJlvU6pHgrLPBQf/56AQvabHx+/4c1mIC4vI=; b=pMlVCZaHZPIqmQ1S+DqlFN2AMPtJ8wxoFc8vPCTRmdPZt+rM9O3uA3APmJhwdOGhUL VOdYsYNG1TTS11fhwh2Ghr5qaFAom5PxjFEem+MCBw7m5vnlUg9GL8PYz8D6EKamLaQ3 conl/FSFSjOntt43D3Sjm1HvMrv0tPfN4kA86xCc0kk9bL4USi7/UMdlIxooogY6OO/1 HvyCJ08G6dhkfiDXB2i+6Cj0F2qscCkNWzQo02lsuQAvPjNj+dAGCA4+ikjKHacGYD7A ZJwRf3hDvJKNQameO+u0Wi6rWEDbhhKQl/Qe7L6CDq8ZHom+1OZb6FFEDMUBLxtQLBpU lnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=UX6JQnFUJlvU6pHgrLPBQf/56AQvabHx+/4c1mIC4vI=; b=U86DzTtwbHaEWWEG7emqr9/l1A4z/wCWkWKy4qAmOyy4z96ngqkHDLf/Smtsw8L8hf V9lymVg1bgLcIG+SlGCLE/RaUAa3QWQ+LpgBsOTxOFKgElfBug0elSFx8d1P76WQsj9g 2MsTK4+2MweG00mlA3O+RRzKgY80GnukiwuzYKMGkMdFfiiM6UyIeUOXE8amy1ZE7Rgm M/hGSSeYkvYhyDyG6z6TW436EdBe1l/BnO0gYzan7HLY13oMt86H778gOWjLiX9F6EUz NwUIMPr0O2aJXhHTgUbVIq6KBcCAqx2ITc3DE/mPDHDKJUIUPtM9WwXp2GA7TjiZ7B+6 vfhg== X-Gm-Message-State: APjAAAW7zSSHNB14splxBI04E00EaVM8VS+iryGCySKai4gxzWQsQrTb 0a5/2Sl+e7yV5HZbwUvUdpE= X-Google-Smtp-Source: APXvYqwPe9QBsLQGTQpcyasscudy6qDwWwUggjPG6mOKnZCvTVwdLiatbGON1pQ1pLInwIy7SA5Fbg== X-Received: by 2002:a1c:c90e:: with SMTP id f14mr5559730wmb.23.1553527017350; Mon, 25 Mar 2019 08:16:57 -0700 (PDT) Received: from localhost ([2620:10d:c092:180::1:49b]) by smtp.gmail.com with ESMTPSA id t15sm14907315wrx.22.2019.03.25.08.16.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 08:16:56 -0700 (PDT) From: "Masson\, Julien" To: Mark Walters , Julien Masson , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: tree: support fold/unfold thread In-Reply-To: <874l7um2te.fsf@qmul.ac.uk> References: <86h8bwgueb.fsf@julienm-ubuntu-20JES0UQ00.i-did-not-set--mail-host-address--so-tickle-me> <874l7um2te.fsf@qmul.ac.uk> Date: Mon, 25 Mar 2019 16:16:55 +0100 Message-ID: <8636nbrnko.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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, 25 Mar 2019 15:17:02 -0000 Hello Thanks for the reviews, I appreciate. On Sat 23 Mar 2019 at 08:07, Mark Walters wrote: > Hello > >> This patch allow the user to fold/unfold a thread in the current tree >> buffer by pressing "t" key. > > This looks like a really nice feature! I will try and review the code > properly soon, but have some preliminary comments. > >> By default a string is displayed at the beginning of the overlay to >> indicate that this thread is folded. > > I wonder if it would make sense to make the [....] replace the "tree > symbol" (-> etc)? This would mean that it was always on the screen and the > tree symbol looks a little odd with a collapsed thread. The range of the overlay is from the end of the line of the subject to end of the line of the last message. So on the screen the string "[...]" is placed at the end of the Subject. If I change the range from the "tree symbol" the subject will be invisible. I chose to placed the overlay like this to make sure I still see the subject of the folded thread. But if you prefer I can place the overlay from the "tree symbol" position. > > Secondly, I wonder whether making it collapse just the subthread below > the current message (ie a subtree) would be nice? To me that feels more > generic, but might be more effort than it's worth as the code would need > to deal with nested folds. Then C-u t could do exactly the current > folding (ie the whole thread). But this is just a thought. yes sure I'll send a v2 which handle sub-thread folding. > > Finally a comment on the code > >> +The overlay found is located between START and END position in BUFFER." >> + (seq-find (lambda (ov) > >> +(defun notmuch-tree-clean-up-overlays () >> + "Remove overlays not referenced to any buffer" >> + (setq notmuch-tree-overlays (seq-filter #'overlay-buffer notmuch-tree-overlays))) > > seq-find and seq-filter are emacs 25+ only I think; at least they don't > seem to be in emacs24 which I think we still support. Perhaps some cl > functions can be used (eg remove-if-not) instead? Ah yes sorry, I'll change this in the v2. > > Best wishes > > Mark Thanks Julien Masson