summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-04-06 01:51:29 +0200
committerBastien Guerry <bzg@altern.org>2013-04-06 01:51:29 +0200
commitb37e27edb5532198ecc8d419bbcdc562eb3e3a92 (patch)
treeb9461499b393d3c70370eff47c7aa80b1dde3f6c
parent5fc6764c1f97b9f6d5208cec81fbba331fb770ea (diff)
downloadorg-mode-b37e27edb5532198ecc8d419bbcdc562eb3e3a92.tar.gz
org-agenda.el (org-agenda-restriction-lock-highlight-subtree): New option
* org-faces.el (org-agenda-restriction-lock): Use less flashy colors. * org-agenda.el (org-agenda-restriction-lock-highlight-subtree): New option.
-rw-r--r--lisp/org-agenda.el12
-rw-r--r--lisp/org-faces.el8
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e147809..1afdf9f 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -657,6 +657,13 @@ that are marked with the ARCHIVE tag will be included anyway. When this is
t, also all archive files associated with the current selection of agenda
files will be included.")
+(defcustom org-agenda-restriction-lock-highlight-subtree t
+ "Non-nil means highlight the whole subtree when restriction is active.
+Otherwise only highlight the headline. Highlighting the whole subtree is
+useful to ensure no edits happen beyond the restricted region."
+ :group 'org-agenda
+ :type 'boolean)
+
(defcustom org-agenda-skip-comment-trees t
"Non-nil means skip trees that start with the COMMENT keyword.
When nil, these trees are also scanned by agenda commands."
@@ -7072,7 +7079,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) (point-at-eol))
+ (point)
+ (if org-agenda-restriction-lock-highlight-subtree
+ (save-excursion (org-end-of-subtree t t) (point))
+ (point-at-eol)))
(move-marker org-agenda-restrict-begin (point))
(move-marker org-agenda-restrict-end
(save-excursion (org-end-of-subtree t t)))
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index fe883f4..5472964 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -693,10 +693,10 @@ month and 365.24 days for a year)."
(defface org-agenda-restriction-lock
(org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:background "yellow1"))
- (((class color) (min-colors 88) (background dark)) (:background "skyblue4"))
- (((class color) (min-colors 16) (background light)) (:background "yellow1"))
- (((class color) (min-colors 16) (background dark)) (:background "skyblue4"))
+ '((((class color) (min-colors 88) (background light)) (:background "#eeeeee"))
+ (((class color) (min-colors 88) (background dark)) (:background "#1C1C1C"))
+ (((class color) (min-colors 16) (background light)) (:background "#eeeeee"))
+ (((class color) (min-colors 16) (background dark)) (:background "#1C1C1C"))
(((class color) (min-colors 8)) (:background "cyan" :foreground "black"))
(t (:inverse-video t))))
"Face for showing the agenda restriction lock."