summaryrefslogtreecommitdiff
path: root/ebib-keywords.el
diff options
context:
space:
mode:
authorJoost Kremers <joostkremers@fastmail.fm>2016-12-07 01:06:21 +0100
committerJoost Kremers <joostkremers@fastmail.fm>2016-12-07 01:06:21 +0100
commitf73ee00134d9848d5e9bcb03002e7bfc28581f4e (patch)
tree392d6d810c09c63ad95736f7b7dc527102196c9c /ebib-keywords.el
parent10850a1aed3cef6cc838b62fed5930b98989924c (diff)
Upgrade dependency on Emacs 24.4.
Diffstat (limited to 'ebib-keywords.el')
-rw-r--r--ebib-keywords.el9
1 files changed, 2 insertions, 7 deletions
diff --git a/ebib-keywords.el b/ebib-keywords.el
index 7903669..c6a6255 100644
--- a/ebib-keywords.el
+++ b/ebib-keywords.el
@@ -128,16 +128,11 @@ Also automatically remove duplicates."
(file-name-directory (ebib-db-get-filename db))))) ; per-directory keywords files
(push keyword (cl-third (assoc dir ebib--keywords-files-alist))))))
-(defun ebib--keywords-to-list (str)
+(defsubst ebib--keywords-to-list (str)
"Convert STR to a list of keywords.
STR should be a string containing keywords separated by
`ebib-keywords-separator'."
- ;; TODO I use `replace-regexp-in-string' to trim the individual strings.
- ;; In Emacs 24.4, `split-string' has an additional argument that does
- ;; this, but that's not available in 24.3. An alternative would be
- ;; `s-trim' from the `s' library.
- (--map (replace-regexp-in-string "\\`[[:space:]]*\\(.*?\\)[[:space:]]*\\'" "\\1" it t)
- (split-string str (regexp-quote ebib-keywords-separator) t)))
+ (split-string str (regexp-quote ebib-keywords-separator) t "[[:space:]]*"))
(defun ebib--keywords-sort (keywords)
"Sort the KEYWORDS string, remove duplicates, and return it as a string.