From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Miles Newsgroups: gmane.emacs.devel Subject: [FEATURE SUGGESTED] Re: [BUG] ov property line height failed on lone length line when exceeded window width Date: Wed, 27 Jan 2021 14:34:06 +0000 Message-ID: References: <8C0A9F18-AF7B-4C50-8625-229456BF40E4@gnu.org> <835zc8ciqb.fsf@gnu.org> Reply-To: Christopher Miles Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="_004_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1134"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Christopher Miles , "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 27 15:53:51 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4mCc-00009h-2S for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Jan 2021 15:53:50 +0100 Original-Received: from localhost ([::1]:47176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4mCb-0001JZ-2k for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Jan 2021 09:53:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4mBH-0000ey-BC for emacs-devel@gnu.org; Wed, 27 Jan 2021 09:52:27 -0500 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:39991) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4mBE-000374-DF; Wed, 27 Jan 2021 09:52:26 -0500 Original-Received: by mail-wm1-x334.google.com with SMTP id c127so1911080wmf.5; Wed, 27 Jan 2021 06:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:reply-to:accept-language:content-language :mime-version; bh=hUNipDMbiN8bLPONC7NGgY3fVG7ygWQJaIewgSQIpsk=; b=cHJwTv9UyVWt8SDWAQytalkk6MAkhP1FjuXfSlcVVy0gGarYo5mLeRJpGYXFIYqzKk JckkPnfQENsS7akryuepUy8XQoeL7ehCqj+fNzMF5xt58o7Ef5kDUCTVBTJ0b7osFSom TXqIPsHQzKnXOpuPET9VnNqRUAWj7fP08sAdJhZ/DQplpfF3q1A708xyNC1sl95SQiyZ mv3GA0LnG7IUuaq5sOXVKsGMnsOkdsf7KDzacjgk0Z0zL8l2LcEPkm1geP7gdY7A0tuG dWLaymYdDQYab7ZycwGM/VAZfXXMnSEhTMOTms72ADqnIGruwSn9xtBg/n2fvyB2xDO2 EkIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:thread-topic:thread-index :date:message-id:references:in-reply-to:reply-to:accept-language :content-language:mime-version; bh=hUNipDMbiN8bLPONC7NGgY3fVG7ygWQJaIewgSQIpsk=; b=uN78rJIO03vayJ3pmUOfU8B9wtXaHxkJMYr4TGZGe8U/GD20ueUYqlDiplf085gnPm wGED08+Rb32x1jILZUh0OUwVSW1EDdX1PY3vS7nUBYn4KKyoc5+FAZVIL0icOgBLRngs oZmDsVMLkdS18PGHysE6XmG6iyVk2G4xWme/YDzg2LjkHElkVGbshnMzdC2PJNap9nNB ihfNfbYq8wSbpdy4ZFrEDxoJvr+Y4Ujvt2iQ0R0c5v55+qnH8ci4zBVJADd9cpXS3zb0 Sdzb8xMFgYWamyNEMHAdRw1ZrlzZp+vSnjZbJMkN7Wi0NyI/x6Ouk1DUZhqsogGHZDdu jV1g== X-Gm-Message-State: AOAM531dzORSZYMv5fTP8rHMzZONeNoZQQmACoqGTJXmV1BdbMMTDy9+ dByoEtSzuE+o0XlOOtX30ryAs2POEA== X-Google-Smtp-Source: ABdhPJwnDuhlSvLE4MWv5EXIM3RCXrcCS1mk7RAKO6ZB/Hq+hQ0+Y94o4yxIAWB+KfCFGTB+sJMTQQ== X-Received: by 2002:a1c:5456:: with SMTP id p22mr4560031wmi.81.1611759141427; Wed, 27 Jan 2021 06:52:21 -0800 (PST) Original-Received: from PAXPR08MB6640.eurprd08.prod.outlook.com ([2603:1026:c0a:1::5]) by smtp.gmail.com with ESMTPSA id q6sm2637102wmj.32.2021.01.27.06.52.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jan 2021 06:52:20 -0800 (PST) Original-Received: from dark (183.246.145.54) by HK0PR03CA0098.apcprd03.prod.outlook.com (2603:1096:203:b0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.16 via Frontend Transport; Wed, 27 Jan 2021 14:34:04 +0000 Thread-Topic: [FEATURE SUGGESTED] Re: [BUG] ov property line height failed on lone length line when exceeded window width Thread-Index: AQHW1cUpAFae0Gd/Kk2C+g3JwKd6dw== X-MS-Exchange-MessageSentRepresentingType: 1 In-Reply-To: <835zc8ciqb.fsf@gnu.org> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Exchange-Organization-AuthAs: Internal X-MS-Exchange-Organization-AuthMechanism: 06 X-MS-Exchange-Organization-AuthSource: PAXPR08MB6640.eurprd08.prod.outlook.com X-MS-Has-Attach: yes X-MS-Exchange-Organization-Network-Message-Id: c5b714d7-6ff8-49a7-65a1-08d8c2d09980 X-MS-Exchange-Organization-SCL: -1 X-MS-Exchange-Organization-RecordReviewCfmType: 0 x-clientproxiedby: HK0PR03CA0098.apcprd03.prod.outlook.com (2603:1096:203:b0::14) To PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=numbchild@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MANY_SPAN_IN_TEXT=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:263505 Archived-At: --_004_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_ Content-Type: multipart/alternative; boundary="_000_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_" --_000_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <#secure method=3Dpgpmime mode=3Dsign> I tried to use text-property to implement this effect, but seems not workin= g. (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 writes: [Please use "Reply All" to keep the list CC'ed.] From: "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 co= de 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 ba= sed 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-mi= n)) (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)))) (o= v (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-he= ight 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 show= n 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 gon= e.) In that case, this is the expected behavior: if the newline with the line-h= eight property is not visible, the setting has no effect. It is conceptuall= y 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? T= his 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 was= n't designed to support. --_000_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

<#secure method=3Dpgpmime mode=3Dsign>

I tried to use text-property to implement this effect, but seems not wor= king.

(<=
span style=3D"color: #E06C75;">with-current-buffer (get-buffer org-agenda-buffer)
  (let ((position 1084)<=
/code>
        (inhibit-read-only t))
    (goto-char position)
    (put-text-property (point-at-bol(1+ (point-at-bol)) 'display " ")
    (let ((ov (make-over=
lay (point-at-bol) (1+ (point-at-bol)=
))))
      (overlay-put ov 'line-he=
ight 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 t= he 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 &quo= t;#F6B1C3" "#FFFF9D" "#BEEB9F" "#ADD5F7"= )) ('dark (list "#aa557f" "DarkGreen" "DarkSlateGray" = "DarkSlateBlue")))) pos duration) (nconc colors colors) (goto-cha= r (point-min)) (while (setq pos (next-single-property-change (point) 'durat= ion)) (goto-char pos) (when (and (not (equal pos (point-at-eol))) (setq duration (org-get-at-bol 'duration))) ;; larger duration bar height ;; FIX= ME (< 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)) (overla= y-put ov 'line-height line-height) (overlay-put ov 'line-spacing (1- line-h= eight))))))))

(add-hook 'org-agenda-finalize-hook #'org-agenda-log-mode-colorize-blo= ck)

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-hei= ght)))

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 ho= w the overlay line-height property failed when I split window with `split-w= indow-right`. The line height property is gone. (I mean the visual effect i= s gone.)

In that case, this is the expected behavior: if the newline with the l= ine-height property is not visible, the setting has no effect. It is concep= tually 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 re= flect 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 newli= ne.

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

--_000_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_-- --_004_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_ Content-Type: text/plain; name="ATT00001.txt" Content-Description: ATT00001.txt Content-Disposition: attachment; filename="ATT00001.txt"; size=593; creation-date="Wed, 27 Jan 2021 14:34:05 GMT"; modification-date="Wed, 27 Jan 2021 14:34:05 GMT" Content-ID: Content-Transfer-Encoding: base64 LS0gDQpbIHN0YXJkaXZpbmVyIF0NCiAgICAgICBJIHRyeSB0byBtYWtlIGV2ZXJ5IHdvcmQgdGVs bCB0aGUgbWVhbmluZyB0aGF0IEkgd2FudCB0byBleHByZXNzLg0KDQogICAgICAgQmxvZzogaHR0 cHM6Ly9zdGFyZGl2aW5lci5naXRodWIuaW8vDQogICAgICAgSVJDKGZyZWVub2RlKTogc3RhcmRp dmluZXIsIE1hdHJpeDogc3RhcmRpdmluZXINCiAgICAgICBHUEc6IEYwOUY2NTBEN0Q2NzQ4MTk4 OTI1OTE0MDFCNURGMUM5NUFFODlBQzMNCg== --_004_PAXPR08MB6640656C66ADBD53CF772B44A3BB0PAXPR08MB6640eurp_--