* bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string [not found] <87v90dajvy.fsf.ref@yahoo.com> @ 2021-11-27 12:00 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-11-27 12:32 ` Eli Zaretskii 0 siblings, 1 reply; 6+ messages in thread From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-27 12:00 UTC (permalink / raw) To: 52142 In Emacs -Q, run M-x report-emacs-bug RET, move point to the message intended for novices (This bug report will be sent to the Bug-GNU-Emacs mailing list ...), and then evaluate (posn-at-point) there. The posn-object of the position list will be the display string containing the entire message, but the posn-object-width-height will contain the dimensions of the first character of the message, in this case "T". Thanks. ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string 2021-11-27 12:00 ` bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-27 12:32 ` Eli Zaretskii 2021-11-27 12:47 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 6+ messages in thread From: Eli Zaretskii @ 2021-11-27 12:32 UTC (permalink / raw) To: Po Lu; +Cc: 52142 tags 52142 notabug thanks > Date: Sat, 27 Nov 2021 20:00:17 +0800 > From: Po Lu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> > > In Emacs -Q, run M-x report-emacs-bug RET, move point to the message > intended for novices (This bug report will be sent to the Bug-GNU-Emacs > mailing list ...), and then evaluate (posn-at-point) there. > > The posn-object of the position list will be the display string > containing the entire message, but the posn-object-width-height will > contain the dimensions of the first character of the message, in this > case "T". That's a feature. Maybe it isn't documented clearly enough, but basically as long as there's a character displayed at that position, WIDTH and HEIGHT give the dimensions of that character's glyph on display. Remember: this stuff was originally designed for mouse clicks, where it's important to know what did you click on. ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string 2021-11-27 12:32 ` Eli Zaretskii @ 2021-11-27 12:47 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-11-27 13:03 ` Eli Zaretskii 0 siblings, 1 reply; 6+ messages in thread From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-27 12:47 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 52142 Eli Zaretskii <eliz@gnu.org> writes: > That's a feature. Maybe it isn't documented clearly enough, but > basically as long as there's a character displayed at that position, > WIDTH and HEIGHT give the dimensions of that character's glyph on > display. Hmm, okay. I think the documentation in (elisp)Click Events could do with some improvement: WIDTH, HEIGHT These are the pixel width and height of OBJECT or, if this is ‘nil’, those of the character glyph clicked on. For clicks on a scroll bar, POSITION has this form: (WINDOW AREA (PORTION . WHOLE) TIMESTAMP PART) Should probably be WIDTH, HEIGHT These are the pixel width and height of the character glyph clicked on, or, if none exists, the pixel width and height of OBJECT. For clicks on a scroll bar, POSITION has this form: (WINDOW AREA (PORTION . WHOLE) TIMESTAMP PART) > Remember: this stuff was originally designed for mouse clicks, where > it's important to know what did you click on. Thanks. On a slightly unrelated topic, what would be the appropriate method to obtain the height of such a display string? I'm trying to make the pixel scrolling machinery work with such text, and while scrolling down already works, I have no idea how to implement scrolling up, which currently relies on going to the last screen line, then adjusting vscroll the remainder of the way, which naturally requires a way to fetch the height of the display string. ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string 2021-11-27 12:47 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-27 13:03 ` Eli Zaretskii 2021-11-27 13:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 1 reply; 6+ messages in thread From: Eli Zaretskii @ 2021-11-27 13:03 UTC (permalink / raw) To: Po Lu; +Cc: 52142 > From: Po Lu <luangruo@yahoo.com> > Cc: 52142@debbugs.gnu.org > Date: Sat, 27 Nov 2021 20:47:07 +0800 > > Eli Zaretskii <eliz@gnu.org> writes: > > > That's a feature. Maybe it isn't documented clearly enough, but > > basically as long as there's a character displayed at that position, > > WIDTH and HEIGHT give the dimensions of that character's glyph on > > display. > > Hmm, okay. I think the documentation in (elisp)Click Events could do > with some improvement: Thanks, fixed. > > Remember: this stuff was originally designed for mouse clicks, where > > it's important to know what did you click on. > > Thanks. On a slightly unrelated topic, what would be the appropriate > method to obtain the height of such a display string? I'm trying to > make the pixel scrolling machinery work with such text, and while > scrolling down already works, I have no idea how to implement scrolling > up, which currently relies on going to the last screen line, then > adjusting vscroll the remainder of the way, which naturally requires a > way to fetch the height of the display string. Did you try window-text-pixel-size? ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string 2021-11-27 13:03 ` Eli Zaretskii @ 2021-11-27 13:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-11-27 13:27 ` Eli Zaretskii 0 siblings, 1 reply; 6+ messages in thread From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-27 13:12 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 52142-done Eli Zaretskii <eliz@gnu.org> writes: > Thanks, fixed. I think it's OK to close this bug now then. > Did you try window-text-pixel-size? No, for whatever reason I assumed it would not work for text displayed this way. I will try it. Thanks. ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string 2021-11-27 13:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-27 13:27 ` Eli Zaretskii 0 siblings, 0 replies; 6+ messages in thread From: Eli Zaretskii @ 2021-11-27 13:27 UTC (permalink / raw) To: Po Lu; +Cc: 52142 > From: Po Lu <luangruo@yahoo.com> > Cc: 52142-done@debbugs.gnu.org > Date: Sat, 27 Nov 2021 21:12:55 +0800 > > Eli Zaretskii <eliz@gnu.org> writes: > > > Thanks, fixed. > > I think it's OK to close this bug now then. > > > Did you try window-text-pixel-size? > > No, for whatever reason I assumed it would not work for text displayed > this way. window-text-pixel-size is actually supposed to work in more cases than posn-at-point, since it doesn't require the text to be visible (or even displayed). ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-11-27 13:27 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <87v90dajvy.fsf.ref@yahoo.com> 2021-11-27 12:00 ` bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-11-27 12:32 ` Eli Zaretskii 2021-11-27 12:47 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-11-27 13:03 ` Eli Zaretskii 2021-11-27 13:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-11-27 13:27 ` Eli Zaretskii
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).