emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Nicholas Savage <nick@nicksavage.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] (org-remove-occur-highlights) Implements option to remove highlights between points
Date: Tue, 22 Sep 2020 01:22:03 -0400	[thread overview]
Message-ID: <87blhywflw.fsf@kyleam.com> (raw)
In-Reply-To: <b204da05-85f3-43af-bbf0-ed7149b300af@www.fastmail.com>

Nicholas Savage writes:

> I realize now that I messed up sending this patch yesterday so it
> didn't show up on updates.orgmode.org. I just wanted to repost it with
> a correct subject to make sure it didn't get lost. My original message
> follows.

This topic is now split across three separate threads:

  https://orgmode.org/list/d4e1e166-8da2-4c1f-8d90-1671a6541992@www.fastmail.com
  https://orgmode.org/list/54ebdcc2-c17a-445a-9599-2bfc90e64e5d@www.fastmail.com
  https://orgmode.org/list/b204da05-85f3-43af-bbf0-ed7149b300af@www.fastmail.com

Please avoid doing that in the future.  It invites confusion and
redundant responses.

> I posted earlier about why org-remove-occur-highlights ignored it's
> options of beg and end. I'm fairly sure it was so they could be
> implemented later.

At least one reason that those parameters exist is to allow
org-remove-occur-highlights to be used as a member of
before-change-functions.  I suspect it's _the_ reason.

> I wanted to use this functionality, so I've
> implemented it. This should not change any current behaviour. If beg
> and end are nil, it will run the same way as before. This is called as
> part of org-sparse-tree, and my changes do not affect that. When beg
> and end are non-nil, it checks which overlays are between those two
> points and deletes them. I've ensured that 'make test' still passes
> and believe I've formatted my changelog entry as required.
>
> If I'm missing something about how this should be working, please let
> me know.

Thanks for sending the patch.  Unfortunately, it breaks the
org-remove-highlights-with-change functionality, which depends on
org-remove-occur-highlights not paying attention to the BEG and END
arguments.

Take this Org file:

--8<---------------cut here---------------start------------->8---
* a
|
target

--8<---------------cut here---------------end--------------->8---

Call org-sparse-tree and enter "target" as the regular expression.
Then, with point at "|", hit, say, C-o.  When
org-remove-highlights-with-change is non-nil, the highlighting should go
away.  With your patch, it doesn't.

It might be worth stepping back and describing what your use case for
this change is, and considering other ways to address it (not
necessarily as a change to Org itself).


  reply	other threads:[~2020-09-22  5:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  2:02 [PATCH] (org-remove-occur-highlights) Implements option to remove highlights between points Nicholas Savage
2020-09-22  5:22 ` Kyle Meyer [this message]
2020-12-14  6:32   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blhywflw.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nick@nicksavage.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).