From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thomas Wiecki Newsgroups: gmane.emacs.bugs Subject: bug#14567: Scrolling of large images Date: Sat, 8 Jun 2013 11:52:39 -0400 Message-ID: References: <83ppvzur6i.fsf@gnu.org> <83obbjuov4.fsf@gnu.org> <83vc5osn0r.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013d174aefaef604dea68b73 X-Trace: ger.gmane.org 1370706847 7209 80.91.229.3 (8 Jun 2013 15:54:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Jun 2013 15:54:07 +0000 (UTC) Cc: 14567@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 08 17:54:08 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UlLSw-0000KS-Fd for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Jun 2013 17:54:06 +0200 Original-Received: from localhost ([::1]:47385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlLSw-0000cm-1R for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Jun 2013 11:54:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlLSp-0000cf-Ee for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2013 11:54:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlLSm-0000te-23 for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2013 11:53:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlLSl-0000ta-UQ for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2013 11:53:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UlLSr-0004L9-RD for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2013 11:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Wiecki Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2013 15:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14567 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14567-submit@debbugs.gnu.org id=B14567.137070682116638 (code B ref 14567); Sat, 08 Jun 2013 15:54:01 +0000 Original-Received: (at 14567) by debbugs.gnu.org; 8 Jun 2013 15:53:41 +0000 Original-Received: from localhost ([127.0.0.1]:58544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UlLSU-0004KH-S4 for submit@debbugs.gnu.org; Sat, 08 Jun 2013 11:53:39 -0400 Original-Received: from mail-la0-f47.google.com ([209.85.215.47]:62613) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UlLSP-0004Jt-Gc for 14567@debbugs.gnu.org; Sat, 08 Jun 2013 11:53:36 -0400 Original-Received: by mail-la0-f47.google.com with SMTP id fe20so4556048lab.20 for <14567@debbugs.gnu.org>; Sat, 08 Jun 2013 08:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=V3y11Is4jabRvjbvHKCOCZq2jmDPaagfmsgzZhAz0Tk=; b=DrOv93Sg75IT8BuV+nNDi4aBzmZ6PjYChfod4GCL21XZFHB9QkUC/hO+H623z+wPp9 HQ2a4pdz7IBPQajii1rUp0YGPR5mPrFJ5KFwljM0bN2aZjecFCXsh7Rh8tJV01Oj0qOi yyr9T9t/+aDlOOx12OnRkSwszB1/zXT9Z8Vc5N2bTUJakf2yDjJQJO9CJa37C10W8gmp auTsB/5kB6B8+YBSrQVWlRU3JdOXDLrQFeozYm0wFYXY76q7D9EJlPfgkagRPakM5Xz9 I6fMzO9O+LdByPoqniph2pUHXnwWiYpsInjf7FTNAN6uMFnTOmKphDuxhdwXskrpIvfo Sg9Q== X-Received: by 10.152.3.227 with SMTP id f3mr1529693laf.75.1370706800518; Sat, 08 Jun 2013 08:53:20 -0700 (PDT) Original-Received: by 10.112.80.69 with HTTP; Sat, 8 Jun 2013 08:52:39 -0700 (PDT) In-Reply-To: <83vc5osn0r.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74896 Archived-At: --089e013d174aefaef604dea68b73 Content-Type: text/plain; charset=UTF-8 Thanks! Which branch is this based off of? I tried it on bzr trunk (bzr:// bzr.savannah.gnu.org/emacs/trunk) but got: patching file lisp/simple.el Hunk #1 FAILED at 4738. Hunk #2 FAILED at 4761. Hunk #3 FAILED at 4808. 3 out of 3 hunks FAILED -- saving rejects to file lisp/simple.el.rej patching file src/xdisp. On Sat, Jun 8, 2013 at 10:19 AM, Eli Zaretskii wrote: > > Date: Thu, 06 Jun 2013 20:32:15 +0300 > > From: Eli Zaretskii > > Cc: 14567@debbugs.gnu.org > > > > > From: Thomas Wiecki > > > Date: Thu, 6 Jun 2013 13:16:43 -0400 > > > Cc: 14567@debbugs.gnu.org > > > > > > 1. Download a large image (e.g. > > > > http://cdn.urbanislandz.com/wp-content/uploads/2011/10/MMSposter-large.jpg > ) > > > and save it as /tmp/test.jpg > > > 2. In an emacs buffer type "(insert-image (create-image > "/tmp/test.jpg"))" > > > 3. Type some arbitrary lines of text below this line. > > > 4. In first line (containing insert-image), type C-x C-e at end of > line to > > > load the image. > > > 5. Image should appear in buffer. > > > 6. Scroll down repeatedly until past the image. > > > > > > Expected behavior: Scrolls down smoothly even once scrolled past image. > > > Observed behavior: Scrolls down smoothly until end of image is > reached. At > > > end of image, the next scroll causes a huge jump in the window so that > and > > > only the text is shown but not any of the residual image. > > > > > > 7. scroll back up > > > > > > Expected behavior: Scrolls upwards over image. > > > Observed behavior: Jumps over complete image and shows beginning of > buffer. > > > > Perfect, thanks. I will take a look. > > Can you try the changes below and see if they give good results, > including in the real-life use cases where you bumped into this? Note > that you will have to rebuild Emacs to try this. > > Thanks. > > === modified file 'lisp/simple.el' > --- lisp/simple.el 2013-06-05 18:10:27 +0000 > +++ lisp/simple.el 2013-06-08 14:14:39 +0000 > @@ -4738,20 +4738,35 @@ lines." > (vpos (nth 1 lh)) > (ypos (nth 2 lh)) > (rbot (nth 3 lh)) > + (this-lh (window-line-height)) > + (this-height (nth 0 this-lh)) > + (this-ypos (nth 2 this-lh)) > + (fch (frame-char-height)) > py vs) > (when (or (null lh) > - (>= rbot (frame-char-height)) > - (<= ypos (- (frame-char-height)))) > + (>= rbot fch) > + (<= ypos (- fch)) > + (null this-lh) > + (<= this-ypos (- fch))) > (unless lh > (let ((wend (pos-visible-in-window-p t nil t))) > (setq rbot (nth 3 wend) > vpos (nth 5 wend)))) > + (unless this-lh > + (let ((wstart (pos-visible-in-window-p nil nil t))) > + (setq this-ypos (nth 2 wstart) > + this-height (nth 4 wstart)))) > (cond > - ;; If last line of window is fully visible, move forward. > - ((or (null rbot) (= rbot 0)) > + ;; If last line of window is fully visible, and vscrolling > + ;; more would make this line invisible, move forward. > + ((and (or (< (setq vs (window-vscroll nil t)) fch) > + (<= this-height fch)) > + (or (null rbot) (= rbot 0))) > nil) > - ;; If cursor is not in the bottom scroll margin, move forward. > - ((and (> vpos 0) > + ;; If cursor is not in the bottom scroll margin, and the > + ;; current line is is not too tall, move forward. > + ((and (<= this-height fch) > + (> vpos 0) > (< (setq py > (or (nth 1 (window-line-height)) > (let ((ppos (posn-at-point))) > @@ -4761,9 +4776,10 @@ lines." > nil) > ;; When already vscrolled, we vscroll some more if we can, > ;; or clear vscroll and move forward at end of tall image. > - ((> (setq vs (window-vscroll nil t)) 0) > - (when (> rbot 0) > - (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) > t))) > + ((> vs 0) > + (when (or (> rbot 0) > + (> this-height fch)) > + (set-window-vscroll nil (+ vs fch) t))) > ;; If cursor just entered the bottom scroll margin, move forward, > ;; but also vscroll one line so redisplay won't recenter. > ((and (> vpos 0) > @@ -4808,7 +4824,14 @@ lines." > ;; display-based motion doesn't make sense (because each > ;; logical line occupies exactly one screen line). > (not (> (window-hscroll) 0))) > - (line-move-visual arg noerror) > + (prog1 (line-move-visual arg noerror) > + ;; If we moved into a tall line, set vscroll to make > + ;; scrolling through tall images more smooth. > + (let ((lh (line-pixel-height))) > + (if (and (< arg 0) > + (< (point) (window-start)) > + (> lh (frame-char-height))) > + (set-window-vscroll nil (- lh (frame-char-height)) t)))) > (line-move-1 arg noerror to-end))))) > > ;; Display-based alternative to line-move-1. > > === modified file 'src/xdisp.c' > --- src/xdisp.c 2013-06-06 16:35:31 +0000 > +++ src/xdisp.c 2013-06-08 14:02:28 +0000 > @@ -1217,6 +1217,24 @@ line_bottom_y (struct it *it) > return line_top_y + line_height; > } > > +DEFUN ("line-pixel-height", Fline_pixel_height, > + Sline_pixel_height, 0, 0, 0, > + doc: /* Return height in pixels of text line in the selected > window. > + > +Value is the height in pixels of the line at point. */) > + (void) > +{ > + struct it it; > + struct text_pos pt; > + struct window *w = XWINDOW (selected_window); > + > + SET_TEXT_POS (pt, PT, PT_BYTE); > + start_display (&it, w, pt); > + it.vpos = it.current_y = 0; > + last_height = 0; > + return make_number (line_bottom_y (&it)); > +} > + > /* Subroutine of pos_visible_p below. Extracts a display string, if > any, from the display spec given as its argument. */ > static Lisp_Object > @@ -28665,6 +28683,7 @@ syms_of_xdisp (void) > defsubr (&Stool_bar_lines_needed); > defsubr (&Slookup_image_map); > #endif > + defsubr (&Sline_pixel_height); > defsubr (&Sformat_mode_line); > defsubr (&Sinvisible_p); > defsubr (&Scurrent_bidi_paragraph_direction); > > --089e013d174aefaef604dea68b73 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks! Which branch is this based off of? I tried it on b= zr trunk (bzr://bzr.sav= annah.gnu.org/emacs/trunk)=C2=A0but got:
patching file lisp/si= mple.el
Hunk #1 FAILED at 4738.
Hunk #2 FAILED at 4761.
Hu= nk #3 FAILED at 4808.
3 out of 3 hunks FAILED -- saving rejects t= o file lisp/simple.el.rej
patching file src/xdisp.


On Sat,= Jun 8, 2013 at 10:19 AM, Eli Zaretskii <eliz@gnu.org> wrote:
=
> Date: Thu, 06 Jun 2013 20:32:15 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc:
14567@debbugs.gnu.org=
>
> > From: Thomas Wiecki <thomas.wiecki@gmail.com>
> > Date: Thu, 6 Jun 2013 13:16:43 -0400
> > Cc: 14567@debbugs.gnu.or= g
> >
> > 1. Download a large image (e.g.
> > http://cdn.urbanislandz.com/wp-cont= ent/uploads/2011/10/MMSposter-large.jpg)
> > and save it as /tmp/test.jpg
> > 2. In an emacs buffer type "(insert-image (create-image &quo= t;/tmp/test.jpg"))"
> > 3. Type some arbitrary lines of text below this line.
> > 4. In first line (containing insert-image), type C-x C-e at end o= f line to
> > load the image.
> > 5. Image should appear in buffer.
> > 6. Scroll down repeatedly until past the image.
> >
> > Expected behavior: Scrolls down smoothly even once scrolled past = image.
> > Observed behavior: Scrolls down smoothly until end of image is re= ached. At
> > end of image, the next scroll causes a huge jump in the window so= that and
> > only the text is shown but not any of the residual image.
> >
> > 7. scroll back up
> >
> > Expected behavior: Scrolls upwards over image.
> > Observed behavior: Jumps over complete image and shows beginning = of buffer.
>
> Perfect, thanks. =C2=A0I will take a look.

Can you try the changes below and see if they give good results= ,
including in the real-life use cases where you bumped into this? =C2=A0Note=
that you will have to rebuild Emacs to try this.

Thanks.

=3D=3D=3D modified file 'lisp/simple.el'
--- lisp/simple.el =C2=A0 =C2=A0 =C2=A02013-06-05 18:10:27 +0000
+++ lisp/simple.el =C2=A0 =C2=A0 =C2=A02013-06-08 14:14:39 +0000
@@ -4738,20 +4738,35 @@ lines."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(vpos (nth 1 lh))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ypos (nth 2 lh))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(rbot (nth 3 lh))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(this-lh (window-line-height))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(this-height (nth 0 this-lh))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(this-ypos (nth 2 this-lh))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(fch (frame-char-height))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0py vs)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(when (or (null lh)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (>=3D rbot (frame-cha= r-height))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (<=3D ypos (- (frame-= char-height))))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (>=3D rbot fch)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (<=3D ypos (- fch)) + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (null this-lh)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (<=3D this-ypos (- fc= h)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless lh
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((wend (pos-visible-in-window-p t n= il t)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq rbot (nth 3 wend)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 vpos (nth 5 = wend))))
+ =C2=A0 =C2=A0 =C2=A0 (unless this-lh
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((wstart (pos-visible-in-window-p nil ni= l t)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq this-ypos (nth 2 wstart)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 this-height (nth = 4 wstart))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond
- =C2=A0 =C2=A0 =C2=A0 =C2=A0;; If last line of window is fully visible, mo= ve forward.
- =C2=A0 =C2=A0 =C2=A0 =C2=A0((or (null rbot) (=3D rbot 0))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; If last line of window is fully visible, an= d vscrolling
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; more would make this line invisible, move f= orward.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0((and (or (< (setq vs (window-vscroll nil t= )) fch)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(<=3D th= is-height fch))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(or (null rbot) (=3D rbot= 0)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nil)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0;; If cursor is not in the bottom scroll margi= n, move forward.
- =C2=A0 =C2=A0 =C2=A0 =C2=A0((and (> vpos 0)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; If cursor is not in the bottom scroll margi= n, and the
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; current line is is not too tall, move forwa= rd.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0((and (<=3D this-height fch)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(> vpos 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(< (setq py
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (or (nth 1 (window-line-height))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (let ((ppos (posn-at-point)))
@@ -4761,9 +4776,10 @@ lines."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nil)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; When already vscrolled, we vscroll som= e more if we can,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; or clear vscroll and move forward at e= nd of tall image.
- =C2=A0 =C2=A0 =C2=A0 =C2=A0((> (setq vs (window-vscroll nil t)) 0)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (> rbot 0)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set-window-vscroll nil (+ vs (min rbo= t (frame-char-height))) t)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0((> vs 0)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (or (> rbot 0)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (> this= -height fch))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set-window-vscroll nil (+ vs fch) t))= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; If cursor just entered the bottom scro= ll margin, move forward,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; but also vscroll one line so redisplay= won't recenter.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((and (> vpos 0)
@@ -4808,7 +4824,14 @@ lines."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; display-based mot= ion doesn't make sense (because each
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; logical line occu= pies exactly one screen line).
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(not (> (window-h= scroll) 0)))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 (line-move-visual arg noerror)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (prog1 (line-move-visual arg noerror)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; If we moved into a tall line, set v= scroll to make
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; scrolling through tall images more = smooth.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((lh (line-pixel-height)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (and (< arg 0)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(< (point) (window-start))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(> lh (frame-char-height)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set-window-vscro= ll nil (- lh (frame-char-height)) t))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (line-move-1 arg noerror to-end)))))

=C2=A0;; Display-based alternative to line-move-1.

=3D=3D=3D modified file 'src/xdisp.c'
--- src/xdisp.c 2013-06-06 16:35:31 +0000
+++ src/xdisp.c 2013-06-08 14:02:28 +0000
@@ -1217,6 +1217,24 @@ line_bottom_y (struct it *it)
=C2=A0 =C2=A0return line_top_y + line_height;
=C2=A0}

+DEFUN ("line-pixel-height", Fline_pixel_height,
+ =C2=A0 =C2=A0 =C2=A0 Sline_pixel_height, 0, 0, 0,
+ =C2=A0 =C2=A0 =C2=A0 doc: /* Return height in pixels of text line in the = selected window.
+
+Value is the height in pixels of the line at point. =C2=A0*/)
+ =C2=A0(void)
+{
+ =C2=A0struct it it;
+ =C2=A0struct text_pos pt;
+ =C2=A0struct window *w =3D XWINDOW (selected_window);
+
+ =C2=A0SET_TEXT_POS (pt, PT, PT_BYTE);
+ =C2=A0start_display (&it, w, pt);
+ =C2=A0it.vpos =3D it.current_y =3D 0;
+ =C2=A0last_height =3D 0;
+ =C2=A0return make_number (line_bottom_y (&it));
+}
+
=C2=A0/* Subroutine of pos_visible_p below. =C2=A0Extracts a display string= , if
=C2=A0 =C2=A0 any, from the display spec given as its argument. =C2=A0*/ =C2=A0static Lisp_Object
@@ -28665,6 +28683,7 @@ syms_of_xdisp (void)
=C2=A0 =C2=A0defsubr (&Stool_bar_lines_needed);
=C2=A0 =C2=A0defsubr (&Slookup_image_map);
=C2=A0#endif
+ =C2=A0defsubr (&Sline_pixel_height);
=C2=A0 =C2=A0defsubr (&Sformat_mode_line);
=C2=A0 =C2=A0defsubr (&Sinvisible_p);
=C2=A0 =C2=A0defsubr (&Scurrent_bidi_paragraph_direction);


--089e013d174aefaef604dea68b73--