From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id B2fxGeH02F8rBQAA0tVLHw (envelope-from ) for ; Tue, 15 Dec 2020 17:39:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mOhfFeH02F9mFwAAB5/wlQ (envelope-from ) for ; Tue, 15 Dec 2020 17:39:45 +0000 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 D2A88940480 for ; Tue, 15 Dec 2020 17:39:44 +0000 (UTC) Received: from localhost ([::1]:52986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpEIX-0002iM-VK for larch@yhetil.org; Tue, 15 Dec 2020 12:39:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpEHl-0002iB-BS for emacs-orgmode@gnu.org; Tue, 15 Dec 2020 12:38:53 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:52728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpEHg-0007cW-Go for emacs-orgmode@gnu.org; Tue, 15 Dec 2020 12:38:53 -0500 Received: by mail-wm1-x333.google.com with SMTP id a6so16620wmc.2 for ; Tue, 15 Dec 2020 09:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=vmPbcSPyzZeKikG5sodLDIdcjlzEoE8T/upnepO+Rzo=; b=B5Kz3YhMTG/bsc8Xh1HGsiACNK8lRdcREHWx8E40iDtuVrj293trScUxmuzJe4Ome+ rTJugCW2+30hQ9l0miS5xIHyA+EdMPND9cg6OUKWS4FDfVGnoVI7RfZoXlpnwQSwVQNH wLrBk0t4qJJX5EViSMHirsnAglxNCrW1JKKUAjdwV7c3AwWhIRhmfVtpyjzFmt5S+HiV qGP7F/TRFnGrfqvDq4J4Mb+TB8SkgkSB+S4Pm12RHleQh71xvElD1bFPKQVKBqODQOTa 3PRNx5fjPnxi3nKpvk04qeQz7aeoYOfTC9rvVJi+94E19G287jOX1J4E99A3sDB8d5su 55wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=vmPbcSPyzZeKikG5sodLDIdcjlzEoE8T/upnepO+Rzo=; b=SOjWEeb9MXP86e4ABay1U4CTDoMHjgHemAQDrqrCk8xZuW/Yopos+4egGUNy+U35oH kGRu84rq8NYPV5wxbt2vnT/1ZXJsziMJk71o+4YDIUTXo0Si2wc3yMwB9yxRd5FnxVQG /qL1J4JsiMeMUrBJhNHt+FdfO1kftdQB3mon+wEAiFhIicZSg7Gr6tUzbbO60dhaL1xE avVmKQg0Hv60OUrIjjmpbd0dbbYblPXl+/KKCfSmvoFTLjC0esKJwOyh0q8TfRJsd6IX 8TbrK37/lHMaWRiR/RMEt7qBzU1BVnhg5fzdafRhhi5Tl7QF1Zdb7gL1jtw8zgAiwaDO LkrA== X-Gm-Message-State: AOAM533ZXXPXixHDmAuzGYtS4vyGB5e34q3hgelaJoK0c4rj4zc7ALnq aTuLpwKKGqJXJ3COCTNDsCNfHIF7s/j0dQ== X-Google-Smtp-Source: ABdhPJwDw7ODCaz9maBMUT/mIpJA/TBBStEkBamFtaGUJMjt946mEyxDuIBhA4FnmUjovQbnxUSbIA== X-Received: by 2002:a05:600c:4101:: with SMTP id j1mr13998688wmi.55.1608053924795; Tue, 15 Dec 2020 09:38:44 -0800 (PST) Received: from my-little-tumbleweed ([2a01:e0a:20e:d340:922b:34ff:fe95:9aed]) by smtp.gmail.com with ESMTPSA id r15sm13045835wrq.1.2020.12.15.09.38.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 09:38:44 -0800 (PST) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Ihor Radchenko Subject: [9.4] Fixing logbook visibility during isearch References: <87h7x9e5jo.fsf@localhost> <87o8qkhy3g.fsf@nicolasgoaziou.fr> <87sgfqu5av.fsf@localhost> <87sgfn6qpc.fsf@nicolasgoaziou.fr> <87367d4ydc.fsf@localhost> <87r1uuotw8.fsf@nicolasgoaziou.fr> <87mu5iq618.fsf@localhost> <87ftb9pqop.fsf@nicolasgoaziou.fr> <875zc2du63.fsf@localhost> <87wo4en8qk.fsf@nicolasgoaziou.fr> <87mu31adeu.fsf@localhost> <871rkcbx40.fsf@kyleam.com> <87mu301in8.fsf@localhost> <87lfh5vvrp.fsf@localhost> <87sgbc4qpl.fsf@gmail.com> <87sgbaw58y.fsf@localhost> <87pn6ew2pv.fsf@localhost> <8736393tlw.fsf@gmail.com> <87eemtm1ic.fsf@localhost> <875z83hwuc.fsf@gmail.com> <874knm61p3.fsf@localhost> Date: Tue, 15 Dec 2020 18:38:43 +0100 In-Reply-To: <874knm61p3.fsf@localhost> (Ihor Radchenko's message of "Fri, 25 Sep 2020 10:16:08 +0800") Message-ID: <87r1nrdl5o.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.01 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=B5Kz3YhM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D2A88940480 X-Spam-Score: -3.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: 03naqsDe6KEU Ihor Radchenko writes: > However, I can try to suggest a way to fix the issue on master. The way > isearch handles folded text in org is set from org-flag-region > (org-macs.el): > > (overlay-put o > 'isearch-open-invisible > (lambda (&rest _) (org-show-context 'isearch))) > > It means that isearch calls org-show-context (org.el) to reveal hidden > text. Then, it calls org-show-set-visibility with argument defined in > org-show-context-detail (now, it is 'lineage). With current defaults, > the searched text is revealed using org-flag-heading, which reveals both > heading body and drawers. > > The easiest way to write the fix would be changing org-flag-heading > directly, but there might be unforeseen consequences on other folding > commands. > > Another way would be changing the way org-show-set-visibility handles > 'lineage argument. Again, it may affect other things. > > Finally, one can add an extra possible argument to > org-show-set-visibility and alter default value of > org-show-context-detail accordingly. > > The last way will have least risk to break something else. > > I guess, patches welcome ;) Since Org 9.4 has landed in the emacs-27 branch, I have renewed interest in finding a fix for this before 27.2 is released (=E2=80=A6 and more selfi= shly, before emacs-27 is merged into master =F0=9F=98=89). I'm a bit confused, because AFAICT org-show-context is called *after* exiting isearch, so IIUC by the time org-show-set-visibility is called it's too late to undo the damage. Recipe using my repro file[1]: - C-x C-f logbooks.org - M-x toggle-debug-on-entry org-show-context - C-s bug The debugger only fires *after* we exit isearch, and by that time it's too late: my issue comes from all those logbooks cluttering the screen while I'm mashing C-s to iterate through matches. I can try to dig deeper into this, but before doing so: would you have any insight as to what's going on here? [1] wget https://orgmode.org/list/87eepuz0bj.fsf@gmail.com/2-logbooks.org -= O tmp/logbooks.org