A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01497.html below:

ignoring combining diacritics in isearch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Robert Pluim Subject: ignoring combining diacritics in isearch Date: Wed, 23 Nov 2022 18:27:25 +0100
Over on Stack Overflow, someone has been trying to get char-folded
isearch working for Arabic, and has been having some issues because
char-folding only works for equivalent characters, not base characters
followed by combining characters. So eg searching for 'ee' when the
buffer contains

    éé

(thatʼs 'e' followed by COMBINING ACUTE ACCENT) fails.

The following patch fixes that, but itʼs a bit of a sledgehammer (the
"\\c^*" bit probably needs to be configurable, because there are
diacritic-like codepoints in Arabic that are not combining, such as
U+0640 ARABIC TATWEEL)

diff --git c/lisp/char-fold.el i/lisp/char-fold.el
index 43e3cd45ec..8e9fdd7f37 100644
--- c/lisp/char-fold.el
+++ i/lisp/char-fold.el
@@ -209,7 +209,11 @@
         ;; is used by `describe-char-fold-equivalences'.
         (map-char-table
          (lambda (char decomp-list)
-           (let ((re (regexp-opt (cons (char-to-string char) decomp-list))))
+           (let ((re
+                  (concat "\\(?:"
+                          (string-join (cons (char-to-string char) decomp-list)
+                                       "\\c^*\\|")
+                          "\\c^*\\)")))
              (aset equiv char re)))
          equiv))
       equiv)))

Thoughts?

Robert
-- 



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4