From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Always run org-insert-heading-hook when creating headlines Date: Wed, 29 Sep 2010 23:17:57 -0400 Message-ID: <1285816677-8438-1-git-send-email-bernt@norang.ca> References: <30F91C5F-07A4-400F-AA94-60DEB88BD77B@gmail.com> Return-path: Received: from [140.186.70.92] (port=40646 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P19ez-0000F1-EJ for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 23:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P19ey-0006Sz-30 for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 23:18:17 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:57470) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P19ey-0006SC-0r for emacs-orgmode@gnu.org; Wed, 29 Sep 2010 23:18:16 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1P19em-000BM1-Gq for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 03:18:04 +0000 In-Reply-To: <30F91C5F-07A4-400F-AA94-60DEB88BD77B@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Bernt Hansen * 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. --- Carsten, You're correct -- I completely missed the list details on this one. Here's an updated patch. Thanks for spotting this. Regards, Bernt lisp/org.el | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 75ee798..32c6c4a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6673,7 +6673,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 -- 1.7.3