summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-08-20 05:40:25 +0200
committerBastien Guerry <bzg@altern.org>2012-08-20 05:40:25 +0200
commit58a6d823ee82cade1805fa032583608174f6a305 (patch)
tree2639956c18d14cb6990e4ed684eafc836f5c6864
parent7d117bd9810e4a01ac6055744c0ae4dec3c36964 (diff)
downloadorg-mode-58a6d823ee82cade1805fa032583608174f6a305.tar.gz
org.el: Fix bug in `org-mark-subtree'
* org.el (org-mark-subtree): Maybe call `org-mark-element' interactively. (org-mark-element): Only mark further elements when called interactively. For example, M-x org-export RET calls `org-mark-subtree' and should not mark the further element when an element is already marked. Thanks To Bernt Hansen for reporting a bug related to this.
-rw-r--r--lisp/org.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index e86abcd..36e843fe 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20748,7 +20748,9 @@ hierarchy of headlines by UP levels before marking the subtree."
((org-before-first-heading-p) (error "Not in a subtree"))
(t (outline-previous-visible-heading 1))))
(when up (while (and (> up 0) (org-up-heading-safe)) (decf up)))
- (org-mark-element))
+ (if (org-called-interactively-p 'any)
+ (call-interactively 'org-mark-element)
+ (org-mark-element)))
;;; Indentation
@@ -21979,8 +21981,9 @@ ones already marked."
(interactive)
(require 'org-element)
(let (deactivate-mark)
- (if (or (and (eq last-command this-command) (mark t))
- (and transient-mark-mode mark-active))
+ (if (and (org-called-interactively-p 'any)
+ (or (and (eq last-command this-command) (mark t))
+ (and transient-mark-mode mark-active)))
(set-mark
(save-excursion
(goto-char (mark))