emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5] org.el: Warning for unsupported markers in `org-set-empha


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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]