From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Joe Casadonte" Newsgroups: gmane.emacs.help Subject: Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Date: Fri, 10 Oct 2008 17:49:56 -0400 Organization: Llama Fresh Farms, Neare Paraguay Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1223678448 17902 80.91.229.12 (10 Oct 2008 22:40:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Oct 2008 22:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 11 00:41:45 2008 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.50) id 1KoQg2-0006zH-HA for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Oct 2008 00:41:42 +0200 Original-Received: from localhost ([127.0.0.1]:38245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KoQey-0003Qg-Ah for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Oct 2008 18:40:36 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 10 Oct 2008 16:50:03 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:0F0C90BWAOnAuXcwFXOEcCwl2HU= Original-Lines: 53 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 66.92.238.209 Original-X-Trace: sv3-SaH4ZuLiITRkWC7EmbYaXF5WVAzJK0aIKbq1wuGtgNzsTI+arNEqPOXBuu8dkAd5E1EaZhDE0QDzuE+!OLWDe3ltQoaBKytPQXnW/3MsrGHCSmgjV9JM0rCRjX/cMwIHkmlWgKa4PdDmgbQlMzwvGUaSm7EQ!GAH09XjLXtBskY++iwMWW6gaddVY9g== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Original-Xref: news.stanford.edu gnu.emacs.help:163340 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:58682 Archived-At: I wrote these years ago; maybe they will help? (defun scroll-in-place (scroll-up) "Scroll window up (or down) without moving point (if possible). SCROLL-Up is non-nil to scroll up one line, nil to scroll down." (interactive) (let ((pos (point)) (col (current-column)) (up-or-down (if scroll-up 1 -1))) (scroll-up up-or-down) (if (pos-visible-in-window-p pos) (goto-char pos) (if (or (eq last-command 'next-line) (eq last-command 'previous-line)) (move-to-column temporary-goal-column) (move-to-column col) (setq temporary-goal-column col)) (setq this-command 'next-line)))) ;;;; ------------------------------------------------------------------------ (defun scroll-up-in-place () "Scroll window up without moving point (if possible)." (interactive) (scroll-in-place t)) ;;;; ------------------------------------------------------------------------ (defun scroll-down-in-place () "Scroll window up without moving point (if possible)." (interactive) (scroll-in-place nil)) (global-set-key (read-kbd-macro "M-") 'scroll-up-in-place) (global-set-key (read-kbd-macro "M-") 'scroll-down-in-place) -- Regards, joe Joe Casadonte jcasadonte@northbound-train.com ------------------------------------------------------------------------------ Llama Fresh Farms => http://www.northbound-train.com Ramblings of a Gay Man => http://www.northbound-train.com/ramblings Emacs Stuff => http://www.northbound-train.com/emacs.html Music CD Trading => http://www.northbound-train.com/cdr.html ------------------------------------------------------------------------------ Live Free, that's the message! ------------------------------------------------------------------------------