all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: emacs-devel@gnu.org
Subject: Re: How to record the line number pixel width for each window.
Date: Sat, 07 Dec 2019 10:27:14 +0200	[thread overview]
Message-ID: <83fthwfsm5.fsf@gnu.org> (raw)
In-Reply-To: <56C918B8-4F0A-4B7F-9AD6-B387EB76EAC4@lawlist.com> (message from Keith David Bershatsky on Fri, 6 Dec 2019 11:29:04 -0800)

> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> From: Keith David Bershatsky <esq@lawlist.com>
> Date: Fri, 6 Dec 2019 11:29:04 -0800
> 
> By "simulate", I had in mind actively using the move_it family of functions -- where Emacs inhibits updating the glass and we can navigate the text to ascertain and/ or set certain values.  For example, the sample snippet/diff in the opening post of this thread occurs when Emacs is using IT to set the value of the line number pixel width, and this is happening in the context of what I think of as a redisplay simulation.  The solution to my issue may be as simple as devising a condition limiting just when to set the window object with the line number pixel width; e.g., when IT is on the first visible line of text in the window (following the header line, if any).  Right now, the snippet sets the value when IT is on other lines besides the first line of text in the window, perhaps even a h
 idden / invisible line due to folded text.  Perhaps that folded / invisible line would have a different line number pixel width, but it is not used because it is hidden and the value is erroneous.

I don't have any specific advice for you.  In general, the required
width of the line-number display is calculated when a window's
redisplay starts, the first time display_line is called for that
window's text area.  In some rare cases, displaying subsequent lines
comes up with a larger value (as can be seen in Org mode with many
folded line).  So maybe looking at the last value in a window will do
what you want.

Again, I don't recommend this approach, as it is fundamentally wrong
IMO.



  reply	other threads:[~2019-12-07  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 18:19 How to record the line number pixel width for each window Keith David Bershatsky
2019-12-06  8:10 ` Eli Zaretskii
2019-12-06 17:07   ` Keith David Bershatsky
2019-12-06 18:42     ` Eli Zaretskii
2019-12-06 19:29       ` Keith David Bershatsky
2019-12-07  8:27         ` Eli Zaretskii [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-12-08  2:57 Keith David Bershatsky

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

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

  git send-email \
    --in-reply-to=83fthwfsm5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=esq@lawlist.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.