Browse Source

org-agenda.el (org-agenda-set-restriction-lock): Fix restriction

* org-agenda.el (org-agenda-set-restriction-lock): Fix
restriction so that it ends at the beginning of the next
headline at the same level.
Bastien Guerry 8 years ago
parent
commit
66cba1c51f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/org-agenda.el

+ 2 - 2
lisp/org-agenda.el

@@ -7166,10 +7166,10 @@ in the file.  Otherwise, restriction will be to the current subtree."
 	     (list (buffer-file-name (buffer-base-buffer))))
 	(org-back-to-heading t)
 	(move-overlay org-agenda-restriction-lock-overlay
-		      (point) (save-excursion (org-end-of-subtree t) (point)))
+		      (point) (save-excursion (org-end-of-subtree t t) (point)))
 	(move-marker org-agenda-restrict-begin (point))
 	(move-marker org-agenda-restrict-end
-		     (save-excursion (org-end-of-subtree t)))
+		     (save-excursion (org-end-of-subtree t t)))
 	(message "Locking agenda restriction to subtree"))
     (put 'org-agenda-files 'org-restrict
 	 (list (buffer-file-name (buffer-base-buffer))))