unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: Line height issues with display-line-number-mode
Date: Wed, 08 May 2019 09:43:19 +0300	[thread overview]
Message-ID: <83ef59igzc.fsf@gnu.org> (raw)
In-Reply-To: <jwva7fyc9gv.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 07 May 2019 16:30:55 -0400)

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: emacs-devel@gnu.org
> Date: Tue, 07 May 2019 16:30:55 -0400
> 
> > We already have such a text property (display-line-number-disable),
> > but it cannot help here,
> 
> But it *can* help for the *vc-log* case, tho it's a bit cumbersome, see
> patch below.

That's good to know, thanks.  I guess we have yet another use case for
this issue (which doesn't use overlay strings); who knows how many
more are out there?

Btw, any reasons (other than "because we can") why we use these
tricks, instead of actually producing an underline?

> Also the line then runs not just through the text but also
> through the line-number-area (I guess that's OK, but that's not the
> behavior I was expecting).

That's what this property is supposed to produce.  It was added to
help company-mode and similar features which reproduce the display of
a portion of a buffer, replacing the "normal" display of buffer text.

What you expected, I guess, was to see a blank line-number field whose
height is according to the face of the overlay string or the text
property put on the text.  Doing this would be somewhat tricky, I
think, because the display engine lays out the line numbers _before_
it lays out the rest of the screen line, so it doesn't in general have
any idea about the height of the text in that line.  We could, in
principle, tweak the height value maintained by the display iterator,
when we produce line numbers, so that we start the layout of the rest
of the line with the height of, say, 1 pixel, and let the rest of the
line's text enlarge that as needed.  But doing this naïvely would
backfire with various special cases, like empty lines, lines with
characters whose font-provided height is small, etc.: those lines will
appear smaller in height, an unpleasant effect that we would like to
avoid.  So this technique needs some augmentation at least, to take
care of those special cases.

As I said, ideas and patches are welcome.



  reply	other threads:[~2019-05-08  6:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 16:40 Line height issues with display-line-number-mode Clément Pit-Claudel
2019-05-07 17:12 ` Noam Postavsky
2019-05-07 18:36   ` Eli Zaretskii
2019-05-07 19:00     ` Eli Zaretskii
2019-05-07 19:09       ` Stefan Monnier
2019-05-07 19:43         ` Eli Zaretskii
2019-05-07 20:30           ` Stefan Monnier
2019-05-08  6:43             ` Eli Zaretskii [this message]
2019-05-08 13:39               ` Stefan Monnier
2019-05-08 14:05                 ` Eli Zaretskii
2019-05-08 14:13                   ` Noam Postavsky
2019-05-08 15:04                     ` Stefan Monnier
2019-05-08 18:39                       ` Noam Postavsky
2019-05-08 18:54                         ` Eli Zaretskii
2019-05-10  6:15                           ` Kévin Le Gouguec
2019-05-10  7:58                             ` Eli Zaretskii
2019-05-10 13:24                             ` Stefan Monnier
2019-05-08 14:17                   ` Stefan Monnier
2019-05-08 17:30                     ` Eli Zaretskii
2019-05-08 17:46                       ` Stefan Monnier
2019-05-08 18:02                         ` Eli Zaretskii
2019-05-08 18:39                           ` Stefan Monnier
2019-05-08 18:48                             ` Eli Zaretskii
2019-05-08 19:03                               ` Stefan Monnier
2019-05-07 19:49         ` Ergus
2019-05-08  5:51           ` Eli Zaretskii
2019-05-08 13:40             ` Stefan Monnier
2019-05-08 14:07               ` Eli Zaretskii
2019-05-07 18:31 ` Eli Zaretskii
2019-05-07 21:08   ` Clément Pit-Claudel
2019-05-08  7:01     ` Eli Zaretskii
2019-05-08 12:24       ` Clément Pit-Claudel
2019-05-08 14:00         ` Eli Zaretskii
2019-05-08 18:04           ` Clément Pit-Claudel
2019-05-08 18:25             ` Eli Zaretskii
2019-05-08 18:45             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ef59igzc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).