summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-03-23 23:30:06 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-03-23 23:30:06 +0100
commit143a87e45c6683d29aa6c98f6a83eeb86fcb1b2b (patch)
tree593c6a5a9daccbc2ead2964024538b9be8664178
parentfa15abe6e8c0d090d3870ac55e9a501ba5c17f2e (diff)
downloadorg-mode-143a87e45c6683d29aa6c98f6a83eeb86fcb1b2b.tar.gz
org-macro: Fix infloop when re-defining built-in macros
* lisp/org-macro.el (org-macro-initialize-templates): User-defined macros have higher precedence than built-in macros. Reported-by: Eric S Fraga <esflists@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2018-03/msg00413.html>
-rw-r--r--lisp/org-macro.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org-macro.el b/lisp/org-macro.el
index 0fb0b8a..1033db2 100644
--- a/lisp/org-macro.el
+++ b/lisp/org-macro.el
@@ -130,7 +130,7 @@ Templates are stored in buffer-local variable
function installs the following ones: \"property\",
\"time\". and, if the buffer is associated to a file,
\"input-file\" and \"modification-time\"."
- (let* ((templates (org-macro--collect-macros))
+ (let* ((templates nil)
(update-templates
(lambda (cell)
(let ((old-template (assoc (car cell) templates)))
@@ -164,7 +164,7 @@ function installs the following ones: \"property\",
(org-macro--counter-initialize)
(funcall update-templates
(cons "n" "(eval (org-macro--counter-increment \"$1\" \"$2\"))"))
- (setq org-macro-templates templates)))
+ (setq org-macro-templates (nconc (org-macro--collect-macros) templates))))
(defun org-macro-expand (macro templates)
"Return expanded MACRO, as a string.