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


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 35689 <at> debbugs.gnu.org, npostavs <at> gmail.com
Subject: bug#35689: Customizable char-fold
Date: Mon, 24 Jun 2019 19:33:45 +0200
Juri Linkov <juri <at> linkov.net> writes:

> -(defconst char-fold-table

[...]

> +(defcustom char-fold-symmetric char-fold--symmetric-default
> +  "Include symmetric mappings from composite character back to base letter."
> +  :type 'boolean
> +  :initialize #'custom-initialize-changed
> +  :set (lambda (sym val)
> +         (set-default sym val)
> +         ;; FIXME: Maybe delay this until after-init-hook,
> +         ;; to avoid redundant calls to char-fold-make-table.
> +         (setq char-fold-table (char-fold-make-table)))

OK, here's an uninformed suggestion -- instead of doing all this to
ensure that we have an updated char-fold-table when the user changes
these defaults, why not call char-fold-make-table when needed?

That is, instead of the char-fold-table variable, you'd have a
char-fold-data, which could be, say, something like this:

(defvar char-fold-data :uninitialized)

`char-fold-to-regexp' (and others) would then start with a call to
char-fold-update which would 

be

(let ((new (list :additional char-fold--include-alist-default
                 :exclude char-fold--exclude-alist-default
                 ...)))
  (unless (equal char-fold-data new)
    (setq char-fold-table (char-fold-make-table)
          char-fold-data new)))

or something along those lines.  That is, check whether anything has
changed, and if not, do nothing, but if it has, recompute?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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.