Function: org-parse-arguments

org-parse-arguments is a byte-compiled function defined in org-pcomplete.el.gz.

Signature

(org-parse-arguments)

Documentation

Parse whitespace separated arguments in the current region.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-pcomplete.el.gz
(defun org-parse-arguments ()
  "Parse whitespace separated arguments in the current region."
  (if (equal (cons "searchhead" nil) (org-thing-at-point))
      ;; [[* foo<point> bar link::search option.
      ;; Arguments are not simply space-separated.
      (save-excursion
        (let ((origin (point)))
          (skip-chars-backward "^*" (line-beginning-position))
          (cons (list (buffer-substring-no-properties (point) origin))
                (list (point)))))
    (let ((begin (line-beginning-position))
	  (end (line-end-position))
	  begins args)
      (save-restriction
        (narrow-to-region begin end)
        (save-excursion
	  (goto-char (point-min))
	  (while (not (eobp))
	    (skip-chars-forward " \t\n[")
	    (setq begins (cons (point) begins))
	    (skip-chars-forward "^ \t\n[")
	    (setq args (cons (buffer-substring-no-properties
			      (car begins) (point))
			     args)))
	  (cons (reverse args) (reverse begins)))))))