unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Sébastien Chapuis" <sebastien@chapu.is>
Cc: rudalics@gmx.at, emacs-devel@gnu.org
Subject: Re: [PATCH] Add function window-line-width
Date: Thu, 14 Nov 2019 12:08:24 +0200	[thread overview]
Message-ID: <83lfsi7otj.fsf@gnu.org> (raw)
In-Reply-To: <CAN2Hsvze07OFatH-tjxd8YM0abuRNkh1FBhSyu3BBLf6BRv31g@mail.gmail.com> (message from Sébastien Chapuis on Mon, 11 Nov 2019 03:02:23 +0800)

> From: Sébastien Chapuis <sebastien@chapu.is>
> Date: Mon, 11 Nov 2019 03:02:23 +0800
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> 
> > There's always the problem that we want to reserve space for a block
> > cursor at line end.
> 
> IMO that's a case that should be handled by the user of the function, not by 'window-lines-pixel-dimensions'
> itself.

How can application code do anything like that?  The glyph matrices
aren't (and shouldn't be) exposed to Lisp.

> In my few tests, 'window-lines-pixel-dimensions' returns a width with 1 and 2 glyphs more, so it's not just 1
> space for the block cursor,
> there might be cases where there are more glyphs added (?).

Please show those test cases.  It is hard to have an effective
discussion without seeing the actual use cases being mentioned.

> And AFAIK, there is no way to know how many glyphs/pixels the redisplay add.

The display engine does know that, of course.

> Anyone who wants to have an accurate number of pixels displayed will be unable to use this function.

That's a pretty string assertion; the fact that we do use the function
in our own code seems to contradict it.

> > Then we probably should rewrite 'window-text-pixel-size' as Eli
> > suggested earlier.
> 
> Agreed, but I would prefer to use 'window-lines-pixel-dimensions' since this is exactly the function I need.
> As per the documentation [1]:
> `window-text-pixel-size treats the text displayed in a window as a whole and does not care about
>  the size of individual lines. The following function [window-lines-pixel-dimensions] does.`

What is missing in window-lines-pixel-dimensions to make it satisfy
your use cases, and why?  I think it will be a better fix for your
needs, given the problems you have with window-lines-pixel-dimensions,
and I don't think we should change the latter in radical ways.



  reply	other threads:[~2019-11-14 10:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 22:49 [PATCH] Add function window-line-width Sébastien Chapuis
2019-11-07  8:40 ` martin rudalics
2019-11-07  8:50   ` martin rudalics
2019-11-08  4:54     ` Sébastien Chapuis
2019-11-08  9:21       ` martin rudalics
2019-11-08 13:18         ` Eli Zaretskii
2019-11-08 18:27           ` martin rudalics
2019-11-09 22:09             ` Sébastien Chapuis
2019-11-10  9:46               ` martin rudalics
2019-11-10 19:02                 ` Sébastien Chapuis
2019-11-14 10:08                   ` Eli Zaretskii [this message]
2019-11-14  9:11               ` Eli Zaretskii
2019-11-07  9:23 ` Robert Pluim

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=83lfsi7otj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    --cc=sebastien@chapu.is \
    /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).