summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-05-23 13:11:57 +0200
committerBastien Guerry <bzg@altern.org>2014-05-23 13:11:57 +0200
commitfe0057556b991f29288b211a3f7fa40292d2cf60 (patch)
tree945a5123adbf6292af3698d2ddbf8d867b9ff102
parent54f4d2f4a4c0bb41d73ff8c395c490fd45c8a077 (diff)
downloadorg-mode-fe0057556b991f29288b211a3f7fa40292d2cf60.tar.gz
org.el: Don't advise `outline-end-of-subtree'
* org.el (org-move-subtree-down): Use `org-end-of-subtree' instead of `outline-end-of-subtree'. (outline-end-of-subtree): Remove advice. * org-mouse.el (org-mouse-move-tree, org-mouse-do-remotely): Use `org-end-of-subtree' instead of `outline-end-of-subtree'.
-rw-r--r--lisp/org-mouse.el13
-rw-r--r--lisp/org.el11
2 files changed, 10 insertions, 14 deletions
diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el
index 27dc0e0..74046c7 100644
--- a/lisp/org-mouse.el
+++ b/lisp/org-mouse.el
@@ -953,20 +953,23 @@ This means, between the beginning of line and the point."
(point)
(save-excursion (goto-char start)
(org-back-to-heading) (point))))
- (outline-end-of-subtree)
+ (progn (org-end-of-subtree nil t)
+ (unless (eobp) (backward-char)))
(end-of-line)
(if (eobp) (newline) (forward-char)))
(when (looking-at org-outline-regexp)
(let ((level (- (match-end 0) (match-beginning 0))))
(when (> end (match-end 0))
- (outline-end-of-subtree)
+ (progn (org-end-of-subtree nil t)
+ (unless (eobp) (backward-char)))
(end-of-line)
(if (eobp) (newline) (forward-char))
(setq level (1+ level)))
(org-paste-subtree level)
(save-excursion
- (outline-end-of-subtree)
+ (progn (org-end-of-subtree nil t)
+ (unless (eobp) (backward-char)))
(when (bolp) (delete-char -1))))))))))
@@ -1003,8 +1006,8 @@ This means, between the beginning of line and the point."
(org-mouse-main-buffer (current-buffer)))
(when (eq (with-current-buffer buffer major-mode) 'org-mode)
(let ((endmarker (with-current-buffer buffer
- (outline-end-of-subtree)
- (forward-char 1)
+ (org-end-of-subtree nil t)
+ (unless (eobp) (forward-char 1))
(copy-marker (point)))))
(org-with-remote-undo buffer
(with-current-buffer buffer
diff --git a/lisp/org.el b/lisp/org.el
index 9a3b509..78d82a7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8159,7 +8159,8 @@ case."
(save-match-data
(save-excursion (outline-end-of-heading)
(setq folded (outline-invisible-p)))
- (outline-end-of-subtree))
+ (progn (org-end-of-subtree nil t)
+ (unless (eobp) (backward-char))))
(outline-next-heading)
(setq ne-end (org-back-over-empty-lines))
(setq end (point))
@@ -23285,14 +23286,6 @@ If there is no such heading, return nil."
(forward-char -1))))))
(point))
-(defadvice outline-end-of-subtree (around prefer-org-version activate compile)
- "Use Org version in org-mode, for dramatic speed-up."
- (if (derived-mode-p 'org-mode)
- (progn
- (org-end-of-subtree nil t)
- (unless (eobp) (backward-char 1)))
- ad-do-it))
-
(defun org-end-of-meta-data-and-drawers ()
"Jump to the first text after meta data and drawers in the current entry.
This will move over empty lines, lines with planning time stamps,