From a39ee9887360a32494ea6405fa760ad3baf493b6 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 22 Mar 2019 18:32:40 +0100 Subject: [PATCH] Turn `org-dynamic-block-alist' into a defvar * lisp/org.el (org-dynamic-block-alist): Make it a defvar. Update docstring. --- etc/ORG-NEWS | 5 ++--- lisp/org.el | 13 +++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 518a6faa6..4d9530acf 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -130,9 +130,8 @@ numbered list to a lettered list. *** Add a dispatcher command to insert dynamic blocks -You can add dynamic block into ~org-dynamic-block-alist~ with function -~org-dynamic-block-define~. All dynamic blocks in -~org-dynamic-block-define~ can be used by +You can add new dynamic blocks with function +~org-dynamic-block-define~. All such dynamic blocks can be used by ~org-dynamic-block-insert-dblock~ command. *** Babel diff --git a/lisp/org.el b/lisp/org.el index db025a157..d8edafffc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9575,16 +9575,13 @@ If COMMAND is not given, use `org-update-dblock'." (unless (re-search-forward org-dblock-end-re nil t) (error "Dynamic block not terminated")))))) -(defcustom org-dynamic-block-alist nil +(defvar org-dynamic-block-alist nil "Alist defining all the Org dynamic blocks. + The key is the dynamic block type name, as a string. The value -is the function used to insert the dynamic block." - :group 'org-block - :package-version '(Org . "9.3") - :type '(alist :tag "Dynamic block name" - :key-type string - :value-type function) - :safe #'listp) +is the function used to insert the dynamic block. + +Use `org-dynamic-block-define' to populate it.") (defun org-dynamic-block-function (type) "Return function associated to a given dynamic block type.