瀏覽代碼

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 年之前
父節點
當前提交
aa0e0068de
共有 1 個文件被更改,包括 2 次插入1 次删除
  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)))