From 685b2c441008c4fe3b083d9f11b1123af6f37183 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 11 Mar 2020 21:52:19 +0100 Subject: [PATCH] org-macro: Fix last commit * lisp/org-macro.el (org-macro--set-template): Do not override value with an empty one. This is a followup to 965cdbfd4b3316cc9044854b0e5eb5cf69927ce6. --- lisp/org-macro.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-macro.el b/lisp/org-macro.el index 63425eaee..35e114987 100644 --- a/lisp/org-macro.el +++ b/lisp/org-macro.el @@ -89,9 +89,9 @@ VALUE is the template of the macro. The new value override the previous one, unless VALUE is nil. TEMPLATES is the list of templates. Return the updated list." (let ((old-definition (assoc name templates))) - (if (and value old-definition) - (setcdr old-definition value) - (push (cons name (or value "")) templates))) + (cond ((and value old-definition) (setcdr old-definition value)) + (old-definition) + (t (push (cons name (or value "")) templates)))) templates) (defun org-macro--collect-macros (&optional files templates)