From 3b1c72ae9ffa7e2d1fcbf1470bb1abcde170d02a Mon Sep 17 00:00:00 2001 From: Bernt Hansen Date: Thu, 30 Sep 2010 08:17:57 +0000 Subject: [PATCH] Always run org-insert-heading-hook when creating headlines * lisp/org.el (org-insert-heading): Run org-insert-heading-hook when creating the first heading in a file The org-insert-heading-hook was skipped when creating the first heading in a new org file. --- lisp/org.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index af0d5fbb6..642d106d5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6686,7 +6686,9 @@ This is important for non-interactive uses of the command." (and (not (save-excursion (and (ignore-errors (org-back-to-heading invisible-ok)) (org-on-heading-p)))) (not (org-in-item-p)))) - (insert "\n* ") + (progn + (insert "\n* ") + (run-hooks 'org-insert-heading-hook)) (when (or force-heading (not (org-insert-item))) (let* ((empty-line-p nil) (head (save-excursion