From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 35689@debbugs.gnu.org, npostavs@gmail.com
Subject: bug#35689: Customizable char-fold
Date: Tue, 14 May 2019 23:14:12 +0300 [thread overview]
Message-ID: <87d0kkyesr.fsf@mail.linkov.net> (raw)
In-Reply-To: <406F1DF2-CB22-441F-B3E2-19770425322A@gnu.org> (Eli Zaretskii's message of "Tue, 14 May 2019 09:37:14 +0300")
>> > Oh, right. Do you see a problem with a better patch:
>>
>> > +(eval-and-compile (defcustom char-fold-include-base nil
>> > + "Include mappings from composite character to base letter."
>> > + :type 'boolean
>> > + :set (lambda (sym val)
>> > + (set sym val)
>> > + (when (boundp 'char-fold-table)
>> > + (setq char-fold-table (char-fold-make-table))))
>>
>> Looks like it could work (though I haven't tested). The docstrings
>> are
>> too terse for me easily follow, and they should probably include
>> something along the lines of "Setting this variable directly does not
>> take effect; either use M-x customize or ..."
>
> We don't gave defcustoms inside eval-and/when-compile anywhere else.
> Do we really need this? For starters, it would defeat cus-dep.el, I think.
Indeed, better to try and simplify this. The goal is to pre-compile
the default char-table because its calculation is compute-intensive,
and to recalculate a new value of char-table only in case
when customized values differ from the default values.
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)))
next prev parent reply other threads:[~2019-05-14 20:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-11 21:22 bug#35689: Customizable char-fold Juri Linkov
2019-05-12 19:12 ` Juri Linkov
2019-05-12 20:30 ` Noam Postavsky
2019-05-13 20:31 ` Juri Linkov
2019-05-13 22:18 ` Noam Postavsky
2019-05-14 6:37 ` Eli Zaretskii
2019-05-14 20:14 ` Juri Linkov [this message]
2019-05-16 14:47 ` npostavs
2019-05-16 20:13 ` Juri Linkov
2019-05-21 20:34 ` Juri Linkov
2019-05-21 21:45 ` npostavs
2019-06-06 20:49 ` Juri Linkov
2019-06-24 17:33 ` Lars Ingebrigtsen
2019-06-24 20:40 ` Juri Linkov
2019-07-23 20:28 ` Juri Linkov
2019-07-28 22:46 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d0kkyesr.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=35689@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=npostavs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.