Subject: bug#35689: Customizable char-fold

From: Juri Linkov <[email-masked]>
Date: Thu, 16 May 2019 23:13:17 +0300

>> I can't find a standard way of doing this.  So instead of using eval-and-compile
>> I'll try to recalculate the value explicitly when variables are customized:
>>
>>   (when (or (get 'char-fold-include-base  'customized-value)
>>             (get 'char-fold-include-alist 'customized-value)
>>             (get 'char-fold-exclude-alist 'customized-value))
>>     (setq char-fold-table (char-fold-make-table)))
>
> Instead of looking at symbol property values, which can make for a
> confusing time when setting variables outside of customize, I think it
> would be nicer to do something like this:
>
>     (eval-and-compile (defconst char-fold--include-base-default ...))
>
>     (defcustom char-fold-include-base char-fold--include-base-default
>       :initialize #'custom-initialize-changed

I tried different possible values of :initialize,
but not custom-initialize-changed.  I'll try this now.

The problem I encountered with the previous solution it that
calling `(setq char-fold-table (char-fold-make-table))' above
while loading char-fold.el by autoload, garbled data returned
from `(unicode-property-table-internal 'decomposition)',
it just returned garbage, maybe due to a broken coding.
I was busy debugging unidata-get-decomposition to
understand where this data corruption occurs.