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 82EEF6DE1006 for ; Sat, 23 Mar 2019 01:07:31 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.042 X-Spam-Level: X-Spam-Status: No, score=0.042 tagged_above=-999 required=5 tests=[AWL=-0.008, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, 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 nNguqaML84Nr for ; Sat, 23 Mar 2019 01:07:31 -0700 (PDT) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by arlo.cworth.org (Postfix) with ESMTPS id A5CBE6DE0F48 for ; Sat, 23 Mar 2019 01:07:30 -0700 (PDT) Received: by mail-wr1-f65.google.com with SMTP id w1so4698098wrp.2 for ; Sat, 23 Mar 2019 01:07:30 -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=DOPECFvPkiRL2fGZyu7z51mX3SdUvbRmuZyXfMKrROY=; b=gKTYerqYIoHy7KU1FYxThu7AfvPM3TmyXWnMepxigO1eFdptC6iuShh3FjDhmjbDVG +sEpOlf6TB983IdgA6G9KOhbdWb3okkEkxdyObcK8yUXoANdGYxFU3RftxmpqVJa5uEp WqeMcp9n/3Zo6QWPHXgCc/sTZpPzQJtpulU0YDAADX3xJWUbvB1sA1aZP3NtNInJvMg7 nZAr/SdfOC4Hbl5M5wzV8CJx7tIWCD1nsW+hwONBKZcV7mIc/1PmUNe/1sjy8risiRFR O28p1q5zNax5SARurboAgwtM7ggl0YOtoMpsJ6FBiZyklPxKYhd3pT8aLHpclMVVNuyj 0/Sg== 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=DOPECFvPkiRL2fGZyu7z51mX3SdUvbRmuZyXfMKrROY=; b=Iu+qZKS2QMRX5kpzWphGRKVvz0EoSv6mGSayqJ7cdajLbG6vSSTSOWuBUxvfUqbRIb YxJ9khltcGHu1vVh4NgG4rC4bGmihiiI5Q11f03tx0d9osLBK4AYC2GmwfeLab1q4gIn ZFscCFrIIssiZPtM/tvuBgQB8T5u9gIbYF0voy89FEgueHPBzaDhGHeQ6MQ3a/oUm3p+ MIUeXnaOYRveZ3S3D/EB16B2HngvaBOpdblbZ66Rro24u4T3IptGCYadZXn5IOnhtxZj Una7HzDsQg+J4daMZiSkkKIwwoqIxXONbytPOQWwc22jQGNKZDnu08q2RR/t2u8bTnq9 JOPA== X-Gm-Message-State: APjAAAUiFg5WylVxf9leKFmLKYiueeBn4SGrMZt7HcvPOK+xuqD2YS0B yL9GtNK1AFWPUt/6vJ7aTAk= X-Google-Smtp-Source: APXvYqyX7wkr934pkcl6BTlEa8oPidfx+XEZ3xvlI/gsXv/zkVV27ZD6VFrCPfyAro4lvwgV6EasEg== X-Received: by 2002:a5d:4c88:: with SMTP id z8mr2082003wrs.291.1553328447948; Sat, 23 Mar 2019 01:07:27 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id s14sm10058171wmc.7.2019.03.23.01.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 01:07:26 -0700 (PDT) From: Mark Walters To: Julien Masson , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: tree: support fold/unfold thread In-Reply-To: <86h8bwgueb.fsf@julienm-ubuntu-20JES0UQ00.i-did-not-set--mail-host-address--so-tickle-me> References: <86h8bwgueb.fsf@julienm-ubuntu-20JES0UQ00.i-did-not-set--mail-host-address--so-tickle-me> Date: Sat, 23 Mar 2019 08:07:25 +0000 Message-ID: <874l7um2te.fsf@qmul.ac.uk> 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: Sat, 23 Mar 2019 08:07:31 -0000 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. 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. 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? Best wishes Mark