mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-13 00:09:53 +00:00
org-element-ast: New function `org-element-type-p'
This commit is contained in:
parent
ae49451364
commit
6b20a23065
|
@ -226,6 +226,19 @@ when NODE is an anonymous node."
|
|||
'anonymous)
|
||||
(t nil)))
|
||||
|
||||
(define-inline org-element-type-p (node types)
|
||||
"Return non-nil when NODE type is one of TYPES.
|
||||
TYPES can be a type symbol or a list of symbols."
|
||||
(if (inline-const-p types)
|
||||
(if (listp (inline-const-val types))
|
||||
(inline-quote (memq (org-element-type ,node t) ,types))
|
||||
(inline-quote (eq (org-element-type ,node t) ,types)))
|
||||
(inline-letevals (node types)
|
||||
(inline-quote
|
||||
(if (listp ,types)
|
||||
(memq (org-element-type ,node t) ,types)
|
||||
(eq (org-element-type ,node t) ,types))))))
|
||||
|
||||
(defun org-element-secondary-p (node)
|
||||
"Non-nil when NODE directly belongs to a secondary node.
|
||||
Return value is the containing property name, as a keyword, or nil."
|
||||
|
|
Loading…
Reference in a new issue