Function: org-export-get-tags

org-export-get-tags is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-get-tags ELEMENT INFO &optional TAGS INHERITED)

Documentation

Return list of tags associated to ELEMENT.

ELEMENT has either an headline or an inlinetask type. INFO is a plist used as a communication channel.

When non-nil, optional argument TAGS should be a list of strings. Any tag belonging to this list will also be removed.

When optional argument INHERITED is non-nil, tags can also be inherited from parent headlines and FILETAGS keywords.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-get-tags (element info &optional tags inherited)
  "Return list of tags associated to ELEMENT.

ELEMENT has either an `headline' or an `inlinetask' type.  INFO
is a plist used as a communication channel.

When non-nil, optional argument TAGS should be a list of strings.
Any tag belonging to this list will also be removed.

When optional argument INHERITED is non-nil, tags can also be
inherited from parent headlines and FILETAGS keywords."
  (cl-remove-if
   (lambda (tag) (member tag tags))
   (if (not inherited) (org-element-property :tags element)
     ;; Build complete list of inherited tags.
     (let ((current-tag-list (org-element-property :tags element)))
       (dolist (parent (org-element-lineage element))
	 (dolist (tag (org-element-property :tags parent))
	   (when (and (org-element-type-p parent '(headline inlinetask))
		      (not (member tag current-tag-list)))
	     (push tag current-tag-list))))
       ;; Add FILETAGS keywords and return results.
       (org-uniquify (append (plist-get info :filetags) current-tag-list))))))