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 17:00:27 +0300 Message-ID: <83v9ylgi6c.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> 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="187757"; 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 16:01:56 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 1hON8u-000mgw-1i for ged-emacs-devel@m.gmane.org; Wed, 08 May 2019 16:01:56 +0200 Original-Received: from localhost ([127.0.0.1]:37753 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hON8t-0006HB-2o for ged-emacs-devel@m.gmane.org; Wed, 08 May 2019 10:01:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hON83-0005nf-6l for emacs-devel@gnu.org; Wed, 08 May 2019 10:01:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hON7w-0001TJ-Lu; Wed, 08 May 2019 10:00:56 -0400 Original-Received: from [176.228.60.248] (port=4344 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hON7s-0002g1-3L; Wed, 08 May 2019 10:00:54 -0400 In-reply-to: (message from =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel on Wed, 8 May 2019 08:24:53 -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:236288 Archived-At: > Cc: emacs-devel@gnu.org > From: Clément Pit-Claudel > Date: Wed, 8 May 2019 08:24:53 -0400 > > > "This particular case" being what, in technical terms? A line that > > begins with an overlay string? A line whose entire contents comes > > from an overlay string? Something else? > > I'm not sure; I think 'a line whose entire contents come from an overlay string' is probably right. That's harder than "starts with an overlay string", but still doable, I think. However, I wonder whether it will cover enough use cases. > > And finally, the same question I asked Stefan: why are you using this > > trick instead of producing an underline with face properties? If the > > problem is that you want to control the thickness of the underline, > > providing such a feature is much easier than tweaking line-number > > display for these cases. > > I'm trying to produce a line that stretches the entire width of the window; can this be done with underlines? Controlling the thickness of the line is not a strict requirement for me. Using an image comes to mind. Did you consider that? Another alternative is an empty line with the underline face. If you want it to fit to window dynamically, you can use the :space display property with :align-to property. > Additionally, I use think lines not just to draw a colored line, but also for padding around it (so quick-peek in fact displays one think blank line, one thin line with a background, and another thin blank line). Similarly, in compact-docstrings mode, I use face properties to make certain lines less tall. What is the purpose of changing the line height in these cases? > - Hide line numbers (but it means computing a height for the line and then comparing it to the height needed for line numbers) > - Clip them (like nlinum did; but clipping is easier in the margin than in the buffer area; is that correct?). On the margin it just happens to work "by sheer luck", because we simply don't care enough about the text displayed on the margins, and so don't take it into consideration when computing the line metrics. The problems with doing the same in the text area I already described in another message. They are not insurmountable, but "Someone" should examine all those corner cases and make sure we behave reasonably with such a change. > - Shrink the font? Could line numbers be set to the same face as the line feed on their line? Maybe with some effort, but wouldn't having smaller numbers on some lines look ugly? It will cause the text to begin more to the left, although for empty lines this might not matter, if they use the default background. > That being said, the trickiest case is the one with overlays, since (IIUC) I can handle the compact-docstrings case by putting a property on the lines to disable line numbers manually. You'd also need to manually indent the line with some overlay string, to have it lined up with those that do have line numbers, but other than that, yes, it should work.