emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] support colorful blocks display on org-agenda
@ 2020-02-12  8:34 stardiviner
  2020-02-12  8:40 ` Bastien
  2020-02-12  8:42 ` Bastien
  0 siblings, 2 replies; 10+ messages in thread
From: stardiviner @ 2020-02-12  8:34 UTC (permalink / raw)
  To: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


I have got author's permission to add this patch to Org Mode.

Here is the original thread: https://emacs-china.org/t/org-agenda/8679/8

I don't know whether this patch have to get author signed FSF papers. Might have
not exceeded the TINYCHANGE limit?

Here is the patch code.

#+begin_src emacs-lisp
;; Show Org Agenda tasks with heigh spacing based on clock time with `org-agenda-log-mode'.
;; https://emacs-china.org/t/org-agenda/8679
;; work with org-agenda dispatcher [c] "Today Clocked Tasks" to view today's clocked tasks.
(defun org-agenda-time-grid-colorful-spacing ()
  "Set different line spacing w.r.t. time duration."
  (save-excursion
    ;; (list "#aa557f" "DarkGreen" "DarkSlateGray" "DarkSlateBlue") ; dark theme
    ;; (list "#F6B1C3" "#FFFF9D" "#BEEB9F" "#ADD5F7") ; white theme
    (let* ((colors (list "#aa557f" "DarkGreen" "DarkSlateGray" "DarkSlateBlue"))
           pos
           duration)
      (nconc colors colors)
      (goto-char (point-min))
      (while (setq pos (next-single-property-change (point) 'duration))
        (goto-char pos)
        (when (and (not (equal pos (point-at-eol)))
                   (setq duration (org-get-at-bol 'duration)))
          ;; larger duration bar height
          (let ((line-height (if (< duration 15) 1.0 (+ 0.5 (/ duration 30))))
                (ov (make-overlay (point-at-bol) (1+ (point-at-eol)))))
            (overlay-put ov 'face `(:background ,(car colors) :foreground "black"))
            (setq colors (cdr colors))
            (overlay-put ov 'line-height line-height)
            (overlay-put ov 'line-spacing (1- line-height))))))))

(add-hook 'org-agenda-finalize-hook #'org-agenda-time-grid-colorful-spacing)
#+end_src

If this patch can be merged. I will submit an PATCH format file.

BTW, about this patch, I know using hook is a user hack way. In real patch, I
will add a defcustom option to enabled by default (WDYT?). and loaded in
org-agenda finalize position.

- -- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5DuJEUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsM8Qwf+MFGcBeC180m7fN/PLwrkeuOMS5zT
XsR3oS2B/urrPY8DU2+Ff3YgA+HABFpJ0O0DHe5O+xdFr0uggJhFJi3wqPXetl4e
i+IKGx3j8gJ2cpSf1E5CATWppCklMEX4aFB7hk35zRtrIsn+Kgs5irr1EPxAmqjY
0CyvklRe3RacPSDRNh6PTPYJPmYa3UIgjkD6kzzSxB+ED6xTECDwuh9dSMQhqj1q
8+/ji9OfYjyFzHkdEC8+fc+e2wZ7/lm4sGUfW6Y3v5KIonhtrA+D/tikGfqHvfR2
Q728uZGGQcrYO511V37f+bAndW2GSSaAIZJ5gzcatqB+wRnqTcqMlQSiHw==
=mhYR
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-12  8:34 [PATCH] support colorful blocks display on org-agenda stardiviner
@ 2020-02-12  8:40 ` Bastien
  2020-02-20  7:01   ` stardiviner
  2020-02-12  8:42 ` Bastien
  1 sibling, 1 reply; 10+ messages in thread
From: Bastien @ 2020-02-12  8:40 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

Hi Stardiviner,

stardiviner <numbchild@gmail.com> writes:

> I have got author's permission to add this patch to Org Mode.

We need it explicitely here on this list.

Please submit the patch as an inline or attach .patch file.
You just need to go in the modified file, C-x v v and save the patch.

Even better, as a Git patch.
See https://orgmode.org/worg/org-contribute.html for details.

Otherwise, it is difficult to understand what the patch does.

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-12  8:34 [PATCH] support colorful blocks display on org-agenda stardiviner
  2020-02-12  8:40 ` Bastien
@ 2020-02-12  8:42 ` Bastien
  2020-02-12 10:37   ` stardiviner
  2020-02-20 15:34   ` [SOLVED] " stardiviner
  1 sibling, 2 replies; 10+ messages in thread
From: Bastien @ 2020-02-12  8:42 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

stardiviner <numbchild@gmail.com> writes:

> (add-hook 'org-agenda-finalize-hook #'org-agenda-time-grid-colorful-spacing)

FWIW I don't think this should go in Org's core, it is a useful
command to customize Org agenda colors.

Can you suggest the author to add this to
https://orgmode.org/worg/org-hacks.html ?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-12  8:42 ` Bastien
@ 2020-02-12 10:37   ` stardiviner
  2020-02-20 15:34   ` [SOLVED] " stardiviner
  1 sibling, 0 replies; 10+ messages in thread
From: stardiviner @ 2020-02-12 10:37 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Bastien <bzg@gnu.org> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> (add-hook 'org-agenda-finalize-hook #'org-agenda-time-grid-colorful-spacing)
>
> FWIW I don't think this should go in Org's core, it is a useful
> command to customize Org agenda colors.
>
> Can you suggest the author to add this to
> https://orgmode.org/worg/org-hacks.html ?

I see. I will add it to Worg hacks. Thanks for reviewing.

- -- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5D1WMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPjaAf/awGa6rVJgG9/GCEAcIBuCN06rzEP
rUOEGdlUGHpTcayhosAE4awu1pkp9BT6DU7wtDJn/9R9p7QeFln9uwLaYzVoTYh5
QilMewzaxcZ7sOkmZB/a4Amz456lWuGf3xJ6DzcPlDicJVzK3ZXbJ/UzJrT4e3NL
I779FrqeusmyQ7KdrlDw8t8k2+AWldvcw+bmGHdw4lNxD2/PEfLaKuq26pTRqwOt
Uk5q7zIyDoCDdoDoeDV+j7ur1TtX79z54uV17E9fyiAUXp9Ms3Y7cJd+DgiGxdG1
HAaoIBw36BkncmI9OhCcBPZcXBk8faV2PpCwqDBvpuV+FJrVbiYQAmkgmg==
=njsz
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-12  8:40 ` Bastien
@ 2020-02-20  7:01   ` stardiviner
  2020-02-20  7:15     ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: stardiviner @ 2020-02-20  7:01 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Bastien <bzg@gnu.org> writes:

> Hi Stardiviner,
>
> stardiviner <numbchild@gmail.com> writes:
>
>> I have got author's permission to add this patch to Org Mode.
>
> We need it explicitely here on this list.
>
> Please submit the patch as an inline or attach .patch file.
> You just need to go in the modified file, C-x v v and save the patch.
>
> Even better, as a Git patch.
> See https://orgmode.org/worg/org-contribute.html for details.
>
> Otherwise, it is difficult to understand what the patch does.
>
> Thanks!

Hi, Bastien

I reconsidered this patch, what about make it an minor-mode for Org Mode and put
it in contrib/ directory? WDYT?

- -- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5OLsgUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPAfQf/flxeneKlWnxpOm3248vjwz536+Sv
V56OBsT/aGoCDqKfF7mmCPH6PIgQUoG5kyV5Mk/tkXb0pLdQ4kUpEE4Rz7Ylq7ev
bUq/jWkrlrMUnK7O6y+lttFpCIgITS1nrcrOeWtGyuxaWJJA2/9kSbvLXlZpTfoD
vJO2IWdWavuIMGCBBTvgvmgOumiISHGu5UOgXUgLJEqstKnLir+DnHLhK1A9JvPa
2shuD2u1lqXr3AoM9brEm2qV6eLCXY84n6WulxtYhF8Ho83ySDBa16bmh9O7h64+
f7breDStJp415nssyXixIqR+hqKRVH9CnNhQcyjdXwcXk+tlhP6yacqdMw==
=PFDC
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-20  7:01   ` stardiviner
@ 2020-02-20  7:15     ` Bastien
  2020-02-20 15:17       ` stardiviner
  2020-02-23 22:18       ` Daniele Nicolodi
  0 siblings, 2 replies; 10+ messages in thread
From: Bastien @ 2020-02-20  7:15 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

Hi Stardiviner,

stardiviner <numbchild@gmail.com> writes:

> I reconsidered this patch, what about make it an minor-mode for Org
> Mode and put it in contrib/ directory? WDYT?

I suggest using worg/org-hacks.org instead: this describes precisely
what it is, a nice hack, isn't it?

Days for the "contrib/" directory are counted: before Org 9.5, I will
extract it from Org's repository, make it an independant repository on
code.orgmode.org and make it available through Org ELPA.

So you'd better not add things there.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-20  7:15     ` Bastien
@ 2020-02-20 15:17       ` stardiviner
  2020-02-23 22:18       ` Daniele Nicolodi
  1 sibling, 0 replies; 10+ messages in thread
From: stardiviner @ 2020-02-20 15:17 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Bastien <bzg@gnu.org> writes:

> Hi Stardiviner,
>
> stardiviner <numbchild@gmail.com> writes:
>
>> I reconsidered this patch, what about make it an minor-mode for Org
>> Mode and put it in contrib/ directory? WDYT?
>
> I suggest using worg/org-hacks.org instead: this describes precisely
> what it is, a nice hack, isn't it?
>
> Days for the "contrib/" directory are counted: before Org 9.5, I will
> extract it from Org's repository, make it an independant repository on
> code.orgmode.org and make it available through Org ELPA.
>
> So you'd better not add things there.
>
> Thanks,

Alright, I at least did tried. :) Hehe

- -- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5OowQUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOgogf/S9vhApnOUloiYIfAWMAmZQ8R2184
KS3a2JuOlfLGDMMr9Pr00f+7pOK0iVmlWchKC+bqzhHoq7GBCnbclk0GhH51WcEA
Bd96/7l54eAvqiSSraA/c/80kb+e8RXTXsSTTHuUFkOXMAYuip7qkHLSofyHhKV5
9cBitAAnThxLwCjqdHBLwo1A/6lQ3t9H81MJoam7FZRWyCEniJ2R2icuIdEG+Pfb
co0q9py0ts3meGmR4ANvhAi7perIbTIvdu64Nbjnhgnh97WNWmU1L9qcJhROw/It
zpE1ILLBu4A47XGx40v2McITvh6NCY1bw3ZXIsc6XK4L/Ow6RyCvzQCYog==
=iUPw
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [SOLVED] Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-12  8:42 ` Bastien
  2020-02-12 10:37   ` stardiviner
@ 2020-02-20 15:34   ` stardiviner
  2020-02-20 15:41     ` Bastien
  1 sibling, 1 reply; 10+ messages in thread
From: stardiviner @ 2020-02-20 15:34 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Bastien <bzg@gnu.org> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> (add-hook 'org-agenda-finalize-hook #'org-agenda-time-grid-colorful-spacing)
>
> FWIW I don't think this should go in Org's core, it is a useful
> command to customize Org agenda colors.
>
> Can you suggest the author to add this to
> https://orgmode.org/worg/org-hacks.html ?

Pushed to Worg now. Done. :)

- -- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5OpxsUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPSSAf+M7hw6Q+Id9o5NOEFSYzT6J89sezp
jEenA69/ejthXXgVJjfYw+urfVkM2akD7UvxYhQ/yqKwgEI5gFg8DifF2/w2HSqF
AIMdUro7LLcWXkOO/Xj3mHmUMex/zmcZZruqJy6oEgc8xLRVhEFf3dbMIUcrn6qv
gNWmxHlmlMRrL/l4IG1PxQHP7Db4EV5Uw2zsnVuOUXBGRhyPaHcgFnFeg6lihDZi
TfjI70T+6Sx4urGvzwwZcdggYB7Pc24PaTcXvTgKEFnzhzwGAA4xoziqZk3BhLns
D4ZYdvHReugK+OyMfcPpFDcYxw+jUf7yhMCd7bd47gMWLChwtL/1JhMwcQ==
=cG4k
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [SOLVED] Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-20 15:34   ` [SOLVED] " stardiviner
@ 2020-02-20 15:41     ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2020-02-20 15:41 UTC (permalink / raw)
  To: stardiviner; +Cc: Org Mode

stardiviner <numbchild@gmail.com> writes:

>> Can you suggest the author to add this to
>> https://orgmode.org/worg/org-hacks.html ?
>
> Pushed to Worg now. Done. :)

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] support colorful blocks display on org-agenda
  2020-02-20  7:15     ` Bastien
  2020-02-20 15:17       ` stardiviner
@ 2020-02-23 22:18       ` Daniele Nicolodi
  1 sibling, 0 replies; 10+ messages in thread
From: Daniele Nicolodi @ 2020-02-23 22:18 UTC (permalink / raw)
  To: emacs-orgmode

On 20/02/2020 00:15, Bastien wrote:
> Days for the "contrib/" directory are counted: before Org 9.5, I will
> extract it from Org's repository, make it an independant repository on
> code.orgmode.org and make it available through Org ELPA.

This is an excellent plan!

Cheers,
Dan

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-23 22:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12  8:34 [PATCH] support colorful blocks display on org-agenda stardiviner
2020-02-12  8:40 ` Bastien
2020-02-20  7:01   ` stardiviner
2020-02-20  7:15     ` Bastien
2020-02-20 15:17       ` stardiviner
2020-02-23 22:18       ` Daniele Nicolodi
2020-02-12  8:42 ` Bastien
2020-02-12 10:37   ` stardiviner
2020-02-20 15:34   ` [SOLVED] " stardiviner
2020-02-20 15:41     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).