From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Fix before first heading check Date: Sun, 19 Dec 2010 16:32:54 -0500 Message-ID: <1292794374-16635-1-git-send-email-bernt@norang.ca> Return-path: Received: from [140.186.70.92] (port=42196 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUQsS-0006kB-6i for emacs-orgmode@gnu.org; Sun, 19 Dec 2010 16:33:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUQsQ-0001Te-SM for emacs-orgmode@gnu.org; Sun, 19 Dec 2010 16:33:12 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:47256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUQsQ-0001Rb-Pz for emacs-orgmode@gnu.org; Sun, 19 Dec 2010 16:33:10 -0500 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1PUQsJ-000CA4-6T for emacs-orgmode@gnu.org; Sun, 19 Dec 2010 21:33:03 +0000 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-before-first-heading-p): If point is on an org-mode heading line then we are not before the first heading If point is anywhere on the first line of the first heading then we are not before the first heading. This makes org-before-first-heading-p returns t instead of nil when on the '*' or blank of the first level 1 heading in an org file. This was noticed when the first heading has an encryption tag :crypt:. C-c C-r would not decrypt this entry if point is at the beginning of the line since it was considered before the first heading. --- This patch is available at git://git.norang.ca/org-mode.git fix-before-first-heading-check -Bernt lisp/org.el | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 53039e4..b2f32fc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -19167,6 +19167,7 @@ This version does not only check the character property, but also (defun org-before-first-heading-p () "Before first heading?" (save-excursion + (end-of-line) (null (re-search-backward "^\\*+ " nil t)))) (defun org-on-heading-p (&optional ignored) -- 1.7.3.3.464.gf80b6