summaryrefslogtreecommitdiff
path: root/s.el
diff options
context:
space:
mode:
authorBasil L. Contovounesios <contovob@tcd.ie>2017-03-13 18:51:13 +0000
committerBasil L. Contovounesios <contovob@tcd.ie>2017-04-28 13:40:54 +0100
commit682e808ae7463d6a54862afc6d5bf6bf73b51be6 (patch)
tree59f19750356edc64242c130bd69bbf87d283382d /s.el
parentd1f20fd835a65b5c01e58f2050c8f4051e3fc5f0 (diff)
Conditionally require ucs-normalize
Defer requiring ucs-normalize until variable ucs-normalize-combining-chars is used in function s-reverse. This should result in s.el loading faster. Addresses issue #77
Diffstat (limited to 's.el')
-rw-r--r--s.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/s.el b/s.el
index 9a2b4f4..849e245 100644
--- a/s.el
+++ b/s.el
@@ -27,8 +27,6 @@
;;; Code:
-(require 'ucs-normalize)
-
(defun s-trim-left (s)
"Remove whitespace at the beginning of S."
(save-match-data
@@ -380,7 +378,8 @@ attention to case differences."
"Return the reverse of S."
(if (multibyte-string-p s)
(let ((input (string-to-list s))
- (output ()))
+ output)
+ (require 'ucs-normalize)
(while input
;; Handle entire grapheme cluster as a single unit
(let ((grapheme (list (pop input))))