[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] Preserve active region when toggling heading state
From: |
Ihor Radchenko |
Subject: |
[PATCH 2/4] Preserve active region when toggling heading state |
Date: |
Sun, 15 Jan 2023 12:31:30 +0000 |
* lisp/org.el (org-todo):
(org-deadline):
(org-schedule):
(org-set-tags-command): Do not deactivate region after applying edits.
---
lisp/org.el | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 58a3434f4..9fd8189a7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9184,7 +9184,8 @@ (defun org-todo (&optional arg)
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
(let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
'region-start-level 'region))
- org-loop-over-headlines-in-active-region)
+ org-loop-over-headlines-in-active-region
+ (deactivate-mark nil))
(org-map-entries
(lambda () (org-todo arg))
nil cl
@@ -10155,13 +10156,14 @@ (defun org-deadline (arg &optional time)
can either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
(interactive "P")
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
- (org-map-entries
- (lambda () (org--deadline-or-schedule arg 'deadline time))
- nil
- (if (eq org-loop-over-headlines-in-active-region 'start-level)
- 'region-start-level
- 'region)
- (lambda () (when (org-invisible-p) (org-end-of-subtree nil t))))
+ (let ((deactivate-mark nil))
+ (org-map-entries
+ (lambda () (org--deadline-or-schedule arg 'deadline time))
+ nil
+ (if (eq org-loop-over-headlines-in-active-region 'start-level)
+ 'region-start-level
+ 'region)
+ (lambda () (when (org-invisible-p) (org-end-of-subtree nil t)))))
(org--deadline-or-schedule arg 'deadline time)))
(defun org-schedule (arg &optional time)
@@ -10176,13 +10178,14 @@ (defun org-schedule (arg &optional time)
either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
(interactive "P")
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
- (org-map-entries
- (lambda () (org--deadline-or-schedule arg 'scheduled time))
- nil
- (if (eq org-loop-over-headlines-in-active-region 'start-level)
- 'region-start-level
- 'region)
- (lambda () (when (org-invisible-p) (org-end-of-subtree nil t))))
+ (let ((deactivate-mark nil))
+ (org-map-entries
+ (lambda () (org--deadline-or-schedule arg 'scheduled time))
+ nil
+ (if (eq org-loop-over-headlines-in-active-region 'start-level)
+ 'region-start-level
+ 'region)
+ (lambda () (when (org-invisible-p) (org-end-of-subtree nil t)))))
(org--deadline-or-schedule arg 'scheduled time)))
(defun org-get-scheduled-time (pom &optional inherit)
@@ -11633,7 +11636,8 @@ (defun org-set-tags-command (&optional arg)
((and (org-region-active-p) org-loop-over-headlines-in-active-region)
(let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
'region-start-level 'region))
- org-loop-over-headlines-in-active-region) ; hint: infinite
recursion.
+ org-loop-over-headlines-in-active-region ; hint: infinite
recursion.
+ (deactivate-mark nil))
(org-map-entries
#'org-set-tags-command
nil cl
--
2.39.0
- [PATCH 0/4] Structure editing when region is active, Ihor Radchenko, 2023/01/15
- [PATCH 1/4] Preserve active region after structure edits, Ihor Radchenko, 2023/01/15
- [PATCH 2/4] Preserve active region when toggling heading state,
Ihor Radchenko <=
- [PATCH 3/4] org-metaup, org-metadown: Move subtrees in active region, Ihor Radchenko, 2023/01/15
- [PATCH 4/4] org-manual.org: Document changes in 8f6fcd709, 5719a8163, and eda9909a9, Ihor Radchenko, 2023/01/15
- Re: [PATCH 0/4] Structure editing when region is active, Samuel Wales, 2023/01/15