all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [BUG] overlay 'line-height property is invalid when window width change
@ 2020-05-03 23:43 stardiviner
  2020-05-04 14:00 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: stardiviner @ 2020-05-03 23:43 UTC (permalink / raw)
  To: Emacs Help

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


Here is one post contains screenshots shows what problem I got:

https://emacs-china.org/t/org-agenda/8679/26?u=stardiviner

I tried many ways to debug this issue.

- - [X] Edebug my bellowing source code, it works fine.
- - [X] bug-hunter-init-file on my Emacs config, have not found config caused this problem.
- - [X] I also tried an Emacs Minimal Config to testing bellowing source code. Still have this problem too.
- - [X] I'm currently using the latest master branch compiled version Emacs
  GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.17, cairo version 1.17.3) of 2020-05-03
- - [X] I tried to compile a version of Emacs which commit is two months ago, still have this problem too.
- - [X] The last place is Emacs core function, it's the last place I have not test, and I don't have that ability.

==============================================================================

Here is the source code of colorizing block in org-agenda:

#+begin_src emacs-lisp
(defun org-agenda-log-mode-colorize-block ()
  "Set different line spacing based on clock time duration."
  (save-excursion
    (let* ((colors (cl-case (alist-get 'background-mode (frame-parameters))
		                 ('light
		                  (list "#F6B1C3" "#FFFF9D" "#BEEB9F" "#ADD5F7"))
		                 ('dark
		                  (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
          ;; FIXME (< duration 15)
          (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-log-mode-colorize-block)
#+end_src

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

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl6vVyMUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMeqwgAuv/OINDsQeUoc5+Mn5DoDMUsG4T4
rmDHbLsNfp19RpvdHxTDdqAGxjwskv1fV1UP2+YL9VFtOWmnrGsscfWnycceJvBc
rJAQ7xaB13RRkWn5hNvlV5ulaRSIvEOe1uRMnX1VemrseTKyjaCrhqIsbPrsDWrS
GtjfGX6L6kJy0e1AnI01/jp8BUpXWi+3/9jEbOHdz2ejxN/ObJSXjqBydWDfPYUW
BzSrzB6U5oeLtpbOtqLw/0WzgDKO+pYq8bK56Sb5qvxEf3wq10nJZXW4WqFayLjw
d+vzUeMk1JFgKBo9VpFVOeo67zdtwl4cn4BkCulNYvKmU1i/DH3XCn3vyw==
=DG3+
-----END PGP SIGNATURE-----



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

* Re: [BUG] overlay 'line-height property is invalid when window width change
  2020-05-03 23:43 [BUG] overlay 'line-height property is invalid when window width change stardiviner
@ 2020-05-04 14:00 ` Eli Zaretskii
  2020-05-05  2:27   ` stardiviner
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2020-05-04 14:00 UTC (permalink / raw)
  To: help-gnu-emacs

> From: stardiviner <numbchild@gmail.com>
> Date: Mon, 04 May 2020 07:43:31 +0800
> 
> Here is one post contains screenshots shows what problem I got:
> 
> https://emacs-china.org/t/org-agenda/8679/26?u=stardiviner
> 
> I tried many ways to debug this issue.

Can you please describe the problem in more detail?  What does it mean
for the line-height property to be "invalid", and how does this affect
the display?

Also, if you can show a short Lisp snippet to reproduce this starting
from "emacs -Q" and preferably without loading Org or using any of
Org's features, that would be appreciated.



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

* Re: [BUG] overlay 'line-height property is invalid when window width change
  2020-05-04 14:00 ` Eli Zaretskii
@ 2020-05-05  2:27   ` stardiviner
  0 siblings, 0 replies; 3+ messages in thread
From: stardiviner @ 2020-05-05  2:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

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


Eli Zaretskii <eliz@gnu.org> writes:

>> From: stardiviner <numbchild@gmail.com>
>> Date: Mon, 04 May 2020 07:43:31 +0800
>> 
>> Here is one post contains screenshots shows what problem I got:
>> 
>> https://emacs-china.org/t/org-agenda/8679/26?u=stardiviner
>> 
>> I tried many ways to debug this issue.
>
> Can you please describe the problem in more detail?  What does it mean
> for the line-height property to be "invalid", and how does this affect
> the display?

It's a kind of hard to describe this clearly. An image is better than thousands
of words. In my shared link, you can see some images, especial the GIF
animation. It shows when the overlay line-height is invalid, when when it is ok
again.

>
> Also, if you can show a short Lisp snippet to reproduce this starting
> from "emacs -Q" and preferably without loading Org or using any of
> Org's features, that would be appreciated.

You're right, I should test a very simple elisp code snippet to test overlay line-height.

Here it is:

#+begin_src emacs-lisp
(let ((line-height 20)
      (ov (make-overlay (point-at-bol) (1+ (point-at-eol)))))
  (overlay-put ov 'face '(:background "yellow"))
  (overlay-put ov 'line-height line-height)
  (overlay-put ov 'line-spacing (1- line-height)))
#+end_src

It works fine. Weird. So seems it has some special settings in Org Agenda. But I
try to debug, have not found any clue.

Sorry for the disturb.

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

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

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl6wzy0UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOjdAf/Xz4YsTKSy1kFAwaUnNMjn1CoIaxJ
V6mAncJuL3+KVQmOANHDVZjImTnWR2xBG4lsLYvGQj8bM9cxTtjOwcM2KtEOONW2
tZPCtwgKwYJ6fYWNW2QLD47AHaqqdaB8aO6WupCXNkifCQnh07rnOC70tyaWS19U
MIqX95YkRXZqOs677cT9+X4nDrL0RGCJBW9PDJHD8bpbBjZsK6aRuqSXExsR0vDZ
J/OsfGHu35RsmRpfT+a1d9uHEJS6dC+t5MoQWQ1dGqdO0JyN4jlK5Nksgg+gZ9Ch
hDtr9btUGFlw7PyuWAs+wzCtt8X6jDaxHnuixBdWFNRxk0eJdwMJ0fXtPA==
=jVyr
-----END PGP SIGNATURE-----



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

end of thread, other threads:[~2020-05-05  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-03 23:43 [BUG] overlay 'line-height property is invalid when window width change stardiviner
2020-05-04 14:00 ` Eli Zaretskii
2020-05-05  2:27   ` stardiviner

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.