Function: org-element-subscript-parser

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

Signature

(org-element-subscript-parser)

Documentation

Parse subscript at point, if any.

When at a subscript object, return a list whose car is subscript and cdr a plist with :begin, :end,
:contents-begin, :contents-end, :use-brackets-p and
:post-blank as keywords. Otherwise, return nil.

Assume point is at the underscore.

Source Code

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

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

When at a subscript object, return a list whose car is
`subscript' and cdr a plist with `:begin', `:end',
`:contents-begin', `:contents-end', `:use-brackets-p' and
`:post-blank' as keywords.  Otherwise, return nil.

Assume point is at the underscore."
  (save-excursion
    (unless (bolp) (backward-char))
    (when (looking-at org-match-substring-regexp)
      (let ((bracketsp (match-beginning 4))
	    (begin (match-beginning 2))
	    (contents-begin (or (match-beginning 4)
				(match-beginning 3)))
	    (contents-end (or (match-end 4) (match-end 3)))
	    (post-blank (progn (goto-char (match-end 0))
			       (skip-chars-forward " \t")))
	    (end (point)))
	(list 'subscript
	      (list :begin begin
		    :end end
		    :use-brackets-p bracketsp
		    :contents-begin contents-begin
		    :contents-end contents-end
		    :post-blank post-blank))))))