emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: search-default-mode char-fold-to-regexp and Greek Extended block cha


From: Juri Linkov
Subject: Re: search-default-mode char-fold-to-regexp and Greek Extended block characters, Re: search-default-mode char-fold-to-regexp and Greek Extended block characters
Date: Fri, 26 Jul 2019 00:35:51 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> How about the following? It passes your tests with the FIXMEs
> uncommented (and isearch for multiple iotas matches multiple iotas +
> combining diacriticals).
>
> I deliberately restricted it to lower case characters, since the
> roundtripping fails for İ and a large number of titlecase characters.
>
> diff --git i/lisp/char-fold.el w/lisp/char-fold.el
> index f379229e6c..91fd7ddc28 100644
> --- i/lisp/char-fold.el
> +++ w/lisp/char-fold.el
> @@ -108,6 +108,17 @@
>                                      (car next-decomp)))
>                             (funcall make-decomp-match-char (list (car 
> next-decomp)) char)))
>                       (setq dec next-decomp)))
> +               ;; If there is no precomposed uppercase version of a
> +               ;; character with diacriticals, we also add a mapping
> +               ;; from the base character to the base character with
> +               ;; combining diacriticals
> +               (when (eq (get-char-code-property char 'general-category) 'Ll)
> +                 (let* ((str (char-to-string char))
> +                        (upper (upcase str))
> +                        (roundtrip (downcase upper)))
> +                   (when (> (length roundtrip) 1)
> +                     (aset equiv (aref roundtrip 0)
> +                           (cons roundtrip (aref equiv (aref roundtrip 
> 0)))))))
>                 ;; Do it again, without the non-spacing characters.
>                 ;; This allows 'a' to match 'ä'.
>                 (let ((simpler-decomp nil)

If there are many such cases, then better to handle them automatically indeed
(if this doesn't cause slowdown too much) instead of adding them one by one
to the default values.  Does this handle ß as well?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]