From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.help Subject: Re: Smooth scrolling Date: Thu, 08 Jul 2010 10:51:04 +0200 Message-ID: <878w5me4qv.fsf@arcor.de> References: <4C33DC94.5010002@gmail.com> <4C34D5B7.6010200@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1278579694 12289 80.91.229.12 (8 Jul 2010 09:01:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 8 Jul 2010 09:01:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 08 11:01:33 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OWmz5-0000Ya-MG for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jul 2010 11:01:31 +0200 Original-Received: from localhost ([127.0.0.1]:55569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWmz5-0006os-4x for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jul 2010 05:01:31 -0400 Original-Received: from [140.186.70.92] (port=36745 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWmyC-0006lz-Iy for help-gnu-emacs@gnu.org; Thu, 08 Jul 2010 05:00:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWmpM-0002h7-8S for help-gnu-emacs@gnu.org; Thu, 08 Jul 2010 04:51:29 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:57570) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWmpL-0002ge-TI for help-gnu-emacs@gnu.org; Thu, 08 Jul 2010 04:51:28 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OWmpI-0001Aa-2m for help-gnu-emacs@gnu.org; Thu, 08 Jul 2010 10:51:24 +0200 Original-Received: from 134.76.4.238 ([134.76.4.238]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Jul 2010 10:51:24 +0200 Original-Received: from deng by 134.76.4.238 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Jul 2010 10:51:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 33 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 134.76.4.238 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) Mail-Copies-To: never Cancel-Lock: sha1:RxHLXYBWWMI25yCqrBFsAG2AU88= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74135 Archived-At: Jesse W. Wilson writes: > Perhaps the following could be of use? > http://www.gnu.org/s/emacs/manual/html_node/elisp/Vertical-Scrolling.html > > If I type this in a buffer and eval with c-x c-e, > (set-window-vscroll (selected-window) 0.3) > > It seems to scroll a fraction of a line downward. > > Of course I haven't a clue how it could be incorporated into bindings > for the scroll wheel. Yes, Emacs can do "fractional" (read: pixel-wise) scrolling with the set-window-vscroll command you mentioned above. For example, picture-mode can smooth-scroll an image just fine. However, there are two caveats: it is slow, and the point must remain visible during scrolling. I've fiddled with this stuff a while ago to implement a smoother scrolling for buffers with images in them. See http://www.randomsample.de/dru5/node/25 http://www.randomsample.de/dru5/node/26 for how far I've come. Those functions use set-window-vscroll to scroll the buffer and move point in a way so that it always remains visible. However, you'll notice that the higher the vscroll value of the current window, the slower scrolling becomes, so it's of limited value. Also, it doesn't work well with the other point-moving commands, so it's currently only useful for read-only buffers. Regards, David