Function: org-capture-store-last-position

org-capture-store-last-position is a byte-compiled function defined in org-capture.el.gz.

Signature

(org-capture-store-last-position)

Documentation

Store the last-captured position.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-capture.el.gz
(defun org-capture-store-last-position ()
  "Store the last-captured position."
  (let* ((where (org-capture-get :position-for-last-stored 'local))
	 (pos (cond
	       ((markerp where)
		(prog1 (marker-position where)
		  (move-marker where nil)))
	       ((and (listp where) (eq (car where) 'table-line))
		(if (org-at-table-p)
		    (save-excursion
		      (org-table-goto-line (nth 1 where))
                      (line-beginning-position))
		  (point))))))
    (with-current-buffer (buffer-base-buffer (current-buffer))
      (org-with-point-at pos
        ;; FIXME: `org-capture-bookmark' is obsolete.  To be removed
        ;; in future Org releases.
	(when (with-no-warnings org-capture-bookmark)
	  (let ((bookmark (plist-get org-bookmark-names-plist :last-capture)))
	    (when bookmark
              (condition-case err
                  (bookmark-set bookmark)
                (error
                 (message "Bookmark set error: %S" err))))))
	(move-marker org-capture-last-stored-marker (point))))))