Преглед изворни кода

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.
Nicolas Goaziou пре 5 година
родитељ
комит
685b2c4410
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      lisp/org-macro.el

+ 3 - 3
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
 previous one, unless VALUE is nil.  TEMPLATES is the list of
 templates.  Return the updated list."
 templates.  Return the updated list."
   (let ((old-definition (assoc name templates)))
   (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)
   templates)
 
 
 (defun org-macro--collect-macros (&optional files templates)
 (defun org-macro--collect-macros (&optional files templates)