0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 19:37:52 +00:00

Add current time to time grid in agenda

* lisp/org-faces.el (org-agenda-current-time): New face.
* lisp/org-agenda.el (org-agenda-show-current-time-in-grid):
(org-agenda-current-time-string): New options.
(org-agenda-add-time-grid-maybe): Add current time to time grid.
This commit is contained in:
Carsten Dominik 2010-12-12 09:25:03 +01:00
parent ad006dea13
commit 1495bc6b08
2 changed files with 24 additions and 0 deletions

View file

@ -1183,6 +1183,17 @@ a grid line."
(string :tag "Grid String")
(repeat :tag "Grid Times" (integer :tag "Time"))))
(defcustom org-agenda-show-current-time-in-grid t
"Non-nil means show the current time in the time grid."
:group 'org-agenda-time-grid
:type 'boolean)
(defcustom org-agenda-current-time-string
"now - - - - - - - - - - - - - - - - - - - - - - - - -"
"The string for the current time marker in the agenda."
:group 'org-agenda-time-grid
:type 'string)
(defgroup org-agenda-sorting nil
"Options concerning sorting in the Org-mode Agenda."
:tag "Org Agenda Sorting"
@ -5342,6 +5353,16 @@ The modified list may contain inherited tags, and tags matched by
new)
(put-text-property
2 (length (car new)) 'face 'org-time-grid (car new))))
(when org-agenda-show-current-time-in-grid
(push (org-format-agenda-item
nil
org-agenda-current-time-string
"" nil
(format-time-string "%H:%M "))
new)
(put-text-property
2 (length (car new)) 'face 'org-agenda-current-time (car new)))
(if (member 'time-up org-agenda-sorting-strategy-selected)
(append new list)
(append list new)))))

View file

@ -667,6 +667,9 @@ month and 365.24 days for a year)."
"Face used for time grids."
:group 'org-faces)
(org-copy-face 'org-time-grid 'org-agenda-current-time
"Face used to show the current time in the time grid.")
(defface org-agenda-diary
(org-compatible-face 'default
nil)