From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.bugs Subject: bug#14567: Scrolling of large images Date: Sat, 15 Jun 2013 11:02:46 +0200 Message-ID: <87bo77d9vt.fsf@engster.org> References: <83ppvzur6i.fsf@gnu.org> <83obbjuov4.fsf@gnu.org> <83vc5osn0r.fsf@gnu.org> <83obbgsg33.fsf@gnu.org> <83k3m4sar0.fsf@gnu.org> <83ehccromw.fsf@gnu.org> <87bo7cpfpk.fsf@engster.org> <83li6bvl2i.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1371286995 21038 80.91.229.3 (15 Jun 2013 09:03:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Jun 2013 09:03:15 +0000 (UTC) Cc: thomas.wiecki@gmail.com, 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 15 11:03:16 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 1UnmOB-0002nn-Lu for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Jun 2013 11:03:15 +0200 Original-Received: from localhost ([::1]:43177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnmOB-00059x-0B for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Jun 2013 05:03:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnmO2-00059f-1E for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2013 05:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnmNy-0006RE-M8 for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2013 05:03:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnmNy-0006R6-Ie for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2013 05:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UnmNx-0008Fb-Uc for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2013 05:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Engster Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jun 2013 09:03: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.137128698031708 (code B ref 14567); Sat, 15 Jun 2013 09:03:01 +0000 Original-Received: (at 14567) by debbugs.gnu.org; 15 Jun 2013 09:03:00 +0000 Original-Received: from localhost ([127.0.0.1]:45629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UnmNu-0008FH-PG for submit@debbugs.gnu.org; Sat, 15 Jun 2013 05:02:59 -0400 Original-Received: from randomsample.de ([83.169.19.17]:40055) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UnmNr-0008Es-7U for 14567@debbugs.gnu.org; Sat, 15 Jun 2013 05:02:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=wuy0KBhEoX3NFi+HJQoCPcfWomRnCedKIEfgrenagiI=; b=lH7tkfkPmeQt/y+23MBu+HUvg9lvh0GDo5Bm4o33aqYS0EyC5Ge9qGr2/44m1rTc3kfRoasDLnEVnbvN8iagaVcD2Nwivl/MbzFINaHsVPgVD62skx54IU3IdRL6gp2s; Original-Received: from dslc-082-083-043-255.pools.arcor-ip.net ([82.83.43.255] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UnmNo-0007GO-EI; Sat, 15 Jun 2013 11:02:53 +0200 In-Reply-To: <83li6bvl2i.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 15 Jun 2013 11:23:49 +0300") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:75147 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> >> I can't really reproduce the line-move error either in this mode. It >> >> does show up occasionally but I haven't figured out how to >> >> explicitly trigger it thus far. >> > >> > I'll try reproducing it here. >> >> I also tried the patch on current trunk. I use the following snippet to >> generate a buffer containing large and small images as well as text: > > Thanks. Unfortunately, using Emacs with Imagemagick support is a > no-starter for me. It's only needed for scaling, though. If you have at least libjpeg, then just download those two images http://randomsample.de/bigimage.jpg http://randomsample.de/smallimage.jpg and use (with-current-buffer (get-buffer-create "test") (erase-buffer) (let ((imagelarge (create-image "~/bigimage.jpg")) (imagesmall (create-image "~/smallimage.jpg"))) (dotimes (i 20) (insert "\n*** " (number-to-string i)" ***\nThis is a line of text.\nAnd here's a large image:\n") (insert-image imagelarge) (insert "\nAnd a small image:\n") (insert-image imagesmall)) (goto-char (point-min)))) >However, I tried to cover every possibility of using non-numeric values >in numeric context. Please try the patch below (it's relative to the >current trunk, not to the previous patch), and see if it gives good >results. If you still get errors, please manually load simple.el (not >simple.elc) into your Emacs, run your test snippet, and see if the >backtrace can pinpoint the place where I missed something. It fails in line 4789 because 'py' is nil. I attached the backtrace. -David --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=backtrace.txt Content-Transfer-Encoding: quoted-printable Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) =3D(nil 4) (and vpos (> vpos 0) (=3D py (min (- (window-text-height) scroll-margin 1= ) (1- vpos)))) (cond ((and (or (< (setq vs (window-vscroll nil t)) fch) (null this-heigh= t) (<=3D this-height fch)) (or (null rbot) (=3D rbot 0))) nil) ((and (or (n= ull this-height) (<=3D this-height fch)) vpos (> vpos 0) (< (setq py (or (n= th 1 this-lh) (let (...) (cdr ...)))) (min (- (window-text-height) scroll-m= argin 1) (1- vpos)))) nil) ((> vs 0) (if (or (and rbot (> rbot 0)) (and thi= s-height (> this-height fch))) (progn (set-window-vscroll nil (+ vs fch) t)= ))) ((and vpos (> vpos 0) (=3D py (min (- (window-text-height) scroll-margi= n 1) (1- vpos)))) (set-window-vscroll nil (frame-char-height) t) (line-move= -1 arg noerror to-end) t) ((and vpos (> vpos 0)) (scroll-up 1) t) (t (set-w= indow-vscroll nil (frame-char-height) t))) (progn (if lh nil (let ((wend (pos-visible-in-window-p t nil t))) (setq r= bot (nth 3 wend) vpos (nth 5 wend)))) (if this-lh nil (let ((wstart (pos-vi= sible-in-window-p nil nil t))) (setq this-ypos (nth 2 wstart) this-height (= nth 4 wstart)))) (cond ((and (or (< (setq vs (window-vscroll nil t)) fch) (= null this-height) (<=3D this-height fch)) (or (null rbot) (=3D rbot 0))) ni= l) ((and (or (null this-height) (<=3D this-height fch)) vpos (> vpos 0) (< = (setq py (or (nth 1 this-lh) (let ... ...))) (min (- (window-text-height) s= croll-margin 1) (1- vpos)))) nil) ((> vs 0) (if (or (and rbot (> rbot 0)) (= and this-height (> this-height fch))) (progn (set-window-vscroll nil (+ vs = fch) t)))) ((and vpos (> vpos 0) (=3D py (min (- (window-text-height) scrol= l-margin 1) (1- vpos)))) (set-window-vscroll nil (frame-char-height) t) (li= ne-move-1 arg noerror to-end) t) ((and vpos (> vpos 0)) (scroll-up 1) t) (t= (set-window-vscroll nil (frame-char-height) t)))) (if (or (null lh) (>=3D rbot fch) (<=3D ypos (- fch)) (null this-lh) (<= =3D this-ypos (- fch))) (progn (if lh nil (let ((wend (pos-visible-in-windo= w-p t nil t))) (setq rbot (nth 3 wend) vpos (nth 5 wend)))) (if this-lh nil= (let ((wstart (pos-visible-in-window-p nil nil t))) (setq this-ypos (nth 2= wstart) this-height (nth 4 wstart)))) (cond ((and (or (< (setq vs ...) fch= ) (null this-height) (<=3D this-height fch)) (or (null rbot) (=3D rbot 0)))= nil) ((and (or (null this-height) (<=3D this-height fch)) vpos (> vpos 0) = (< (setq py (or ... ...)) (min (- ... scroll-margin 1) (1- vpos)))) nil) ((= > vs 0) (if (or (and rbot (> rbot 0)) (and this-height (> this-height fch))= ) (progn (set-window-vscroll nil (+ vs fch) t)))) ((and vpos (> vpos 0) (= =3D py (min (- ... scroll-margin 1) (1- vpos)))) (set-window-vscroll nil (f= rame-char-height) t) (line-move-1 arg noerror to-end) t) ((and vpos (> vpos= 0)) (scroll-up 1) t) (t (set-window-vscroll nil (frame-char-height) t))))) (let* ((lh (window-line-height -1)) (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) (if (or (nu= ll lh) (>=3D rbot fch) (<=3D ypos (- fch)) (null this-lh) (<=3D this-ypos (= - fch))) (progn (if lh nil (let ((wend (pos-visible-in-window-p t nil t))) = (setq rbot (nth 3 wend) vpos (nth 5 wend)))) (if this-lh nil (let ((wstart = (pos-visible-in-window-p nil nil t))) (setq this-ypos (nth 2 wstart) this-h= eight (nth 4 wstart)))) (cond ((and (or (< ... fch) (null this-height) (<= =3D this-height fch)) (or (null rbot) (=3D rbot 0))) nil) ((and (or (null t= his-height) (<=3D this-height fch)) vpos (> vpos 0) (< (setq py ...) (min .= .. ...))) nil) ((> vs 0) (if (or (and rbot ...) (and this-height ...)) (pro= gn (set-window-vscroll nil ... t)))) ((and vpos (> vpos 0) (=3D py (min ...= ...))) (set-window-vscroll nil (frame-char-height) t) (line-move-1 arg noe= rror to-end) t) ((and vpos (> vpos 0)) (scroll-up 1) t) (t (set-window-vscr= oll nil (frame-char-height) t)))))) (if (< arg 0) (let ((vs (window-vscroll nil t))) (if (> vs (frame-char-he= ight)) (progn (set-window-vscroll nil (- vs (frame-char-height)) t)))) (let= * ((lh (window-line-height -1)) (vpos (nth 1 lh)) (ypos (nth 2 lh)) (rbot (= nth 3 lh)) (this-lh (window-line-height)) (this-height (nth 0 this-lh)) (th= is-ypos (nth 2 this-lh)) (fch (frame-char-height)) py vs) (if (or (null lh)= (>=3D rbot fch) (<=3D ypos (- fch)) (null this-lh) (<=3D this-ypos (- fch)= )) (progn (if lh nil (let ((wend ...)) (setq rbot (nth 3 wend) vpos (nth 5 = wend)))) (if this-lh nil (let ((wstart ...)) (setq this-ypos (nth 2 wstart)= this-height (nth 4 wstart)))) (cond ((and (or ... ... ...) (or ... ...)) n= il) ((and (or ... ...) vpos (> vpos 0) (< ... ...)) nil) ((> vs 0) (if (or = ... ...) (progn ...))) ((and vpos (> vpos 0) (=3D py ...)) (set-window-vscr= oll nil (frame-char-height) t) (line-move-1 arg noerror to-end) t) ((and vp= os (> vpos 0)) (scroll-up 1) t) (t (set-window-vscroll nil (frame-char-heig= ht) t))))))) line-move-partial(1 nil nil) (and auto-window-vscroll try-vscroll (=3D (abs arg) 1) (zerop scroll-cons= ervatively) (not defining-kbd-macro) (not executing-kbd-macro) (line-move-p= artial arg noerror to-end)) (if (and auto-window-vscroll try-vscroll (=3D (abs arg) 1) (zerop scroll-= conservatively) (not defining-kbd-macro) (not executing-kbd-macro) (line-mo= ve-partial arg noerror to-end)) nil (set-window-vscroll nil 0 t) (if (and l= ine-move-visual (not goal-column) (not (> (window-hscroll) 0))) (prog1 (lin= e-move-visual arg noerror) (let ((lh (line-pixel-height))) (if (and (< arg = 0) (< (point) (window-start)) (> lh (frame-char-height))) (set-window-vscro= ll nil (- lh (frame-char-height)) t)))) (line-move-1 arg noerror to-end))) (if noninteractive (forward-line arg) (if (and auto-window-vscroll try-vs= croll (=3D (abs arg) 1) (zerop scroll-conservatively) (not defining-kbd-mac= ro) (not executing-kbd-macro) (line-move-partial arg noerror to-end)) nil (= set-window-vscroll nil 0 t) (if (and line-move-visual (not goal-column) (no= t (> (window-hscroll) 0))) (prog1 (line-move-visual arg noerror) (let ((lh = (line-pixel-height))) (if (and (< arg 0) (< ... ...) (> lh ...)) (set-windo= w-vscroll nil (- lh ...) t)))) (line-move-1 arg noerror to-end)))) line-move(1 nil nil 1) (condition-case err (line-move arg nil nil try-vscroll) ((beginning-of-bu= ffer end-of-buffer) (signal (car err) (cdr err)))) (if (called-interactively-p (quote interactive)) (condition-case err (lin= e-move arg nil nil try-vscroll) ((beginning-of-buffer end-of-buffer) (signa= l (car err) (cdr err)))) (line-move arg nil nil try-vscroll)) (if (and next-line-add-newlines (=3D arg 1)) (if (save-excursion (end-of-= line) (eobp)) (let ((abbrev-mode nil)) (end-of-line) (insert (if use-hard-n= ewlines hard-newline "\n"))) (line-move arg nil nil try-vscroll)) (if (call= ed-interactively-p (quote interactive)) (condition-case err (line-move arg = nil nil try-vscroll) ((beginning-of-buffer end-of-buffer) (signal (car err)= (cdr err)))) (line-move arg nil nil try-vscroll))) next-line(1 1) call-interactively(next-line nil nil) (prog1 (call-interactively cmd record-flag keys) (if (and (symbolp cmd) (= get cmd (quote byte-obsolete-info)) (not (get cmd (quote command-execute-ob= solete-warned)))) (progn (put cmd (quote command-execute-obsolete-warned) t= ) (message "%s" (macroexp--obsolete-warning cmd (get cmd (quote byte-obsole= te-info)) "command"))))) (cond ((arrayp final) (if record-flag (progn (setq command-history (cons = (list (quote execute-kbd-macro) final prefixarg) command-history)) (if (and= (numberp history-length) (> history-length 0)) (progn (let (...) (if ... .= ..)))))) (execute-kbd-macro final prefixarg)) (t (prog1 (call-interactively= cmd record-flag keys) (if (and (symbolp cmd) (get cmd (quote byte-obsolete= -info)) (not (get cmd (quote command-execute-obsolete-warned)))) (progn (pu= t cmd (quote command-execute-obsolete-warned) t) (message "%s" (macroexp--o= bsolete-warning cmd (get cmd ...) "command"))))))) (let ((final cmd)) (while (progn (setq final (indirect-function final)) (= if (autoloadp final) (setq final (autoload-do-load final cmd))))) (cond ((a= rrayp final) (if record-flag (progn (setq command-history (cons (list ... f= inal prefixarg) command-history)) (if (and (numberp history-length) (> hist= ory-length 0)) (progn (let ... ...))))) (execute-kbd-macro final prefixarg)= ) (t (prog1 (call-interactively cmd record-flag keys) (if (and (symbolp cmd= ) (get cmd (quote byte-obsolete-info)) (not (get cmd ...))) (progn (put cmd= (quote command-execute-obsolete-warned) t) (message "%s" (macroexp--obsole= te-warning cmd ... "command")))))))) (let ((prefixarg (if special nil (prog1 prefix-arg (setq current-prefix-a= rg prefix-arg) (setq prefix-arg nil))))) (and (symbolp cmd) (get cmd (quote= disabled)) (run-hooks (quote disabled-command-function))) (let ((final cmd= )) (while (progn (setq final (indirect-function final)) (if (autoloadp fina= l) (setq final (autoload-do-load final cmd))))) (cond ((arrayp final) (if r= ecord-flag (progn (setq command-history (cons ... command-history)) (if (an= d ... ...) (progn ...)))) (execute-kbd-macro final prefixarg)) (t (prog1 (c= all-interactively cmd record-flag keys) (if (and (symbolp cmd) (get cmd ...= ) (not ...)) (progn (put cmd ... t) (message "%s" ...)))))))) command-execute(next-line) --=-=-=--