branch: externals/denote
commit ba7561688d4051cf52fdb9f05185824d6bf7a9f8
Author: Jean-Philippe Gagné Guay <[email protected]>
Commit: Jean-Philippe Gagné Guay <[email protected]>

    Remove unnecessary code in denote-trim-* functions and 
denote-extract-keywords-from-front-matter
---
 denote.el | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/denote.el b/denote.el
index 4e08511e27..0b8318451f 100644
--- a/denote.el
+++ b/denote.el
@@ -1080,10 +1080,8 @@ This can be used in `denote-file-types' to format front 
mattter."
 (defun denote-trim-whitespace (s)
   "Trim whitespace around string S.
 This can be used in `denote-file-types' to format front mattter."
-  (if (string-blank-p s)
-      ""
-    (let ((trims "[ \t\n\r]+"))
-      (string-trim s trims trims))))
+  (let ((trims "[ \t\n\r]+"))
+    (string-trim s trims trims)))
 
 (defun denote--trim-quotes (s)
   "Trim quotes around string S."
@@ -1093,9 +1091,7 @@ This can be used in `denote-file-types' to format front 
mattter."
 (defun denote-trim-whitespace-then-quotes (s)
   "Trim whitespace then quotes around string S.
 This can be used in `denote-file-types' to format front mattter."
-  (if (string-blank-p s)
-      ""
-    (denote--trim-quotes (denote-trim-whitespace s))))
+  (denote--trim-quotes (denote-trim-whitespace s)))
 
 (defun denote-format-keywords-for-md-front-matter (keywords)
   "Format front matter KEYWORDS for markdown file type.
@@ -1119,13 +1115,10 @@ for how this is used."
 
 (defun denote-extract-keywords-from-front-matter (keywords-string)
   "Extract keywords list from front matter KEYWORDS-STRING.
-Split KEYWORDS-STRING into a list of strings.  If KEYWORDS-STRING
-satisfies `string-blank-p', return an empty list.
+Split KEYWORDS-STRING into a list of strings.
 
 Consult the `denote-file-types' for how this is used."
-  (if (string-blank-p keywords-string)
-      '()
-    (split-string keywords-string "[:,\s]+" t "[][ \"']+")))
+  (split-string keywords-string "[:,\s]+" t "[][ \"']+"))
 
 (defvar denote-file-types
   '((org

Reply via email to