GNU bug report logs - #35689
Customizable char-fold

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sat, 11 May 2019 21:32:01 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: bug-gnu-emacs <at> gnu.org, 35689 <at> debbugs.gnu.org,
 Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#35689: Customizable char-fold
Date: Tue, 14 May 2019 23:14:12 +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)))




This bug report was last modified 5 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.