From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id LlIGE54YkmJrPQEAbAwnHQ (envelope-from ) for ; Sat, 28 May 2022 14:42:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YAn+EJ4YkmJDgQEAG6o9tA (envelope-from ) for ; Sat, 28 May 2022 14:42:06 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C602F13820 for ; Sat, 28 May 2022 14:42:05 +0200 (CEST) Received: from localhost ([::1]:44782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuvld-0007rh-0E for larch@yhetil.org; Sat, 28 May 2022 08:42:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuvjx-0007rK-BO for emacs-orgmode@gnu.org; Sat, 28 May 2022 08:40:21 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:43619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuvjv-0002kU-PO for emacs-orgmode@gnu.org; Sat, 28 May 2022 08:40:21 -0400 Received: by mail-pl1-x62c.google.com with SMTP id b5so6372256plx.10 for ; Sat, 28 May 2022 05:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=6zYn7TNAJ1CPWDinuBxC5hBbSNQvFl3SUJSqiGGdbbA=; b=j0F/6ABekD5bcAkKjKQjIzGPU7forJTEgyGew2ui1CQboECKMra21t2apfK7oYocNC OnelXIjrVC7fWXNWHErS7cm2Wm6MLbL0KWSlLHMxD0ua9emsXZFEUltNR5k8vRWKyo3h zqBtd059PEENU0te3v65OOLWWDXlyKFp0meE828i3IB/SMa8R6VTANFeH1Ivw4FqqMcn 9gnwsL6Yxvc3ZAErWdFUWla5WBB4erLMOsX7ZSqLFJEfDPb1bR/9I2f2AxAZRvkC30ye AeZpdwod2OrN1t5pORw346M2O6kbBLNfjiyVNmeABbkIYaUlGwY0SEObNLPPlKbUvKSt OHYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=6zYn7TNAJ1CPWDinuBxC5hBbSNQvFl3SUJSqiGGdbbA=; b=uM4a/NLA6rqRJrBvwiAdwlMtGwnVe2Er0h62iQMG7B9FRMyjiRsRvd+OX2YCjTNCBn XfGKpAMKmbbV78Mnh6ftu+92ZVFCwAcPv+Ea2vAX7YI9A70lZa4cr0jkaieaMLW4l4Vo N8oNVRYUDleWFu30EUIpXssjPPOOgFczOcZLPVpEDp3rjuJnD3PH477uGUEl0bhCElCG fGqvS7YJ2aWau9qXzBA2Gh0oOvg7pHWL45KP7SOTpEZ28wYKgWL/K0JRFQFM99niMZ5y y55Le6kTv4ACqacJLE858kLWBORp5fyqRlnYtD2X7D/c8n258i+xkC8mGvnLAcwtBlT9 5f/A== X-Gm-Message-State: AOAM530ypZvEmpyWr0dh/54lOQV9ac5NJZ3dbol8HaCwYrSEXmRUk/Jl 4+NW93IUdUuu7ZEyrSCUCio= X-Google-Smtp-Source: ABdhPJyJn75tZW/XyXuh2KYXM/nuk46k34T8reg3HHI9kAraB1/DDpnh0RDU9goByftJwL6ItyHzfA== X-Received: by 2002:a17:902:e54e:b0:162:5287:59bd with SMTP id n14-20020a170902e54e00b00162528759bdmr20708354plf.33.1653741617264; Sat, 28 May 2022 05:40:17 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id u10-20020a17090a5e4a00b001e292e30129sm1808565pji.22.2022.05.28.05.40.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 05:40:16 -0700 (PDT) From: Ihor Radchenko To: Tor Kringeland Cc: "emacs-orgmode@gnu.org" Subject: Re: [PATCH] Re: Change in `org-cycle-hook' breaks behavior In-Reply-To: References: <87a6b3zc02.fsf@localhost> <87sfoucoyp.fsf@localhost> Date: Sat, 28 May 2022 20:40:57 +0800 Message-ID: <875ylpvnhi.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653741725; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6zYn7TNAJ1CPWDinuBxC5hBbSNQvFl3SUJSqiGGdbbA=; b=jhoP7rOaNyuxc8FyL8dIM4UqyR+B9tG8SSYWEHNpQh10VCnGFGLeX2UlvFUqgXq3K9PM8m V5AYLM0YgEIb0im3C+Ul/snk1VvS4BT9s5Ld70ZCqaC6br9rCqnjlX6uquIKKIvNtLo70b VvvMAESDgstx69Q5E8YGedGGtkDyH6I89Nk/dUBofqCyVzpYq7laWHRxFebBmntM04KrNi 4e9oSE7oV1VXhlkQGKGNzSGQt8OxzMEADXE2OKjk4fuac+zRg4KUzC2NAJeaAaRQ4Nlsr1 5q7CgEGtuvTZXG4CD3wpqcVE82fphmtpzqs9wTmko5k5Dd+1zipYg7vMIDNzYQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653741725; a=rsa-sha256; cv=none; b=LppSlOckY+w198ICY5m2tZ8wVoFX/5aFaXjHDrNYXb3eUZxm1L1nRyNrR+ClAxDWSPf8hF +F83QBdZ0gkGq3+BrEYN5zYssyOLZUv2Uk+00XVCIh+Q/de5X94TCUy181dXqldxuSqda1 v6rvaUc/jQuCwYouWQDhUap+QwjHopm1c/NC8i+DYkf7twRr0ZjYL/tBA3VDXpo16oevqO c7nZakKAGCTYl7DttKJzvKl6MkUWq3be1kXk7cZPdzJs97djgJ1oCbXP4G4PNO3PDbE1y3 Ex/zlmUw+erZT2MACkXHVErvR26dGVi/WckjB+2exgmSiVFAzfK0Hj0b2CYVJg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="j0F/6ABe"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="j0F/6ABe"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C602F13820 X-Spam-Score: -2.04 X-Migadu-Scanner: scn1.migadu.com X-TUID: BfaJe03FmmYz Tor Kringeland writes: > Ihor Radchenko writes: > >> Sure. Now, you need to call a different function to open all the drawers >> unconditionally. That function is: >> > Thanks! This almost imitates the old behavior, except that all drawers > (i.e., including sub-headlines) would be opened when the headline it was > a part of was opened. (So pressing TAB multiple times would first show > the outline with the first headline open, then the next would show > sub-headlines with their drawers open.) I am a bit confused. The code I provided should only open the drawers inside the headline at point, before its first child (if any). If you have * headline :drawer: test :end: ** child :drawer2: test :end: then only "drawer" will be revealed. Not "drawer2". If you want all the drawers in all the children to be opened, you can instead do the following: (let* ((headline (save-excursion (org-back-to-heading) (org-element-at-point)))) (when headline (org-fold-region (org-element-property :begin headline) (org-element-property :end headline) nil 'drawer))) >> Though we might also modify org-fold-show-entry to allow what you wish. >> I am not sure here. > > That sounds nice. So an optional behavior would be for it to open the > drawers as well, which I guess would lead to the "recursive" behavior > above I mentioned working, right? I am not sure. Can you elaborate what exactly you want to achieve? Best, Ihor