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: Tue, 07 May 2019 21:31:23 +0300 Message-ID: <83v9ymi0as.fsf@gnu.org> References: <6fd496f0-7dd5-6c0e-5121-b618e7dca831@gmail.com> 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="156754"; 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 Tue May 07 20:32:45 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 1hO4tR-000eXn-NA for ged-emacs-devel@m.gmane.org; Tue, 07 May 2019 20:32:45 +0200 Original-Received: from localhost ([127.0.0.1]:51231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO4tQ-0005ML-F5 for ged-emacs-devel@m.gmane.org; Tue, 07 May 2019 14:32:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO4sc-0005LO-S3 for emacs-devel@gnu.org; Tue, 07 May 2019 14:31:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO4sc-0004nD-Pz; Tue, 07 May 2019 14:31:54 -0400 Original-Received: from [176.228.60.248] (port=3499 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hO4sZ-0005W7-Ta; Tue, 07 May 2019 14:31:54 -0400 In-reply-to: <6fd496f0-7dd5-6c0e-5121-b618e7dca831@gmail.com> (message from =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel on Tue, 7 May 2019 12:40:02 -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:236251 Archived-At: > From: Clément Pit-Claudel > Date: Tue, 7 May 2019 12:40:02 -0400 > > (with-current-buffer (get-buffer-create "*test*") > (insert "test\ntest\ntest") > (let ((ov (make-overlay 1 6)) > (str (propertize "\n" 'face '(:height 1 :background "#edd400")))) > (overlay-put ov 'after-string str)) > (pop-to-buffer (current-buffer))) > > With display-line-numbers-mode, however, the thin line to be a full character tall. I have attached screenshots. > > Is there a workaround for this issue? Only if you customize the line-number face to be smaller. I don't understand what do you want to see instead of a line number if its face should use a higher font. The Emacs display is a canvas, so the height of a screen line is determined by the highest display element on that screen line. > More generally, is there a way to prevent line numbers from affecting the height of the corresponding line? For example in compact-docstrings I shrink blank lines in documentation strings to half their usual height, but enabling display-line-numbers-mode stretches those lines back to regular height. As expected. Make your line-number face half-height in those cases, and you can have what you want.