From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Fix before first heading check Date: Mon, 20 Dec 2010 14:05:50 +0100 Message-ID: <25DA498F-727F-4A87-A7AD-A3284AF5C96B@gmail.com> References: <1292794374-16635-1-git-send-email-bernt@norang.ca> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=44930 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUfR8-00080P-HU for emacs-orgmode@gnu.org; Mon, 20 Dec 2010 08:05:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUfR6-0007eh-JQ for emacs-orgmode@gnu.org; Mon, 20 Dec 2010 08:05:57 -0500 Received: from mail-bw0-f43.google.com ([209.85.214.43]:60433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUfR6-0007eW-3G for emacs-orgmode@gnu.org; Mon, 20 Dec 2010 08:05:56 -0500 Received: by bwz14 with SMTP id 14so3091243bwz.30 for ; Mon, 20 Dec 2010 05:05:55 -0800 (PST) In-Reply-To: <1292794374-16635-1-git-send-email-bernt@norang.ca> 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: Bernt Hansen Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On Dec 19, 2010, at 10:32 PM, Bernt Hansen wrote: > * 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 > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode