From f9b98d4f98df81ea1702beef52ce1939dcdc8f5f Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 27 Jul 2011 16:34:31 +0200 Subject: [PATCH 2/3] org.el: (org-map-entries): Allow SCOPE to be the active region. --- lisp/org.el | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 8ef9c9a..36b290a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13464,6 +13464,7 @@ SCOPE determines the scope of this command. It can be any of: nil The current buffer, respecting the restriction if any tree The subtree started with the entry at point +region The entries within the active region, if any file The current buffer, without restriction file-with-archives The current buffer, and any archives associated with it @@ -13512,10 +13513,13 @@ a *different* entry, you cannot use these techniques." (save-excursion (save-restriction - (when (eq scope 'tree) - (org-back-to-heading t) - (org-narrow-to-subtree) - (setq scope nil)) + (cond ((eq scope 'tree) + (org-back-to-heading t) + (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))) (if (not scope) (progn -- 1.7.5.2