From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "David Lam" Newsgroups: gmane.emacs.help Subject: Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi) Date: Fri, 3 Oct 2008 17:57:57 -0700 Message-ID: <4f6ab4670810031757w683ee1ffne5ed4879484ae98a@mail.gmail.com> References: <7sod21hf0r.fsf@one.dot.net> <7sk5cph283.fsf@one.dot.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16291_5709288.1223081877876" X-Trace: ger.gmane.org 1223081917 16759 80.91.229.12 (4 Oct 2008 00:58:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Oct 2008 00:58:37 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Chris McMahan" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 04 02:59:34 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 1KlvUX-0006Dm-Ri for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Oct 2008 02:59:30 +0200 Original-Received: from localhost ([127.0.0.1]:47580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlvTU-0002Qh-PW for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Oct 2008 20:58:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KlvT8-0002QK-Mn for help-gnu-emacs@gnu.org; Fri, 03 Oct 2008 20:58:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KlvT7-0002Q8-9i for help-gnu-emacs@gnu.org; Fri, 03 Oct 2008 20:58:01 -0400 Original-Received: from [199.232.76.173] (port=53971 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlvT7-0002Q5-4i for help-gnu-emacs@gnu.org; Fri, 03 Oct 2008 20:58:01 -0400 Original-Received: from fg-out-1718.google.com ([72.14.220.159]:32368) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KlvT6-0006xk-G5 for help-gnu-emacs@gnu.org; Fri, 03 Oct 2008 20:58:00 -0400 Original-Received: by fg-out-1718.google.com with SMTP id l26so1356221fgb.30 for ; Fri, 03 Oct 2008 17:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=U+SOFjLA6nR4dLVRk+o5QWydINJYReDU/Kl1LwGorzY=; b=xSodw8hK1YiaGexORUwLanR5tIRrMW4+6mVQQjFq5s0ou2D5GBHUvrpAJE6cRlHhBp dKIcwxsACclPligubyYTjoePov4Zen3ufUAK/lU08K+P8oPBTq4IhyXiJXsxjCeO22F+ zcvz4fntOS2EQEECfPU+ZrpDvrgbcd4eL1qDQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=oNTS3GRoU33j08OHDevIqABsuTgsa4dW26qYtm2nGDpmHT7r0xZuzewscym0BPi8W1 TlwL+Q03wGnKVo8rtorI+GLWdegPwXAlsRmPcs5dKntmtBR9o+WvdLCIY8iUxuHHIwKd s62drJ9vxZz2y+3NxDzCkPJL5Bdvqgw3mtNgM= Original-Received: by 10.187.224.14 with SMTP id b14mr590442far.4.1223081877879; Fri, 03 Oct 2008 17:57:57 -0700 (PDT) Original-Received: by 10.187.252.3 with HTTP; Fri, 3 Oct 2008 17:57:57 -0700 (PDT) In-Reply-To: <7sk5cph283.fsf@one.dot.net> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:58346 Archived-At: ------=_Part_16291_5709288.1223081877876 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline aww cool thanks... i just tried the stuffs this is what i ended up with -> ;; ^E in Vi (defun ctrl-e-in-vi (n) (interactive "p") (scroll-down n)) ;; ^Y in Vi (defun ctrl-y-in-vi (n) (interactive "p") (scroll-up n)) (global-set-key "\M-n" 'ctrl-y-in-vi) (global-set-key "\M-p" 'ctrl-e-in-vi) On Fri, Oct 3, 2008 at 1:07 PM, Chris McMahan < first_initiallastname@one.dot.net> wrote: > Paul R writes: > > > Chris> If that's not what you have in mind, I've been using these for > > Chris> some time. They keep the cursor in place and move the text > > Chris> underneath it. > > > > Chris> (defun scroll-down-in-place (n) (interactive "p") > > Chris> (previous-line n) (scroll-down n)) > > > > Chris> (defun scroll-up-in-place (n) (interactive "p") (next-line n) > > Chris> (scroll-up n)) > > > > To avoid weird behaviour when seeing ends of your buffer, use the code > > below. > > > > (global-set-key [down] (lambda () > > (interactive) > > (next-line 1) > > (unless (eq (window-end) (point-max)) > > (scroll-up 1)))) > > (global-set-key [up] (lambda () > > (interactive) > > (previous-line 1) > > (unless (eq (window-start) (point-min)) > > (scroll-down 1)))) > > Excellent! Thank you! > > BTW, where can I get info on the key syntax you're using? [down] and > [up]... > > - Chris > > -- > (. .) > =ooO=(_)=Ooo===================================== > Chris McMahan | first_initiallastname@one.dot.net > ================================================= > ------=_Part_16291_5709288.1223081877876 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
aww cool thanks... i just tried the stuffs

this is what i ended up with ->

;; ^E in Vi
(defun ctrl-e-in-vi (n)
 (interactive "p")
 (scroll-down n))

;; ^Y in Vi
(defun ctrl-y-in-vi (n)
 (interactive "p")
 (scroll-up n))

(global-set-key "\M-n" 'ctrl-y-in-vi)
(global-set-key "\M-p" 'ctrl-e-in-vi)






On Fri, Oct 3, 2008 at 1:07 PM, Chris McMahan <first_initiallastname@one.dot.net> wrote:
Paul R <paul.r.ml@gmail.com> writes:

> Chris> If that's not what you have in mind, I've been using these for
> Chris> some time. They keep the cursor in place and move the text
> Chris> underneath it.
>
> Chris> (defun scroll-down-in-place (n) (interactive "p")
> Chris> (previous-line n) (scroll-down n))
>
> Chris> (defun scroll-up-in-place (n) (interactive "p") (next-line n)
> Chris> (scroll-up n))
>
> To avoid weird behaviour when seeing ends of your buffer, use the code
> below.
>
> (global-set-key [down] (lambda ()
>                        (interactive)
>                        (next-line 1)
>                        (unless (eq (window-end) (point-max))
>                          (scroll-up 1))))
> (global-set-key [up] (lambda ()
>                      (interactive)
>                      (previous-line 1)
>                      (unless (eq (window-start) (point-min))
>                        (scroll-down 1))))

Excellent! Thank you!

BTW, where can I get info on the key syntax you're using? [down] and
[up]...

- Chris

--
    (.   .)
 =ooO=(_)=Ooo=====================================
 Chris McMahan | first_initiallastname@one.dot.net
 =================================================

------=_Part_16291_5709288.1223081877876--