summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-04-17 10:19:58 +0200
committerBastien Guerry <bzg@altern.org>2014-04-17 10:19:58 +0200
commit8f19a42304a00d1b07a6f534ff4afd1425959fcd (patch)
treeb1453c5ae8feed4279b118095dbed4b1a7420085
parent3f3a8f461617092bb811060d93ae936120435852 (diff)
downloadorg-mode-8f19a42304a00d1b07a6f534ff4afd1425959fcd.tar.gz
Minor enhancements to displaying clocks as overlays
* org-faces.el (org-clock-overlay): Use a gray background and don't inherit the foreground. * org-clock.el (org-clock-put-overlay): Don't add the stars.
-rw-r--r--lisp/org-clock.el12
-rw-r--r--lisp/org-faces.el8
2 files changed, 9 insertions, 11 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 8aefe80..137abc9 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -36,6 +36,7 @@
(declare-function notifications-notify "notifications" (&rest params))
(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
(declare-function org-refresh-properties "org" (dprop tprop))
+(declare-function org-table-goto-line "org-table" (n))
(defvar org-time-stamp-formats)
(defvar org-ts-what)
(defvar org-frame-title-format-backup frame-title-format)
@@ -1835,7 +1836,7 @@ Use \\[org-clock-remove-overlays] to remove the subtree times."
(point) :org-clock-minutes)))
(goto-char p)
(when (setq time (get-text-property p :org-clock-minutes))
- (org-clock-put-overlay time (funcall outline-level))))
+ (org-clock-put-overlay time)))
(setq h (/ org-clock-file-total-minutes 60)
m (- org-clock-file-total-minutes (* 60 h)))
;; Arrange to remove the overlays upon next change.
@@ -1849,13 +1850,11 @@ Use \\[org-clock-remove-overlays] to remove the subtree times."
(defvar org-clock-overlays nil)
(make-variable-buffer-local 'org-clock-overlays)
-(defun org-clock-put-overlay (time &optional level)
+(defun org-clock-put-overlay (time)
"Put an overlays on the current line, displaying TIME.
-If LEVEL is given, prefix time with a corresponding number of stars.
This creates a new overlay and stores it in `org-clock-overlays', so that it
will be easy to remove."
(let* ((c 60) (h (floor (/ time 60))) (m (- time (* 60 h)))
- (l (if level (org-get-valid-level level 0) 0))
(off 0)
ov tx)
(org-move-to-column c)
@@ -1864,9 +1863,8 @@ will be easy to remove."
(setq ov (make-overlay (point-at-bol) (point-at-eol))
tx (concat (buffer-substring (point-at-bol) (point))
(make-string (+ off (max 0 (- c (current-column)))) ?.)
- (org-add-props (concat (make-string l ?*) " "
- (org-minutes-to-clocksum-string time)
- (make-string (- 16 l) ?\ ))
+ (org-add-props
+ (concat " " (org-minutes-to-clocksum-string time) " ")
(list 'face 'org-clock-overlay))
""))
(if (not (featurep 'xemacs))
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index f8625f1..e693dab 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -576,13 +576,13 @@ content of these blocks will still be treated as Org syntax."
(defface org-clock-overlay ;; copied from secondary-selection
(org-compatible-face nil
'((((class color) (min-colors 88) (background light))
- (:background "yellow1"))
+ (:background "LightGray" :foreground "black"))
(((class color) (min-colors 88) (background dark))
- (:background "SkyBlue4"))
+ (:background "SkyBlue4" :foreground "white"))
(((class color) (min-colors 16) (background light))
- (:background "yellow"))
+ (:background "gray" :foreground "black"))
(((class color) (min-colors 16) (background dark))
- (:background "SkyBlue4"))
+ (:background "SkyBlue4" :foreground "white"))
(((class color) (min-colors 8))
(:background "cyan" :foreground "black"))
(t (:inverse-video t))))