Function: org-element-statistics-cookie-parser

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

Signature

(org-element-statistics-cookie-parser)

Documentation

Parse statistics cookie at point, if any.

When at a statistics cookie, return a new syntax node of statistics-cookie type containing :begin, :end, :value and
:post-blank properties. Otherwise, return nil.

Assume point is at the beginning of the statistics-cookie.

Source Code

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

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

When at a statistics cookie, return a new syntax node of
`statistics-cookie' type containing `:begin', `:end', `:value' and
`:post-blank' properties.  Otherwise, return nil.

Assume point is at the beginning of the statistics-cookie."
  (save-excursion
    (when (looking-at "\\[[0-9]*\\(%\\|/[0-9]*\\)\\]")
      (let* ((begin (point))
	     (value (buffer-substring-no-properties
		     (match-beginning 0) (match-end 0)))
	     (post-blank (progn (goto-char (match-end 0))
				(skip-chars-forward " \t")))
	     (end (point)))
	(org-element-create
         'statistics-cookie
	 (list :begin begin
	       :end end
	       :value value
	       :post-blank post-blank))))))