unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [BUG] ov property line height failed on lone length line when exceeded window width
@ 2020-06-03 10:23 numbchild
  2020-06-03 11:07 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: numbchild @ 2020-06-03 10:23 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

As my last email is rejected by mailing list moder.

So I uploaded attachment files to other servers. And post email again.

I checked emacs-devel mailing list archive, found my email is not sent
successfully from mu4e client. So send on gmail again.

At first, let me show the problem I meet. Here is a recorded video
"simplescreenrecord*.mkv". I tested
this with Minimal Emacs Config. You can see, the original line height is
failed after I split window (which
window width is decreased).

link: https://pan.baidu.com/s/1QMz4N7JVXIGswOAXYXcpSA download code: hy9a

I also attached the material "org-agenda.org" of reproducing the
environment.

I have a configuration which add colored blocks on Org Agenda headlines.
Here is
my Minimal Emacs Config "emacs-minimal.el"

https://gist.github.com/stardiviner/9a56cdf5dea90e1466df87f9f1cc5f95


[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

[-- Attachment #2: Type: text/html, Size: 2562 bytes --]

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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-03 10:23 [BUG] ov property line height failed on lone length line when exceeded window width numbchild
@ 2020-06-03 11:07 ` Eli Zaretskii
       [not found]   ` <CAL1eYuJ0_rTgUr3bimtQHcX3fPG72sdhU53h9kkZ_jbiLaNpaA@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2020-06-03 11:07 UTC (permalink / raw)
  To: emacs-devel, numbchild@gmail.com, Emacs developers

On June 3, 2020 1:23:42 PM GMT+03:00, "numbchild@gmail.com" <numbchild@gmail.com> wrote:
> As my last email is rejected by mailing list moder.
> 
> So I uploaded attachment files to other servers. And post email again.
> 
> I checked emacs-devel mailing list archive, found my email is not sent
> successfully from mu4e client. So send on gmail again.
> 
> At first, let me show the problem I meet. Here is a recorded video
> "simplescreenrecord*.mkv". I tested
> this with Minimal Emacs Config. You can see, the original line height
> is
> failed after I split window (which
> window width is decreased).
> 
> link: https://pan.baidu.com/s/1QMz4N7JVXIGswOAXYXcpSA download code:
> hy9a
> 
> I also attached the material "org-agenda.org" of reproducing the
> environment.
> 
> I have a configuration which add colored blocks on Org Agenda
> headlines.
> Here is
> my Minimal Emacs Config "emacs-minimal.el"
> 
> https://gist.github.com/stardiviner/9a56cdf5dea90e1466df87f9f1cc5f95
> 
> 
> [stardiviner]           <Hack this world!>      GPG key ID: 47C32433
> IRC(freeenode): stardiviner                     Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/

Can you please describe how you set the overlay, or better yet, show the code which does so?  Did you per chance put the overlay on the part of the line that is not shown when you split the window?



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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
       [not found]   ` <CAL1eYuJ0_rTgUr3bimtQHcX3fPG72sdhU53h9kkZ_jbiLaNpaA@mail.gmail.com>
@ 2020-06-03 14:43     ` Eli Zaretskii
  2020-06-04  0:43       ` stardiviner
  2021-01-27 14:34       ` [FEATURE SUGGESTED] " Christopher Miles
  0 siblings, 2 replies; 12+ messages in thread
From: Eli Zaretskii @ 2020-06-03 14:43 UTC (permalink / raw)
  To: numbchild@gmail.com; +Cc: emacs-devel

[Please use "Reply All" to keep the list CC'ed.]

> From: "numbchild@gmail.com" <numbchild@gmail.com>
> Date: Wed, 3 Jun 2020 19:48:57 +0800
> 
> > Can you please describe how you set the overlay, or better yet, show the code which does so? 
> 
> The main functionality code set overlay on org-agenda is here:
> 
> (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)
> 
> And for a minimal example of setting overlay code is here:
> 
> (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)))
> 
> > Did you per chance put the overlay on the part of the line that is not shown when you split the window?
> 
> About this problem, I suggest you check out my video link, it shows how the overlay line-height property failed
> when I split window with `split-window-right`. The line height property is gone. (I mean the visual effect is
> gone.)

In that case, this is the expected behavior: if the newline with the
line-height property is not visible, the setting has no effect.  It is
conceptually the same as having a tall character or image displayed on
a line: if you then truncate the line so that the tall element is not
visible, the line's height will be decreased to reflect what is
actually on display.

This is not a bug.  You are trying to use this property in a way that
it wasn't designed to support.



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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-03 14:43     ` Eli Zaretskii
@ 2020-06-04  0:43       ` stardiviner
  2020-06-04 13:16         ` Eli Zaretskii
  2021-01-27 14:34       ` [FEATURE SUGGESTED] " Christopher Miles
  1 sibling, 1 reply; 12+ messages in thread
From: stardiviner @ 2020-06-04  0:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


Eli Zaretskii <eliz@gnu.org> writes:

> [Please use "Reply All" to keep the list CC'ed.]
>
>> From: "numbchild@gmail.com" <numbchild@gmail.com>
>> Date: Wed, 3 Jun 2020 19:48:57 +0800
>> 
>> > Can you please describe how you set the overlay, or better yet, show the code which does so? 
>> 
>> The main functionality code set overlay on org-agenda is here:
>> 
>> (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)
>> 
>> And for a minimal example of setting overlay code is here:
>> 
>> (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)))
>> 
>> > Did you per chance put the overlay on the part of the line that is not shown when you split the window?
>> 
>> About this problem, I suggest you check out my video link, it shows how the overlay line-height property failed
>> when I split window with `split-window-right`. The line height property is gone. (I mean the visual effect is
>> gone.)
>
> In that case, this is the expected behavior: if the newline with the
> line-height property is not visible, the setting has no effect.  It is
> conceptually the same as having a tall character or image displayed on
> a line: if you then truncate the line so that the tall element is not
> visible, the line's height will be decreased to reflect what is
> actually on display.

I have a little kind of understand. Hmm, is there any workaround of this
situation? I want it to be displayed anyway. Change my code, or toggle some
options or something else?

>
> This is not a bug.  You are trying to use this property in a way that
> it wasn't designed to support.


-- 
[ 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



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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-04  0:43       ` stardiviner
@ 2020-06-04 13:16         ` Eli Zaretskii
  2020-06-04 15:46           ` stardiviner
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2020-06-04 13:16 UTC (permalink / raw)
  To: numbchild; +Cc: emacs-devel

> From: stardiviner <numbchild@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 04 Jun 2020 08:43:27 +0800
> 
> > In that case, this is the expected behavior: if the newline with the
> > line-height property is not visible, the setting has no effect.  It is
> > conceptually the same as having a tall character or image displayed on
> > a line: if you then truncate the line so that the tall element is not
> > visible, the line's height will be decreased to reflect what is
> > actually on display.
> 
> I have a little kind of understand. Hmm, is there any workaround of this
> situation? I want it to be displayed anyway. Change my code, or toggle some
> options or something else?

Can you describe what are you trying to accomplish, and for what
purpose?  Maybe then we could propose a workaround.



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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-04 13:16         ` Eli Zaretskii
@ 2020-06-04 15:46           ` stardiviner
  2020-06-05 11:58             ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: stardiviner @ 2020-06-04 15:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: numbchild, emacs-devel

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


Eli Zaretskii <eliz@gnu.org> writes:

>> From: stardiviner <numbchild@gmail.com>
>> Cc: emacs-devel@gnu.org
>> Date: Thu, 04 Jun 2020 08:43:27 +0800
>> 
>> > In that case, this is the expected behavior: if the newline with the
>> > line-height property is not visible, the setting has no effect.  It is
>> > conceptually the same as having a tall character or image displayed on
>> > a line: if you then truncate the line so that the tall element is not
>> > visible, the line's height will be decreased to reflect what is
>> > actually on display.
>> 
>> I have a little kind of understand. Hmm, is there any workaround of this
>> situation? I want it to be displayed anyway. Change my code, or toggle some
>> options or something else?
>
> Can you describe what are you trying to accomplish, and for what
> purpose?  Maybe then we could propose a workaround.

I try to add overlay which is colorized blocks that have line-height based on
the org-agenda clocked time.

I hope the overlay can keep line-height even I split window get window width
decreased.

The core code is here:

#+begin_src emacs-lisp
;; Show Org Agenda tasks with heigh spacing based on clock time with `org-agenda-log-mode'.
;; work with org-agenda dispatcher [c] "Today Clocked Tasks" to view today's clocked tasks.
(defun org-agenda-clock-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
          (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-clock-colorize-block)
#+end_src

Which I get this code originally from this URL
https://emacs-china.org/t/org-agenda/8679 (It's Chinese Emacs forum).

- -- 
[ 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-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7ZF0EUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsOY+gf+JfnwA67k3RpnSXcIaERYDALF434Q
t2XpigdnMigV3T+6OwQoPXHEPvmZU0tQ2a/RcPhMRw70FbQP2KGKqwc5VnSonzyp
NBYKKBKWoQtNpFFdK7Nu1sL+5/7weLtK0IH4DjZ7whp5POj32l+AAD8FTclOJLIn
CezOj/X5YsGmh08eUEIjUK9mk229hun9UFV4emdNj8BDisNXQQELyrOTXF3ITiZC
+peQmYWib90G+Pma4AavW9EyfxOoZVgOf846M5e8MMyrhLXaGKzJh7eyRab26psA
mTS8vOOGzFPyK0SisHU0I3T+JsvdJRScZfFZNWJZvQyPP03pvxEImod0Og==
=cFd8
-----END PGP SIGNATURE-----



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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-04 15:46           ` stardiviner
@ 2020-06-05 11:58             ` Eli Zaretskii
  2020-06-05 15:59               ` stardiviner
  2021-01-27 13:59               ` Christopher Miles
  0 siblings, 2 replies; 12+ messages in thread
From: Eli Zaretskii @ 2020-06-05 11:58 UTC (permalink / raw)
  To: numbchild; +Cc: emacs-devel

> From: stardiviner <numbchild@gmail.com>
> Cc: numbchild@gmail.com, emacs-devel@gnu.org
> Date: Thu, 04 Jun 2020 23:46:09 +0800
> 
> > Can you describe what are you trying to accomplish, and for what
> > purpose?  Maybe then we could propose a workaround.
> 
> I try to add overlay which is colorized blocks that have line-height based on
> the org-agenda clocked time.
> 
> I hope the overlay can keep line-height even I split window get window width
> decreased.

I don't think such a feature exist, sorry.  maybe someone else can
think of a workaround.



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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-05 11:58             ` Eli Zaretskii
@ 2020-06-05 15:59               ` stardiviner
  2021-01-27 13:59               ` Christopher Miles
  1 sibling, 0 replies; 12+ messages in thread
From: stardiviner @ 2020-06-05 15:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: numbchild, emacs-devel

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


Eli Zaretskii <eliz@gnu.org> writes:

>> From: stardiviner <numbchild@gmail.com>
>> Cc: numbchild@gmail.com, emacs-devel@gnu.org
>> Date: Thu, 04 Jun 2020 23:46:09 +0800
>> 
>> > Can you describe what are you trying to accomplish, and for what
>> > purpose?  Maybe then we could propose a workaround.
>> 
>> I try to add overlay which is colorized blocks that have line-height based on
>> the org-agenda clocked time.
>> 
>> I hope the overlay can keep line-height even I split window get window width
>> decreased.
>
> I don't think such a feature exist, sorry.  maybe someone else can
> think of a workaround.

I see. Really thanks a lot for answer my question. Eli Zaretskii.

- -- 
[ 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-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7aa+kUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsPyRggAo2n++6dYrgOITGiy1LPdfUt7Wefw
15mBsrzr/Vd8ATUVrQu62XbuPh/G30dEKjNXXV2+5sIcC9S7F5wUpSouCpgX+xjs
z36S29fr7hjO2NdN3L21wMznKkpFMdFq/zDzotAZmEIC76qnAPf46Nms75MBz1+c
QQojiLUW2gShrIDk7me7OwL1yV3YA1V0TqQCCKmGiHAWFwE2wbgmX9we/Pv0FL20
qFR6XHlV8J/k6LZLYpPUQoXUrcCjGXBeVWaUcZhj/1+Xl1gR3YM926ylMqxEaquh
6+Bc8Zc71w2NZ5uaqC+cEhrYG/HFsamgss5Kry4D8bverRfdxvYXBxnveg==
=JIbH
-----END PGP SIGNATURE-----



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

* Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-05 11:58             ` Eli Zaretskii
  2020-06-05 15:59               ` stardiviner
@ 2021-01-27 13:59               ` Christopher Miles
  1 sibling, 0 replies; 12+ messages in thread
From: Christopher Miles @ 2021-01-27 13:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Christopher Miles, emacs-devel@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 695 bytes --]

<#secure method=pgpmime mode=sign>

What if I use text-property, is there same problem? Set line-height property.

Eli Zaretskii <eliz@gnu.org> writes:

From: stardiviner <numbchild@gmail.com> Cc: numbchild@gmail.com, emacs-devel@gnu.org Date: Thu, 04 Jun 2020 23:46:09 +0800

Can you describe what are you trying to accomplish, and for what purpose? Maybe then we could propose a workaround.

I try to add overlay which is colorized blocks that have line-height based on the org-agenda clocked time.

I hope the overlay can keep line-height even I split window get window width decreased.

I don't think such a feature exist, sorry. maybe someone else can think of a workaround.

[-- Attachment #1.2: Type: text/html, Size: 1394 bytes --]

[-- Attachment #2: ATT00001.txt --]
[-- Type: text/plain, Size: 253 bytes --]

-- 
[ 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

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

* [FEATURE SUGGESTED] Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2020-06-03 14:43     ` Eli Zaretskii
  2020-06-04  0:43       ` stardiviner
@ 2021-01-27 14:34       ` Christopher Miles
  2021-01-30  9:08         ` Eli Zaretskii
  1 sibling, 1 reply; 12+ messages in thread
From: Christopher Miles @ 2021-01-27 14:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Christopher Miles, emacs-devel@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 3110 bytes --]

<#secure method=pgpmime mode=sign>

I tried to use text-property to implement this effect, but seems not working.

(with-current-buffer (get-buffer org-agenda-buffer)
  (let ((position 1084)
        (inhibit-read-only t))
    (goto-char position)
    (put-text-property (point-at-bol) (1+ (point-at-bol)) 'display " ")
    (let ((ov (make-overlay (point-at-bol) (1+ (point-at-bol)))))
      (overlay-put ov 'line-height 100))))


Eli Zaretskii <eliz@gnu.org> writes:

[Please use "Reply All" to keep the list CC'ed.]

From: "numbchild@gmail.com" <numbchild@gmail.com> Date: Wed, 3 Jun 2020 19:48:57 +0800

Can you please describe how you set the overlay, or better yet, show the code which does so?

The main functionality code set overlay on org-agenda is here:

(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)

And for a minimal example of setting overlay code is here:

(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)))

Did you per chance put the overlay on the part of the line that is not shown when you split the window?

About this problem, I suggest you check out my video link, it shows how the overlay line-height property failed when I split window with `split-window-right`. The line height property is gone. (I mean the visual effect is gone.)

In that case, this is the expected behavior: if the newline with the line-height property is not visible, the setting has no effect. It is conceptually the same as having a tall character or image displayed on a line: if you then truncate the line so that the tall element is not visible, the line's height will be decreased to reflect what is actually on display.

I review this message, does this means the 'line-height overlay property is only on the newline, not on whole line? Is this design for some purpose? This property sounds like should be work on current line instead of newline.

This is not a bug. You are trying to use this property in a way that it wasn't designed to support.

[-- Attachment #1.2: Type: text/html, Size: 6217 bytes --]

[-- Attachment #2: ATT00001.txt --]
[-- Type: text/plain, Size: 253 bytes --]

-- 
[ 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

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

* Re: [FEATURE SUGGESTED] Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2021-01-27 14:34       ` [FEATURE SUGGESTED] " Christopher Miles
@ 2021-01-30  9:08         ` Eli Zaretskii
  2021-01-30 12:15           ` Christopher Miles
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2021-01-30  9:08 UTC (permalink / raw)
  To: Christopher Miles; +Cc: emacs-devel

> From: Christopher Miles <numbchild@gmail.com>
> CC: Christopher Miles <numbchild@gmail.com>, "emacs-devel@gnu.org"
> 	<emacs-devel@gnu.org>
> Date: Wed, 27 Jan 2021 14:34:06 +0000
> 
> I tried to use text-property to implement this effect, but seems not working. 
> 
> (with-current-buffer (get-buffer org-agenda-buffer)
>   (let ((position 1084)
>         (inhibit-read-only t))
>     (goto-char position)
>     (put-text-property (point-at-bol) (1+ (point-at-bol)) 'display " ")
>     (let ((ov (make-overlay (point-at-bol) (1+ (point-at-bol)))))
>       (overlay-put ov 'line-height 100))))

Which text-property did you think will have this effect?  The only
text-property I see in the snippet above is the 'display' property,
but you were talking about 'line-height' property, no?



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

* Re: [FEATURE SUGGESTED] Re: [BUG] ov property line height failed on lone length line when exceeded window width
  2021-01-30  9:08         ` Eli Zaretskii
@ 2021-01-30 12:15           ` Christopher Miles
  0 siblings, 0 replies; 12+ messages in thread
From: Christopher Miles @ 2021-01-30 12:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Christopher Miles, emacs-devel@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 2351 bytes --]

<#multipart type=alternative> <#part type=text/plain> <#secure method=pgpmime mode=sign>

Eli Zaretskii <eliz@gnu.org> writes:

From: Christopher Miles <numbchild@gmail.com> CC: Christopher Miles <numbchild@gmail.com>, "emacs-devel@gnu.org" <emacs-devel@gnu.org> Date: Wed, 27 Jan 2021 14:34:06 +0000

I tried to use text-property to implement this effect, but seems not working.

(with-current-buffer (get-buffer org-agenda-buffer) (let ((position 1084) (inhibit-read-only t)) (goto-char position) (put-text-property (point-at-bol) (1+ (point-at-bol)) 'display " ") (let ((ov (make-overlay (point-at-bol) (1+ (point-at-bol))))) (overlay-put ov 'line-height 100))))

Which text-property did you think will have this effect? The only text-property I see in the snippet above is the 'display' property, but you were talking about 'line-height' property, no?

Aha, you're right, I confused overlay with text-property. I thought text-property also have this effect.

<#part type=text/html> <p> &lt;#secure method=pgpmime mode=sign&gt; </p>

<p> Eli Zaretskii &lt;eliz@gnu.org&gt; writes: </p>

<p> <blockquote class="gmailquote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><blockquote class="gmailquote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>From: Christopher Miles &lt;numbchild@gmail.com&gt; CC: Christopher Miles &lt;numbchild@gmail.com&gt;, "emacs-devel@gnu.org" &lt;emacs-devel@gnu.org&gt; Date: Wed, 27 Jan 2021 14:34:06 +0000 </div> <div> <br /></div> <div>I tried to use text-property to implement this effect, but seems not working. </div> <div> <br /></div> <div>(with-current-buffer (get-buffer org-agenda-buffer) (let ((position 1084) (inhibit-read-only t)) (goto-char position) (put-text-property (point-at-bol) (1+ (point-at-bol)) 'display " ") (let ((ov (make-overlay (point-at-bol) (1+ (point-at-bol))))) (overlay-put ov 'line-height 100))))

</div></blockquote> </div> <div> <br /></div> <div>Which text-property did you think will have this effect? The only text-property I see in the snippet above is the 'display' property, but you were talking about 'line-height' property, no?

</div></blockquote> </p>

<p> Aha, you're right, I confused overlay with text-property. I thought text-property also have this effect. </p> <#/multipart>

[-- Attachment #1.2: Type: text/html, Size: 3310 bytes --]

[-- Attachment #2: ATT00001.htm --]
[-- Type: text/html, Size: 1373 bytes --]

[-- Attachment #3: ATT00002.txt --]
[-- Type: text/plain, Size: 253 bytes --]

-- 
[ 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

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

end of thread, other threads:[~2021-01-30 12:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 10:23 [BUG] ov property line height failed on lone length line when exceeded window width numbchild
2020-06-03 11:07 ` Eli Zaretskii
     [not found]   ` <CAL1eYuJ0_rTgUr3bimtQHcX3fPG72sdhU53h9kkZ_jbiLaNpaA@mail.gmail.com>
2020-06-03 14:43     ` Eli Zaretskii
2020-06-04  0:43       ` stardiviner
2020-06-04 13:16         ` Eli Zaretskii
2020-06-04 15:46           ` stardiviner
2020-06-05 11:58             ` Eli Zaretskii
2020-06-05 15:59               ` stardiviner
2021-01-27 13:59               ` Christopher Miles
2021-01-27 14:34       ` [FEATURE SUGGESTED] " Christopher Miles
2021-01-30  9:08         ` Eli Zaretskii
2021-01-30 12:15           ` Christopher Miles

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

	https://git.savannah.gnu.org/cgit/emacs.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).