Max Nikulin <maniku...@gmail.com> writes: >> +(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'.
Upon looking closer, `org-set-emph-re' is not affected by the value of `org-emphasis-alist' with a single exception when the value is nil. > 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'. I now reviewed the usage of `org-emphasis-alist' and setting/changing the value has the following effects: 1. nil (and only nil) value makes `org-emph-re' and `org-verbatim-re' nil. Otherwise, these regexps are not affected. Also, `org-emph-re' only affects fontification. `org-verbarim-re' affects fontification and `org-in-verbatim-emphasis'. The latter should be fixed to use org-element API. 2. The value affects `org-mode-transpose-word-syntax-table'. Should be fixed - parser is not affected by `org-emphasis-alist'. 3. Fontification is affected in `org-do-emphasis-faces'. 4. Emphasis selection dialogue in `org-emphasize' is only using the emphasis from the alist. That's all. I think that we should simply obsolete `org-emphasis-alist' and introduce individual faces for emphasis. -- 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>