Function: org-agenda-insert-diary-make-new-entry

org-agenda-insert-diary-make-new-entry is a byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-insert-diary-make-new-entry TEXT)

Documentation

Make a new entry with TEXT as a child of the current subtree.

Position the point in the heading's first body line so that a timestamp can be added there.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-insert-diary-make-new-entry (text)
  "Make a new entry with TEXT as a child of the current subtree.
Position the point in the heading's first body line so that
a timestamp can be added there."
  (cond
   ((eq org-agenda-insert-diary-strategy 'date-tree-last)
    (end-of-line)
    (org-insert-heading '(4) t)
    (org-do-demote))
   (t
    (outline-next-heading)
    (org-back-over-empty-lines)
    (unless (looking-at "[ \t]*$") (save-excursion (insert "\n")))
    (org-insert-heading nil t)
    (org-do-demote)))
  (let ((col (current-column)))
    (insert text)
    (org-end-of-meta-data)
    ;; Ensure point is left on a blank line, at proper indentation.
    (unless (bolp) (insert "\n"))
    (unless (looking-at-p "^[ \t]*$") (save-excursion (insert "\n")))
    (when org-adapt-indentation (indent-to-column col)))
  (org-fold-show-set-visibility 'lineage))