Browse Source

org-agenda.el (org-agenda-set-restriction-lock): Put the overlay until the end of the subtree

* org-agenda.el (org-agenda-set-restriction-lock): Put the
overlay until the end of the subtree, not the end of the
headline.

When the agenda restriction is on, user expect agenda views to check
every entry in the subtree.  If a user add an entry outside of the
overlay without noticing it, this entry will not be checked and the
user will wonder why.  Put the end of the overlay at the end of the
subtree so that the user always knows if the entries she is adding
are within the current restriction.

We might need to find a less instrusive overlay color, though.
Bastien Guerry 12 năm trước cách đây
mục cha
commit
aa0e0068de
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      lisp/org-agenda.el

+ 2 - 1
lisp/org-agenda.el

@@ -7164,7 +7164,8 @@ in the file.  Otherwise, restriction will be to the current subtree."
 	(put 'org-agenda-files 'org-restrict
 	     (list (buffer-file-name (buffer-base-buffer))))
 	(org-back-to-heading t)
-	(move-overlay org-agenda-restriction-lock-overlay (point) (point-at-eol))
+	(move-overlay org-agenda-restriction-lock-overlay
+		      (point) (save-excursion (outline-next-heading) (point)))
 	(move-marker org-agenda-restrict-begin (point))
 	(move-marker org-agenda-restrict-end
 		     (save-excursion (org-end-of-subtree t)))