[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH 1/5] Extend scope 'region to include body of last headlin
From: |
David Maus |
Subject: |
Re: [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region |
Date: |
Tue, 30 Aug 2011 06:33:09 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Hi Carsten,
At Thu, 25 Aug 2011 07:40:52 +0200,
Carsten Dominik wrote:
>
>
> On 25.8.2011, at 06:25, David Maus wrote:
>
> > * org.el (org-map-entries): Extend scope 'region to include entire
> > body of last headline in active region.
> > ---
> > lisp/org.el | 8 ++++++--
> > 1 files changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/lisp/org.el b/lisp/org.el
> > index de8c72b..b69b77c 100644
> > --- a/lisp/org.el
> > +++ b/lisp/org.el
> > @@ -13633,8 +13633,12 @@ a *different* entry, you cannot use these
> > techniques."
> > (org-narrow-to-subtree)
> > (setq scope nil))
> > ((and (eq scope 'region) (org-region-active-p))
> > - (narrow-to-region (region-beginning) (region-end))
> > - (setq scope nil)))
> > + (let ((end (save-excursion
> > + (goto-char (region-end))
> > + (outline-next-heading)
> > + (point))))
> > + (narrow-to-region (region-beginning) end)
> > + (setq scope nil))))
>
>
> Hi David,
>
> I think the better algorithm here would be this:
> If region-end is at the beginning of a line and that line is a headline,
> use region-end as it is. If not, jump to the next headline.
Thanks, yes. This makes sense. Attached patch supersedes the previous.
Best,
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
0001-Extend-scope-region-to-include-entire-body-of-last-h.patch
Description: Text document
pgp5VwoseHoSM.pgp
Description: PGP signature
- Re: [O] New feature: loop over siblings for some commands, (continued)
- Re: [O] New feature: loop over siblings for some commands, Bastien, 2011/08/16
- [O] [PATCH 0/5] loop over headlines in active region, David Maus, 2011/08/25
- Re: [O] [PATCH 0/5] loop over headlines in active region, Carsten Dominik, 2011/08/25
- Re: [O] [PATCH 0/5] loop over headlines in active region, David Maus, 2011/08/28
- Re: [O] [PATCH 0/5] loop over headlines in active region, Carsten Dominik, 2011/08/29
- Re: [O] [PATCH 0/5] loop over headlines in active region, David Maus, 2011/08/30
- Re: [O] [PATCH 0/5] loop over headlines in active region, Štěpán Němec, 2011/08/25
- Re: [O] [PATCH 0/5] loop over headlines in active region, David Maus, 2011/08/28
- [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region, David Maus, 2011/08/25
- Re: [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region, Carsten Dominik, 2011/08/25
- Re: [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region,
David Maus <=
- [O] [PATCH 2/5] Immediately return if scope is region but no region is active, David Maus, 2011/08/25
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, Carsten Dominik, 2011/08/25
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, David Maus, 2011/08/28
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, Carsten Dominik, 2011/08/29
- Re: [O] [PATCH 2/5] Immediately return if scope is region but no region is active, David Maus, 2011/08/30
- [O] [PATCH 3/5] New customization variable: Loop over headlines in active region, David Maus, 2011/08/25
- [O] [PATCH 4/5] Skip invisible headlines when mapping over headlines in active region, David Maus, 2011/08/25
- [O] [PATCH 5/5] Avoid conflict between bulk command and loop-over-headlines, David Maus, 2011/08/25