emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 1/5] Extend scope 'region to include body of last headline in


From: David Maus
Subject: [O] [PATCH 1/5] Extend scope 'region to include body of last headline in active region
Date: Thu, 25 Aug 2011 06:25:30 +0200

* 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]