emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [DISCUSS] "same text-property competing" problem in external packages
@ 2023-02-28  2:16 stardiviner
  2023-02-28 10:47 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: stardiviner @ 2023-02-28  2:16 UTC (permalink / raw)
  To: Org-mode; +Cc: emacs-help

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

I got a problem when more than one Emacs package competing on setting
text-property on same target from different packages.

Here is the original problem and discussion link:
https://github.com/nobiot/org-transclusion/issues/166

Does anybody have a good idea to solve this problem?

Thanks for your idea and suggestions.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

[-- Attachment #2: Type: text/html, Size: 1539 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [DISCUSS] "same text-property competing" problem in external packages
  2023-02-28  2:16 [DISCUSS] "same text-property competing" problem in external packages stardiviner
@ 2023-02-28 10:47 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2023-02-28 10:47 UTC (permalink / raw)
  To: stardiviner; +Cc: Org-mode, emacs-help

stardiviner <numbchild@gmail.com> writes:

> I got a problem when more than one Emacs package competing on setting
> text-property on same target from different packages.
>
> Here is the original problem and discussion link:
> https://github.com/nobiot/org-transclusion/issues/166
>
> Does anybody have a good idea to solve this problem?

I am not sure which property you are referring to.

There is a number of possible solutions you may use depending on what is
more appropriate for your specific use case:

1. Use overlays with 'priority property. That way, you can "overlay" the
   property above/below existing and Emacs will automatically restore
   the existing value upon removing your overlay. This is the most
   common approach.

2. You can utilize `char-property-alias-alist' and actually store your
   property value in a different property. This will make the priority
   of the existing property _strictly higher_ than yours. org-fold-core
   uses this approach.

3. You can store a "backup" of the existing property and restore it when
   your minor mode is disabled. isearch.el uses this approach.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-28 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28  2:16 [DISCUSS] "same text-property competing" problem in external packages stardiviner
2023-02-28 10:47 ` Ihor Radchenko

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).