From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Change org-back-to-heading to use org's heading regex Date: Sun, 15 Sep 2013 00:21:43 +0200 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKyDz-0001hw-74 for emacs-orgmode@gnu.org; Sat, 14 Sep 2013 18:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKyDp-0002Hf-GX for emacs-orgmode@gnu.org; Sat, 14 Sep 2013 18:21:55 -0400 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:33028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKyDp-0002Hb-5S for emacs-orgmode@gnu.org; Sat, 14 Sep 2013 18:21:45 -0400 Received: by mail-ea0-f174.google.com with SMTP id z15so1270545ead.5 for ; Sat, 14 Sep 2013 15:21:43 -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: aditya siram Cc: emacs-orgmode@gnu.org 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. >=20 > org-mode uses `org-back-to-heading` a lot to navigate point back to = the nearest heading.=20 >=20 > This just delegates to `outline-back-to-heading` from the outline.el = package, which uses a regex for finding headlines: "[*\^L]+" >=20 > Org also defines another heading regex which is more capable and = captures more information: "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$". >=20 > 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. >=20 > Since this is a pretty simple, but sweeping change, I thought I'd = bring it up here first before patching. >=20 > Thanks! > -deech >=20 >=20 >=20