From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: [PATCH 1/5] Extend scope 'region to include body of last headline in active region Date: Thu, 25 Aug 2011 06:25:30 +0200 Message-ID: <1314246334-5053-2-git-send-email-dmaus@ictsoc.de> References: <87obzpl3ec.fsf@gnu.org> Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwRVx-0001CY-Jb for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 00:26:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwRVw-0002U7-GG for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 00:26:01 -0400 Received: from app1b.xlhost.de ([213.202.242.162]:59398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwRVw-0002U1-7J for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 00:26:00 -0400 In-Reply-To: <87obzpl3ec.fsf@gnu.org> 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: emacs-orgmode@gnu.org Cc: David Maus * 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)))) (if (not scope) (progn -- 1.7.2.5