branch: elpa/flx
commit 9e7749e9e6428fcb0399c0d5fa56f42dd6513cd3
Merge: c41f9f5087 8849b39816
Author: Le Wang <[email protected]>
Commit: Le Wang <[email protected]>
Merge pull request #27 from bbatsov/fix-capital-check
Make flx-capital-p behave correctly for non-latin words
---
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))