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 ms9.migadu.com with LMTPS id 4EDGHUTHHWSvJQAASxT56A (envelope-from ) for ; Fri, 24 Mar 2023 16:52:36 +0100 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 CGrLHETHHWREyAAAG6o9tA (envelope-from ) for ; Fri, 24 Mar 2023 16:52:36 +0100 Received: from lists.gnu.org (unknown [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 3FE8AAC6A for ; Fri, 24 Mar 2023 16:52:36 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfjfv-0000WE-77; Fri, 24 Mar 2023 11:49:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfjfp-0000Sn-O4 for emacs-orgmode@gnu.org; Fri, 24 Mar 2023 11:49:51 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfjfm-0005kR-2Z for emacs-orgmode@gnu.org; Fri, 24 Mar 2023 11:49:48 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 16ED32404AB for ; Fri, 24 Mar 2023 16:49:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1679672984; bh=iY9MD1Kq8I/HVJVMiDobEw2SPQs0m/af59A3J/sdmFo=; h=From:To:Cc:Subject:Date:From; b=aLrm/z+BJKhxljsAMxsE3ajaNaz+CBeSz3NwreGQK+qulnJDwg3gjnMATeS7wORn1 ejFP3l9TujH0zAwB4m/qNuO/lW49lUoBrxh1dfJy11y1nAf0O56oM0BoWhkx0P7rV5 c3liIWJiMC7x2XFlMuE5tz23iMWQeBouxxbn3e+ogywaC5N+qK6yfi4PD1dkfqj1KH GbkwXJC7OrvJye8d+eiYPlbupo5N5qu25bU2A2HUOo4Yt6jUHnC8AdY21IBvyz0GEL wB05g23ypzemkqk5Fs8TM43/NlFIlbijf+bHGKl/GcZ1iHAAIfeZw58g/wxOXXM8K9 As2Vz0dV2P11A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pjh2r6jP5z6tms; Fri, 24 Mar 2023 13:14:12 +0100 (CET) From: Ihor Radchenko To: Cassio Koshikumo Cc: emacs-orgmode@gnu.org Subject: [FR] Make org-occur highlights always visible, even upon folding (was: Bug or expected behavior? org-sparse-tree visibility toggling) In-Reply-To: References: <87v8jozlr2.fsf@localhost> Date: Fri, 24 Mar 2023 12:16:15 +0000 Message-ID: <87v8iqwdio.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679673156; a=rsa-sha256; cv=none; b=cXrqged73pmKVmlN26oRVLX5MIiMMfpn5iEmJbQ6wDkAk9BK756EgmdKjZhWTTpPHYbHoc 0jJmI6mUdIkBvbeN4rmjRoAY/NmDTFr46Tal8QPJ+eR13Q7qnPC7qjnbAnpZNCWyZ+LSDA BP0oTV5sNDAQP0MdzD0Fo91iLnmKvKLPSJmHRb75GN42BTRalJ+n3iRikjyMXyhr8UGDeE +vae9kHNTn27U+xQRvNPHhk5JwVRDFb06qkAEiVnxlJ0gfZDQJhxLDlgZ5K5k5g4+v8U1V zUKLTHjArtGaAnmAXG2tX1NqmMpPO/yzlW71Q+TcWpCfqeWbZFxvEa4mwpq4uQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="aLrm/z+B"; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679673156; 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=/ILf8HetkC1MVLlpWU0OsPfv+oYsiXceOsff57BXNMg=; b=UOYrHhK/UqQ6C4BzCnoQEwh6B2JvzoutyON1ItQxGme2noAUBCX/niz+f3HUUGuymYeNC6 1cQh0VyGoW0xN0d54QjJRcIh6COjH+sXACaYiT3HC3JbHWpvQxeJ304yJi4Pm99AtgJNQe oWpV6vwEddf+egqtezh9JCm8vTIFW6p2IpyH8Dk9Q8gzNpzQeHnj43J0jH8Asb62N++GXz OUwbCVx6RkdlcfqmFFCkdrCJ+CX20HxBfd8/XsL82ZTqpq4QH9oEo7IMAD++8g9wvmjxQ4 w0ZXonNwoZyiaH/I7q6hxiR0JsGs1+e0fgbCHqYHCzpH7Pm0+NGi+NxJMpzPlw== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="aLrm/z+B"; dmarc=pass (policy=none) header.from=posteo.net; 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-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -3.75 X-Spam-Score: -3.75 X-Migadu-Queue-Id: 3FE8AAC6A X-TUID: AvRHezukIGaC --=-=-= Content-Type: text/plain Cassio Koshikumo writes: > Hm. It makes sense that TAB is not affected... Somehow I hadn't really > considered that. > > What I expected to happen (and now I realize it was not a justified > expectation) was to have the visibility of the sparse-tree kept while > tabbing. So I could expand a tree, then collapse it again, all the > while keeping the sparse-tree "filter" applied. But I guess it doesn't > make much sense. > > Well, I guess I could leave it as a suggestion for new functionality, > but I don't even know if it's feasible. It is not very hard to do, actually. See the attached patch. However, I am not sure if it is something of interest for other Org users. If there is more support, I can convert the patch into proper new Org feature, adding customization and necessary ORG-NEWS announcement. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-highlight-new-match-Make-highlights-always-visib.patch >From d3e8d0a9fc235b025f005158cc51f21e5e2ec8ee Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Fri, 24 Mar 2023 13:10:37 +0100 Subject: [PATCH] org-highlight-new-match: Make highlights always visible * lisp/org.el (org-highlight-new-match): Make highlights always visible, even upon folding. --- lisp/org.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 20e6ea6d9..1834eadbc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10762,10 +10762,15 @@ (defun org-occur-next-match (&optional n _reset) (defun org-highlight-new-match (beg end) "Highlight from BEG to END and mark the highlight is an occur headline." - (let ((ov (make-overlay beg end))) + (let ((ov (make-overlay beg end)) + (ov-line (make-overlay + (org-with-point-at beg (max (point-min) (1- (pos-bol)))) + (org-with-point-at end (pos-eol))))) (overlay-put ov 'face 'secondary-selection) (overlay-put ov 'org-type 'org-occur) - (push ov org-occur-highlights))) + (overlay-put ov-line 'invisible 'org-occur) + (push ov org-occur-highlights) + (push ov-line org-occur-highlights))) (defun org-remove-occur-highlights (&optional _beg _end noremove) "Remove the occur highlights from the buffer. -- 2.39.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--