From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6HIaA87b/WNKbgAAbAwnHQ (envelope-from ) for ; Tue, 28 Feb 2023 11:47:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id gK/wAs7b/WOpLwAA9RJhRA (envelope-from ) for ; Tue, 28 Feb 2023 11:47:42 +0100 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 D16CD2C083 for ; Tue, 28 Feb 2023 11:47:41 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWxVZ-0004Yw-Pg; Tue, 28 Feb 2023 05:46:57 -0500 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 1pWxVY-0004X9-1O for emacs-orgmode@gnu.org; Tue, 28 Feb 2023 05:46:56 -0500 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 1pWxVV-0003iF-KN for emacs-orgmode@gnu.org; Tue, 28 Feb 2023 05:46:55 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id BDF7124079F for ; Tue, 28 Feb 2023 11:46:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677581211; bh=CgTGN33TTcS9KXwUl03GlC3YcDYjB+mRe0LDx7wIESw=; h=From:To:Cc:Subject:Date:From; b=Kco9lzGpKacUUvHX2Czv/ZG8K5HKrsoBcWFOTM0TBCBvI8qKs+vkFqdE6diW1rXqH duH/y8UAdgMBPqKCo821XyykvHaVQgATayFY0ogkt8wetHf74oKzFHDDyMrqqCDtxr gA+TUwfz8xZVdP1kfut3szILsFYgdlWVwQhbVs2S/gG9yWvrvz1auzh34TkwR5a1OL 8vpMxI0fXbKzhXAtTHfTTJBXmImWu+h8o8jnqUh1vQ1k/pZLntIh0RvLo6duR6z/EQ V6gwDuO2F8GCFOJ9dL+Y6vkomhqgJap8oM7Owtp9Zeq4HYIhswscyCI7uZGMfePTLM duPh3OtuV8FjQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PQvF30lCzz9rxR; Tue, 28 Feb 2023 11:46:46 +0100 (CET) From: Ihor Radchenko To: stardiviner Cc: Org-mode , emacs-help@gnu.org Subject: Re: [DISCUSS] "same text-property competing" problem in external packages In-Reply-To: References: Date: Tue, 28 Feb 2023 10:47:26 +0000 Message-ID: <877cw2xe0x.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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-Flow: FLOW_IN X-Migadu-Country: US ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Kco9lzGp; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677581261; a=rsa-sha256; cv=none; b=UWM4LAj9EXRBxINHDZJ9qWWCWMQP63Qh5S9qdKYcam/dqwPFJvggCstAX6DrQxpNSKl2VE t9EJoFnlOcg67BZyjqDX1owqJu8nm02XoO5bJdcNV4wsKh+G5V5ySLi2kVm3wL/sVwOfpN sPyY62BwVKjCYcZPQHrqFPLL+5if8eFoy/tCENEp4kRaXe1wtig4BYq9JLGt3Nd9ihrLYP bMrsiaanpf8o9x0GVoamsgF4qP8YWqJyqSoI73VysjBk/OU4YXIJMrIxZmoT6KiVTZJPSa tFMVDPRjTctMHfj/e+6T5FAHJywdd9iyg9zRy4txvw7dAY18grDMZSnW+kWfNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677581261; 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=2ALyMIItrZ5UwlVnnAiibFU9fBaSy9MrPwT2VhCkpPY=; b=may2hVgjp8uRIjmCA9pdmp4GDajfmI/6Ty3R73ZgD4pt8rH3UmlCZ5KkVxP4ghAgUES3vv hClSuIBbq1Fy//nhSS3malEItamiEFRjX6eLuCf1GeNrSdB9d8AWAtdWH0dwG0YbAoxmAd gzqITI2nfR/Tkz6VqQYkswwuizJ1MNpNda6AS77w/wCPATQKAaFC08wd3NLwduScsYG7Gg zvBQCTZQ/OWadaeikduMIA3DeJxpdvHxwD6a2yd5aeYyPWet+lqw11EwDyglUseR+Rpvry xpASlCJNi5NBP6WWN/kiZeQCogRpH5TXdX1Yh6LUgBuMpOotZYj9b2o+9mWRDw== X-Migadu-Spam-Score: -6.17 X-Spam-Score: -6.17 X-Migadu-Queue-Id: D16CD2C083 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Kco9lzGp; 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"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: AxgVab+bIoE5 stardiviner 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 . Support Org development at , or support my work at