From bc483144356c0099060ed3761d0591828c0c85ea Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Wed, 24 Aug 2022 03:03:43 +0200 Subject: [PATCH] Fallback value The `when' block would only return a string when the condition is satisfied. If not, it returns `nil'. This is not acceptable, as `postfix' is later used in a `concat'. This commit makes `postfix' an empty string if the `when' condition fails in order to prevent this concatenation issue. --- org-unique-id.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/org-unique-id.el b/org-unique-id.el index 8546f45..0c43e46 100644 --- a/org-unique-id.el +++ b/org-unique-id.el @@ -69,10 +69,9 @@ the variable `org-unique-id-prefix'." prefix org-unique-id-prefix)) (etime (org-reverse-string (org-id-time-to-b36))) - (postfix (when org-id-include-domain - (progn - (require 'message) - (concat "@" (message-make-fqdn)))))) + (postfix (if org-id-include-domain + (concat "@" (message-make-fqdn)) + ""))) (concat prefix "-" (car (split-string (concat etime postfix) "-"))))) ;;;###autoload