diff options
author | Bastien Guerry <bzg@altern.org> | 2011-07-05 11:05:20 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-07-05 11:05:20 +0200 |
commit | 330ed08febf6ac6b34c8d9b0bad2bff07d6fef6e (patch) | |
tree | 997a140d6f72cc75a115c6e7fd33cf32aa39659a | |
parent | 5a5036cc131df6d3636569ca920772f58da0a19e (diff) | |
download | org-mode-330ed08febf6ac6b34c8d9b0bad2bff07d6fef6e.tar.gz |
org.el: fix `org-end-of-meta-data-and-drawers'
Back to the previous version of `org-end-of-meta-data-and-drawers',
with a better fix.
Thanks to Eric Abrahamsen for this.
-rw-r--r-- | lisp/org.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el index 9ad975b..a773ca1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -20032,11 +20032,18 @@ This will move over empty lines, lines with planning time stamps, clocking lines, and drawers." (org-back-to-heading t) (let ((end (save-excursion (outline-next-heading) (point))) - (re (concat "[ \t]*$" - "\\|" org-drawer-regexp + (re (concat "\\(" org-drawer-regexp "\\)" "\\|" "[ \t]*" org-keyword-time-regexp))) - (while (re-search-forward re end 'move) - (forward-line 1)))) + (forward-line 1) + (while (re-search-forward re end t) + (if (not (match-end 1)) + ;; empty or planning line + (forward-line 1) + ;; a drawer, find the end + (re-search-forward "^[ \t]*:END:" end 'move) + (forward-line 1))) + (and (re-search-forward "[^\n]" nil t) (backward-char 1)) + (point))) (defun org-forward-same-level (arg &optional invisible-ok) "Move forward to the arg'th subheading at same level as this one. |