emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/flx 8849b39816 066/182: Make flx-capital-p behave correctl


From: ELPA Syncer
Subject: [nongnu] elpa/flx 8849b39816 066/182: Make flx-capital-p behave correctly for non-latin words
Date: Tue, 13 Dec 2022 03:59:30 -0500 (EST)

branch: elpa/flx
commit 8849b398161f94b94dfc48d9664f66f49555a2cf
Author: Bozhidar Batsov <bozhidar@tradeo.com>
Commit: Bozhidar Batsov <bozhidar@tradeo.com>

    Make flx-capital-p behave correctly for non-latin words
    
    It's entirely possible for one to have non-latin words in his ido
    candidates. This commit improves `flx-capital-p` by making it recognize
    non-latin letters.
---
 flx.el            | 4 ++--
 tests/flx-test.el | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/flx.el b/flx.el
index a81bbec60e..301e4a2bb4 100644
--- a/flx.el
+++ b/flx.el
@@ -78,8 +78,8 @@
 (defsubst flx-capital-p (char)
   "Check if CHAR is an uppercase character."
   (and char
-       (and (<= char ?Z)
-            (<= ?A char))))
+       (flx-word-p char)
+       (= char (upcase char))))
 
 (defsubst flx-boundary-p (last-char char)
   "Check is LAST-CHAR is the end of a word and CHAR the start of the next.
diff --git a/tests/flx-test.el b/tests/flx-test.el
index 4081a56870..880d6b6e9c 100644
--- a/tests/flx-test.el
+++ b/tests/flx-test.el
@@ -60,8 +60,10 @@
 (ert-deftest flx-capital-p ()
   (should (flx-capital-p ?A))
   (should (flx-capital-p ?Z))
+  (should (flx-capital-p ?Д))
   (should-not (flx-capital-p ?_))
-  (should-not (flx-capital-p ?a)))
+  (should-not (flx-capital-p ?a))
+  (should-not (flx-capital-p ?д)))
 
 (ert-deftest flx-word-p ()
   (should (flx-word-p ?a))



reply via email to

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