Function: org-element-entity-parser

org-element-entity-parser is a byte-compiled function defined in org-element.el.gz.

Signature

(org-element-entity-parser)

Documentation

Parse entity at point, if any.

When at an entity, return a list whose car is entity and cdr a plist with :begin, :end, :latex, :latex-math-p,
:html, :latin1, :utf-8, :ascii, :use-brackets-p and
:post-blank as keywords. Otherwise, return nil.

Assume point is at the beginning of the entity.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-element.el.gz
;;;; Entity

(defun org-element-entity-parser ()
  "Parse entity at point, if any.

When at an entity, return a list whose car is `entity' and cdr
a plist with `:begin', `:end', `:latex', `:latex-math-p',
`:html', `:latin1', `:utf-8', `:ascii', `:use-brackets-p' and
`:post-blank' as keywords.  Otherwise, return nil.

Assume point is at the beginning of the entity."
  (catch 'no-object
    (when (looking-at "\\\\\\(?:\\(?1:_ +\\)\\|\\(?1:there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\(?2:$\\|{}\\|[^[:alpha:]]\\)\\)")
      (save-excursion
	(let* ((value (or (org-entity-get (match-string 1))
			  (throw 'no-object nil)))
	       (begin (match-beginning 0))
	       (bracketsp (string= (match-string 2) "{}"))
	       (post-blank (progn (goto-char (match-end 1))
				  (when bracketsp (forward-char 2))
				  (skip-chars-forward " \t")))
	       (end (point)))
	  (list 'entity
		(list :name (car value)
		      :latex (nth 1 value)
		      :latex-math-p (nth 2 value)
		      :html (nth 3 value)
		      :ascii (nth 4 value)
		      :latin1 (nth 5 value)
		      :utf-8 (nth 6 value)
		      :begin begin
		      :end end
		      :use-brackets-p bracketsp
		      :post-blank post-blank)))))))