瀏覽代碼

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.
Bernt Hansen 14 年之前
父節點
當前提交
3b1c72ae9f
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lisp/org.el

+ 3 - 1
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