From mboxrd@z Thu Jan 1 00:00:00 1970 From: aditya siram Subject: Re: Change org-back-to-heading to use org's heading regex Date: Tue, 17 Sep 2013 17:37:13 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3a8ccb61b4404e69bf842 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VM3u7-0004UR-Iw for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 18:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VM3u6-0002GJ-Im for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 18:37:55 -0400 Received: from mail-ie0-x236.google.com ([2607:f8b0:4001:c03::236]:33372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VM3u6-0002GB-BU for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 18:37:54 -0400 Received: by mail-ie0-f182.google.com with SMTP id aq17so11553262iec.13 for ; Tue, 17 Sep 2013 15:37:53 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org --001a11c3a8ccb61b4404e69bf842 Content-Type: text/plain; charset=ISO-8859-1 Yes, you're right. And while I was looking for an alternate solution I found `org-heading-components` which does everything I need and more! Thanks! -deech On Sat, Sep 14, 2013 at 5:21 PM, Carsten Dominik wrote: > Hi Aditya, > > I do not support this idea. > > 1. sometimes Org functions are used in other modes, with a different value > for the outline regexp. WHile this will not work for many Org functions, > it is useful to have it work for some. > > 2. For just searching headings, it is efficient to use a regexp that is as > simple as possible and does not need to do any back tracking. > > 3. You can easily use the simple regexps to find a heading. If you need > detailed info, match again with looking-at and then use the match data. > > Regards > > - Carsten > > On 14.9.2013, at 23:30, aditya siram wrote: > > > Hi all, > > Org-mode uses two regex's to find headings, one from outline.el and one > defined internally and captures more information. I propose we stop using > the one from outline.el. > > > > org-mode uses `org-back-to-heading` a lot to navigate point back to the > nearest heading. > > > > This just delegates to `outline-back-to-heading` from the outline.el > package, which uses a regex for finding headlines: "[*\^L]+" > > > > Org also defines another heading regex which is more capable and > captures more information: "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$". > > > > I would propose changing org-back-to-heading to use that so that a user > (like me :) ) can use `match-string` to grab the relevant parts of the > string. > > > > Since this is a pretty simple, but sweeping change, I thought I'd bring > it up here first before patching. > > > > Thanks! > > -deech > > > > > > > > --001a11c3a8ccb61b4404e69bf842 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Yes, you're right. And while I was looking for an alte= rnate solution I found `org-heading-components` which does everything I nee= d and more!
Thanks!
-deech

<= br>
On Sat, Sep 14, 2013 at 5:21 PM, Carsten Dominik= <carsten.dominik@gmail.com> wrote:
Hi Aditya,

I do not support this idea.

1. sometimes Org functions are used in other modes, with a different value = for the outline regexp. =A0WHile this will not work for many Org functions,= it is useful to have it work for some.

2. For just searching headings, it is efficient to use a regexp that is as = simple as possible and does not need to do any back tracking.

3. You can easily use the simple regexps to find a heading. =A0If you need = detailed info, match again with looking-at and then use the match data.

Regards

- Carsten

On 14.9.2013, at 23:30, aditya siram <aditya.siram@gmail.com> wrote:

> Hi all,
> Org-mode uses two regex's to find headings, one from outline.el an= d one defined internally and captures more information. I propose we stop u= sing the one from outline.el.
>
> org-mode uses `org-back-to-heading` a lot to navigate point back to th= e nearest heading.
>
> This just delegates to `outline-back-to-heading` from the outline.el p= ackage, which uses a regex for finding headlines: "[*\^L]+"
>
> Org also defines another heading regex which is more capable and captu= res more information: "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$". >
> I would propose changing org-back-to-heading to use that so that a use= r (like me :) ) can use `match-string` to grab the relevant parts of the st= ring.
>
> Since this is a pretty simple, but sweeping change, I thought I'd = bring it up here first before patching.
>
> Thanks!
> -deech
>
>
>


--001a11c3a8ccb61b4404e69bf842--