From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AO7QMfAv4WPOVAAAbAwnHQ (envelope-from ) for ; Mon, 06 Feb 2023 17:50:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2DGrMfAv4WPtvAAAauVa8A (envelope-from ) for ; Mon, 06 Feb 2023 17:50:56 +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 6E0742F96F for ; Mon, 6 Feb 2023 17:50:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP4gy-0000Mw-D6; Mon, 06 Feb 2023 11:50:08 -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 1pP4gV-0000HR-53 for emacs-orgmode@gnu.org; Mon, 06 Feb 2023 11:49:41 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP4gT-0004u0-Gn for emacs-orgmode@gnu.org; Mon, 06 Feb 2023 11:49:38 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pP4gR-0001MI-RZ for emacs-orgmode@gnu.org; Mon, 06 Feb 2023 17:49:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH v5] org.el: Warning for unsupported markers in `org-set-emphasis-alist' Date: Mon, 6 Feb 2023 23:49:30 +0700 Message-ID: References: <87o86mw86r.fsf@localhost> <87fsrxkahq.fsf@nicolasgoaziou.fr> <87fsrxa1j5.fsf@localhost> <878rxoa6lk.fsf@localhost> <87pmqtj09r.fsf@localhost> <87mt9743di.fsf@localhost> <871qqhlskf.fsf@localhost> <87r0v8pcdb.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US In-Reply-To: <87r0v8pcdb.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 17 X-Spam_score: 1.7 X-Spam_bar: + X-Spam_report: (1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-1.148, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675702256; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/zonQQZrt81s90dgTIdqkYJwFEkJXDOiYf+7Z6Hj6ik=; b=AD5jFJF2MEsYg1d/qSrXl8FAqqpWAKJuEbHBWnwvGPPyp/zhrHveNDtMm4NAb17NjVguwp tfw0qYgVxegNsnD3ZGF/T0SX1uYFv/l0KEPcdxP6xJslIUwRvgmkY1m2OiJb45JF3Fvter KbsMVVW3F/95Sc5SvIEjiryKys2rVkmE3PvbD+uI65orYftXZcf16ORv347OTgT6lIIhjw FD6S664CJs1dMVpCOrukvqrprHxBRs7qhKWnbHtR2zIVMrxQaiQ8aQ30vsltaGk+W0sBiz t/NmYQ/3kdnyvy9zLpBMhUsmBhNQFAy0EJJsFqxCzm00v6bbCiahFcHlpX037w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675702256; a=rsa-sha256; cv=none; b=nQZBC3pOONoXW/3Ct3164KFc9B55QNB7fg7ec+Weby8mYVvGo0fvq/BM47fOsDEvi0G9p+ klUptPtcDvIlius6Dyt4hbzPuiz2BSkCR/l9BOC/h5LOqMStqO8SIAvwJjy0GhVqWWBMUi Sd8OUVoikYYWhPsM3uW7ZY13E48QjbVubrHOWUn14PZPV1orGP7DFCJdfMkWjR++JNFH+u ZcFDTVMLz2bXyDCTjFJ4cyGUFi+X0YJcIt18Fir8tR4kOEgwSy9E3EZY1HauqJnRTQQmGm rOG89RhLl6c8SdJoDbx4Z9a3sn0IV1VIDrEvtcLVDwL/4CPnjQuTdhHU5abEgw== X-Migadu-Spam-Score: -1.59 X-Spam-Score: -1.59 X-Migadu-Queue-Id: 6E0742F96F X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; 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=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) X-TUID: Wt/FsIoYZKUv On 02/02/2023 17:53, Ihor Radchenko wrote: > (defun org-set-emph-re (var val) > - "Set variable and compute the emphasis regular expression." > + "Set VAR to VAL and compute the emphasis regular expression. > +The function is intended for :set argument of `defcustom' for > +`org-emphasis-alist'." > (set-default-toplevel-value var val) ... > +(add-variable-watcher 'org-emphasis-alist #'org-emphasis-alist--check-value) Thinking more I have realized that I am in doubts if `add-variable-watcher' is appropriate tool in this particular case. The only way to get some effect from change of `org-emphasis-alist' is to call `org-set-emph-re' (its :set function), so it should be enough to call `org-emphasis-alist--check-value' from `org-set-emph-re'. I have no idea what should be considered as best practice: should `set-default-toplevel-value' be combined with changes of `org-emph-re' as it is done in current code or `org-set-emph-re' should be split into the function that modifies `org-emph-re' (so it can be called separately) and a tiny setter (that may be defined as lambda this case) that calls the new function and `set-default-toplevel-value'.