From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Several suggestions for image support Date: 21 Apr 2004 02:53:27 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87zn98ybzl.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082502319 29161 80.91.224.253 (20 Apr 2004 23:05:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Apr 2004 23:05:19 +0000 (UTC) Cc: David Kastrup , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Apr 21 01:05:09 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BG4If-0006mB-00 for ; Wed, 21 Apr 2004 01:05:09 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BG4If-00080G-00 for ; Wed, 21 Apr 2004 01:05:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BG4EX-0004Kw-M7 for emacs-devel@quimby.gnus.org; Tue, 20 Apr 2004 19:00:53 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BG4Ba-0003H6-DX for emacs-devel@gnu.org; Tue, 20 Apr 2004 18:57:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BG49W-0001uX-Aj for emacs-devel@gnu.org; Tue, 20 Apr 2004 18:56:13 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BG47g-0001AM-PI; Tue, 20 Apr 2004 18:53:48 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id 72A5A2628A9; Wed, 21 Apr 2004 00:53:47 +0200 (CEST) Original-To: Stefan Monnier In-Reply-To: <87zn98ybzl.fsf-monnier+emacs@gnu.org> Original-Lines: 45 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21965 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21965 Stefan Monnier writes: > >> Of course, scrolling through large images should be possible, anyway, > >> and quite independent from that fanciful features. Emacs already has > >> set-window-vscroll in its display engine in order to deal perfectly > >> well with that. > > Yes, and it could probably be done entirely in lisp !? > > I already suggested to use two new primitives (that have incidentally > been requested for other purpose): > > point-to-pixel > and > pixel-to-point > > which turn a (displayed) buffer position into a display position and vice > versa. All the rest should then be reasonably easy to do in Elisp. I just installed changes to implement posn-at-point and posn-at-x-y. I also fixed a recent bug that practically disabled vscrolling. However, there is still one important limitation to when vscroll actually works: - If image at top row of screen is fully visible and cursor is in top row, vscroll is reset. This is because making the cursor row fully visible takes precedence over vscroll. My new fix ensures that if the top line contains an image which is taller than the window height, vscroll is allowed even when the cursor is in that line. So if someone would like to enhance line-move and scrolling to deal with "tall" images, please do it. I have also added an enhancement to pos-visible-in-window-p to return pixel coordinates and partial visibility status of the row at the given position if PARTIALLY arg is non-nil. E.g. if (nth 2 (pos-visible-in-window-p (window-start))) is non-nil, the first line is only partially visible, so vscrolling may be considered. -- Kim F. Storm http://www.cua.dk