Fix multiple calls to `org-dynamic-block-alist'.
* lisp/org.el (org-dynamic-block-define): Update entry instead of piling up entries of the same type.
This commit is contained in:
parent
a39ee98873
commit
6c88d8e406
|
@ -9593,8 +9593,12 @@ TYPE is the dynamic block type, as a string."
|
||||||
(mapcar #'car org-dynamic-block-alist))
|
(mapcar #'car org-dynamic-block-alist))
|
||||||
|
|
||||||
(defun org-dynamic-block-define (type func)
|
(defun org-dynamic-block-define (type func)
|
||||||
"Define dynamic block TYPE with FUNC."
|
"Define dynamic block TYPE with FUNC.
|
||||||
(push (cons type func) org-dynamic-block-alist))
|
TYPE is a string. FUNC is the function creating the dynamic
|
||||||
|
block of such type."
|
||||||
|
(pcase (assoc type org-dynamic-block-alist)
|
||||||
|
(`nil (push (cons type func) org-dynamic-block-alist))
|
||||||
|
(`(,def . ,_) (setcdr def func))))
|
||||||
|
|
||||||
(defun org-dynamic-block-insert-dblock (type)
|
(defun org-dynamic-block-insert-dblock (type)
|
||||||
"Insert a dynamic block of type TYPE.
|
"Insert a dynamic block of type TYPE.
|
||||||
|
|
Loading…
Reference in New Issue