diff options
author | Konubinix <konubinix@gmail.com> | 2014-11-06 11:02:23 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-02-02 13:24:37 +0100 |
commit | 2ebb14d7468fe7daf8bfc1a1a2daf2e1b71ebf38 (patch) | |
tree | efd9cce738d3b47f2c27997b47be6aeab586a5d1 | |
parent | b5d9f4be4daf0b0e8b32bc28493b2e1440fa205e (diff) | |
download | org-mode-2ebb14d7468fe7daf8bfc1a1a2daf2e1b71ebf38.tar.gz |
Make use of `org-insert-heading' instead of inserting the * character
* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level): Make
use of `org-insert-heading' instead of inserting the * character
Therefore, the hooks associated to the insertion of a heading will be
triggered. Since those hooks may cause the creation of some
metadata. `org-end-of-meta-data' is used afterward.
-rw-r--r-- | lisp/org-agenda.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 5f7c9ac..164e2d5 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -9488,7 +9488,10 @@ a timestamp can be added there." (widen) (goto-char (point-max)) (or (bolp) (insert "\n")) - (insert "* " text "\n") + (org-insert-heading) + (insert text) + (org-end-of-meta-data) + (unless (bolp) (insert "\n")) (if org-adapt-indentation (org-indent-to-column 2))) (defun org-agenda-insert-diary-make-new-entry (text) |