Просмотр исходного кода

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.
Bastien Guerry 13 лет назад
Родитель
Сommit
b37e27edb5
2 измененных файлов с 15 добавлено и 5 удалено
  1. 11 1
      lisp/org-agenda.el
  2. 4 4
      lisp/org-faces.el

+ 11 - 1
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
 t, also all archive files associated with the current selection of agenda
 files will be included.")
 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
 (defcustom org-agenda-skip-comment-trees t
   "Non-nil means skip trees that start with the COMMENT keyword.
   "Non-nil means skip trees that start with the COMMENT keyword.
 When nil, these trees are also scanned by agenda commands."
 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))))
 	     (list (buffer-file-name (buffer-base-buffer))))
 	(org-back-to-heading t)
 	(org-back-to-heading t)
 	(move-overlay org-agenda-restriction-lock-overlay
 	(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-begin (point))
 	(move-marker org-agenda-restrict-end
 	(move-marker org-agenda-restrict-end
 		     (save-excursion (org-end-of-subtree t t)))
 		     (save-excursion (org-end-of-subtree t t)))

+ 4 - 4
lisp/org-faces.el

@@ -693,10 +693,10 @@ month and 365.24 days for a year)."
 
 
 (defface org-agenda-restriction-lock
 (defface org-agenda-restriction-lock
   (org-compatible-face nil
   (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"))
       (((class color) (min-colors 8)) (:background "cyan" :foreground "black"))
       (t (:inverse-video t))))
       (t (:inverse-video t))))
   "Face for showing the agenda restriction lock."
   "Face for showing the agenda restriction lock."