From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Line height issues with display-line-number-mode Date: Wed, 08 May 2019 21:25:52 +0300 Message-ID: <83k1f0hkgf.fsf@gnu.org> References: <6fd496f0-7dd5-6c0e-5121-b618e7dca831@gmail.com> <83v9ymi0as.fsf@gnu.org> <21f7bf78-ac83-b3b5-421b-8ba6983dc7e8@gmail.com> <83d0ktig51.fsf@gnu.org> <83v9ylgi6c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="118221"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 08 20:40:27 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hORUI-000U9P-8A for ged-emacs-devel@m.gmane.org; Wed, 08 May 2019 20:40:18 +0200 Original-Received: from localhost ([127.0.0.1]:41448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hORIC-0004xw-W3 for ged-emacs-devel@m.gmane.org; Wed, 08 May 2019 14:27:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hORGv-0004oK-7z for emacs-devel@gnu.org; Wed, 08 May 2019 14:26:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hORGu-0003W2-B9; Wed, 08 May 2019 14:26:28 -0400 Original-Received: from [176.228.60.248] (port=4740 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hORGb-0006wr-Cp; Wed, 08 May 2019 14:26:14 -0400 In-reply-to: (message from =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel on Wed, 8 May 2019 14:04:17 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236308 Archived-At: > Cc: emacs-devel@gnu.org > From: Clément Pit-Claudel > Date: Wed, 8 May 2019 14:04:17 -0400 > > (with-current-buffer (get-buffer-create "*test*") > (insert "test\ntest\ntest") > (let ((ov (make-overlay 1 6)) > (str (concat (propertize " " 'display '(space :height (1) :align-to right) 'face '(:underline t)) > "AAA\n" > "BBB" > (propertize " " 'display '(space :height (1) :align-to right) 'face '(:underline t))))) > (overlay-put ov 'after-string str) > (overlay-put ov 'face '(:underline t))) > (pop-to-buffer (current-buffer))) > > It works OK! But it has a few problems: > > * The underline is thicker under the first 'test' than under the rest of the line. It seems to work better if I don't put the :underline property on the overlay itself… but then I don't understand why 'test' gets underlined at all. You have "test" underlined because your overlay covers it. Try the variant below instead. > * I need to override the underline that might be present on "BBB" > * There's a line continuation indicator after each long line. Maybe with a more clever :align-to spec? Probably. (with-current-buffer (get-buffer-create "*test*") (insert "test\ntest\ntest") (let ((ov (make-overlay 6 7)) (str (concat (propertize " " 'display '(space :height (1) :align-to right) 'face '(:underline t)) "AAA\n" "BBB" (propertize " " 'display '(space :height (1) :align-to right) 'face '(:underline t))))) (overlay-put ov 'before-string str) (overlay-put ov 'face '(:underline t))) (pop-to-buffer (current-buffer)))