unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
To: eliz@gnu.org
Cc: tkk@misasa.okayama-u.ac.jp, emacs-devel@gnu.org
Subject: Re: line-pixel-height beyond eol
Date: Fri, 15 Sep 2017 10:39:53 +0900 (JST)	[thread overview]
Message-ID: <20170915.103953.1793873179442462342.tkk@misasa.okayama-u.ac.jp> (raw)
In-Reply-To: <83poatmaja.fsf@gnu.org>

>>   (progn (vertical-motion 1)
>>          (dolist (vs (number-sequence 1 (1- (save-excursion
>>                                               (goto-char (window-start))
>>                                               (line-pixel-height)))))
>>            (set-window-vscroll nil vs t) (sit-for 0.01))
>>          (scroll-up 1))
>> 
>> Let's assume a line with image of height 144 pixel is located on the
>> top line.  When auto-hscroll-mode is off and (current-column) is large
>> (the 144 pixel image is scrolled left), the top line looks 27 pixel
>> height but (line-pixel-height) returns 144 pixel.  The inconsistency
>> results in jump.
> 
> Would it help not to use the height of the top window line, but
> instead simply use the value returned by frame-char-height?  That
> takes its value from the frame's default font, and so should be
> independent on what's in the window.

That is a good idea!  I want to scroll that way.

To scroll pixels by frame-char-height, a line should be flushed by
(scroll-up 1) when (window-vscroll nil t) is very close to height of
pixel on the top window line.

If this flush does not happened on the right timing, screen jumps
unexpectedly as demonstrated below.

M-x about-emacs
M-: (progn
        (dolist (vs (number-sequence 1 (1- (frame-char-height))))
          (set-window-vscroll nil vs t) (sit-for 0.01))
        (scroll-up 1))

Thus I have to know height of pixel on the top window line.



  reply	other threads:[~2017-09-15  1:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12 10:12 line-pixel-height beyond eol Tak Kunihiro
2017-09-12 15:13 ` Eli Zaretskii
2017-09-13  0:24   ` Tak Kunihiro
2017-09-13 15:28     ` Eli Zaretskii
2017-09-13 23:14       ` Tak Kunihiro
2017-09-14 17:53         ` Eli Zaretskii
2017-09-15  1:39           ` Tak Kunihiro [this message]
2017-09-15 17:35             ` Eli Zaretskii
2017-09-23 12:57               ` Tak Kunihiro
2017-09-23 13:16                 ` Eli Zaretskii
2017-10-05  9:50                   ` Tak Kunihiro
2017-10-09 13:31                     ` Eli Zaretskii
2017-10-16  5:13                       ` Tak Kunihiro
2017-10-16 16:16                         ` Eli Zaretskii
2017-10-17  0:29                           ` Tak Kunihiro
2017-10-17 16:37                             ` Eli Zaretskii

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=20170915.103953.1793873179442462342.tkk@misasa.okayama-u.ac.jp \
    --to=tkk@misasa.okayama-u.ac.jp \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).