From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: stardiviner Newsgroups: gmane.emacs.devel Subject: Re: [BUG] ov property line height failed on lone length line when exceeded window width Date: Thu, 04 Jun 2020 23:46:09 +0800 Message-ID: <87v9k6esvy.fsf@gmail.com> References: <8C0A9F18-AF7B-4C50-8625-229456BF40E4@gnu.org> <835zc8ciqb.fsf@gnu.org> <87a71jlky8.fsf@gmail.com> <83wo4nas3n.fsf@gnu.org> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="61998"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4; emacs 28.0.50 Cc: numbchild@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 04 17:52:59 2020 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 1jgsAs-000FzJ-0G for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jun 2020 17:52:58 +0200 Original-Received: from localhost ([::1]:33830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgsAr-0001T7-02 for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Jun 2020 11:52:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgsAP-0000ob-5v for emacs-devel@gnu.org; Thu, 04 Jun 2020 11:52:29 -0400 Original-Received: from [183.249.132.153] (port=1771 helo=localhost) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgsAL-0001YZ-Az; Thu, 04 Jun 2020 11:52:28 -0400 Original-Received: by localhost (Postfix, from userid 1000) id 1F80B2416EB; Thu, 4 Jun 2020 23:46:13 +0800 (CST) In-reply-to: <83wo4nas3n.fsf@gnu.org> X-Host-Lookup-Failed: Reverse DNS lookup failed for 183.249.132.153 (deferred) Received-SPF: softfail client-ip=183.249.132.153; envelope-from=numbchild@gmail.com; helo=localhost X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/04 11:46:14 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 53 X-Spam_score: 5.3 X-Spam_bar: +++++ X-Spam_report: (5.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, FSL_HELO_NON_FQDN_1=0.001, HELO_LOCALHOST=3.828, NML_ADSP_CUSTOM_MED=0.9, RDNS_NONE=0.793, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: reject 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:251855 Archived-At: =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Eli Zaretskii writes: >> From: stardiviner >> Cc: emacs-devel@gnu.org >> Date: Thu, 04 Jun 2020 08:43:27 +0800 >>=20 >> > 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. >>=20 >> 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 s= ome >> 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-a= genda-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" "DarkSlateB= lue")))) 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). =2D --=20 [ 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 =2D----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7ZF0EUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsOY+gf+JfnwA67k3RpnSXcIaERYDALF434Q t2XpigdnMigV3T+6OwQoPXHEPvmZU0tQ2a/RcPhMRw70FbQP2KGKqwc5VnSonzyp NBYKKBKWoQtNpFFdK7Nu1sL+5/7weLtK0IH4DjZ7whp5POj32l+AAD8FTclOJLIn CezOj/X5YsGmh08eUEIjUK9mk229hun9UFV4emdNj8BDisNXQQELyrOTXF3ITiZC +peQmYWib90G+Pma4AavW9EyfxOoZVgOf846M5e8MMyrhLXaGKzJh7eyRab26psA mTS8vOOGzFPyK0SisHU0I3T+JsvdJRScZfFZNWJZvQyPP03pvxEImod0Og=3D=3D =3DcFd8 =2D----END PGP SIGNATURE-----