Browse Source

org-element: Inline accessors

* contrib/lisp/org-element.el (org-element-type, org-element-property,
  org-element-contents, org-element-restriction): Inline functions.
Nicolas Goaziou 13 years ago
parent
commit
b6edf5649c
1 changed files with 4 additions and 4 deletions
  1. 4 4
      contrib/lisp/org-element.el

+ 4 - 4
contrib/lisp/org-element.el

@@ -3097,7 +3097,7 @@ CONTENTS is nil."
 ;; that `org-element-set-element' and `org-element-adopt-element' are
 ;; that `org-element-set-element' and `org-element-adopt-element' are
 ;; higher level functions since also update `:parent' property.
 ;; higher level functions since also update `:parent' property.
 
 
-(defun org-element-type (element)
+(defsubst org-element-type (element)
   "Return type of ELEMENT.
   "Return type of ELEMENT.
 
 
 The function returns the type of the element or object provided.
 The function returns the type of the element or object provided.
@@ -3109,15 +3109,15 @@ It can also return the following special value:
    ((not (consp element)) (and (stringp element) 'plain-text))
    ((not (consp element)) (and (stringp element) 'plain-text))
    ((symbolp (car element)) (car element))))
    ((symbolp (car element)) (car element))))
 
 
-(defun org-element-property (property element)
+(defsubst org-element-property (property element)
   "Extract the value from the PROPERTY of an ELEMENT."
   "Extract the value from the PROPERTY of an ELEMENT."
   (plist-get (nth 1 element) property))
   (plist-get (nth 1 element) property))
 
 
-(defun org-element-contents (element)
+(defsubst org-element-contents (element)
   "Extract contents from an ELEMENT."
   "Extract contents from an ELEMENT."
   (and (consp element) (nthcdr 2 element)))
   (and (consp element) (nthcdr 2 element)))
 
 
-(defun org-element-restriction (element)
+(defsubst org-element-restriction (element)
   "Return restriction associated to ELEMENT.
   "Return restriction associated to ELEMENT.
 ELEMENT can be an element, an object or a symbol representing an
 ELEMENT can be an element, an object or a symbol representing an
 element or object type."
 element or object type."