* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
[not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
@ 2008-10-03 5:46 ` Livin Stephen
2008-10-03 6:42 ` zoltan
2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
2008-10-10 21:49 ` Joe Casadonte
2 siblings, 1 reply; 13+ messages in thread
From: Livin Stephen @ 2008-10-03 5:46 UTC (permalink / raw)
To: help-gnu-emacs
On Oct 3, 3:11 am, "David Lam" <david.k.l...@gmail.com> wrote:
>...
> i saw this...http://www.wlindley.com/gnu/vi and in the first two rows
> theres no listed equivalent
> ...
David,
C-v is how you scroll one-page-at-a-time, so with numerical arguments
( "C-u 1" [ or "Cu -1" ] ),
here is how I would do it:
C-u 1 C-v for "up", and
C-u -1 C-v for "down" .
I don't know *any* lisp,
so if I found myself wanting to do this a lot,
I would probably create a macro and setup a key-binding.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
2008-10-03 5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
@ 2008-10-03 6:42 ` zoltan
2008-10-03 14:20 ` How do you scroll the screen without moving the cursor ? (theC-E " Parker, Matthew
0 siblings, 1 reply; 13+ messages in thread
From: zoltan @ 2008-10-03 6:42 UTC (permalink / raw)
To: help-gnu-emacs
On Oct 3, 7:46 am, Livin Stephen <livin.step...@gmail.com> wrote:
> On Oct 3, 3:11 am, "David Lam" <david.k.l...@gmail.com> wrote:
>
> >...
> > i saw this...http://www.wlindley.com/gnu/vi and in the first two rows
> > theres no listed equivalent
> > ...
>
> David,
> C-v is how you scroll one-page-at-a-time, so with numerical arguments
> ( "C-u 1" [ or "Cu -1" ] ),
> here is how I would do it:
>
> C-u 1 C-v for "up", and
> C-u -1 C-v for "down" .
>
> I don't know *any* lisp,
> so if I found myself wanting to do this a lot,
> I would probably create a macro and setup a key-binding.
You can also use M-v to scroll up.
And C-M-v to scroll down the next buffer
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
2008-10-03 6:42 ` zoltan
@ 2008-10-03 14:20 ` Parker, Matthew
0 siblings, 0 replies; 13+ messages in thread
From: Parker, Matthew @ 2008-10-03 14:20 UTC (permalink / raw)
To: zoltan, help-gnu-emacs
This might not be the most elegant... but it works... and I think it is what you have in mind...
Add these to .emacs, and try Control-Alt-n or p
;; Navigation Functions
(defun scroll-up-by-one-line()
"scroll ahead one line at a time"
(interactive)
(scroll-up 1))
(defun scroll-down-by-one-line()
"scroll ahead one line at a time"
(interactive)
(scroll-down 1))
;; key bindings
(global-set-key "\C-\M-n" 'scroll-up-by-one-line)
(global-set-key "\C-\M-p" 'scroll-down-by-one-line)
Matthew Parker
SEI | 1 Freedom Valley Drive | Oaks, PA 19456 | p: 610-676-1279 | f: 484-676-1279 | www.seic.com
-----Original Message-----
From: help-gnu-emacs-bounces+mparker=seic.com@gnu.org [mailto:help-gnu-emacs-bounces+mparker=seic.com@gnu.org] On Behalf Of zoltan
Sent: Friday, October 03, 2008 2:43 AM
To: help-gnu-emacs@gnu.org
Subject: Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
On Oct 3, 7:46 am, Livin Stephen <livin.step...@gmail.com> wrote:
> On Oct 3, 3:11 am, "David Lam" <david.k.l...@gmail.com> wrote:
>
> >...
> > i saw this...http://www.wlindley.com/gnu/vi and in the first two rows
> > theres no listed equivalent
> > ...
>
> David,
> C-v is how you scroll one-page-at-a-time, so with numerical arguments
> ( "C-u 1" [ or "Cu -1" ] ),
> here is how I would do it:
>
> C-u 1 C-v for "up", and
> C-u -1 C-v for "down" .
>
> I don't know *any* lisp,
> so if I found myself wanting to do this a lot,
> I would probably create a macro and setup a key-binding.
You can also use M-v to scroll up.
And C-M-v to scroll down the next buffer
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
[not found] <mailman.142.1223043676.25473.help-gnu-emacs@gnu.org>
@ 2008-10-03 15:31 ` Chris McMahan
2008-10-03 16:09 ` Paul R
[not found] ` <mailman.153.1223050175.25473.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 13+ messages in thread
From: Chris McMahan @ 2008-10-03 15:31 UTC (permalink / raw)
To: help-gnu-emacs
If that's not what you have in mind, I've been using these for some
time. They keep the cursor in place and move the text underneath it.
(defun scroll-down-in-place (n)
(interactive "p")
(previous-line n)
(scroll-down n))
(defun scroll-up-in-place (n)
(interactive "p")
(next-line n)
(scroll-up n))
(global-set-key "\M-n" 'scroll-up-in-place)
(global-set-key "\M-p" 'scroll-down-in-place)
- Chris
"Parker, Matthew" <MParker@seic.com> writes:
> This might not be the most elegant... but it works... and I think it is what you have in mind...
>
> Add these to .emacs, and try Control-Alt-n or p
>
> ;; Navigation Functions
> (defun scroll-up-by-one-line()
> "scroll ahead one line at a time"
> (interactive)
> (scroll-up 1))
>
>
> (defun scroll-down-by-one-line()
> "scroll ahead one line at a time"
> (interactive)
> (scroll-down 1))
>
> ;; key bindings
>
> (global-set-key "\C-\M-n" 'scroll-up-by-one-line)
> (global-set-key "\C-\M-p" 'scroll-down-by-one-line)
>
>
> Matthew Parker
>
> SEI | 1 Freedom Valley Drive | Oaks, PA 19456 | p: 610-676-1279 | f: 484-676-1279 | www.seic.com
>
> -----Original Message-----
> From: help-gnu-emacs-bounces+mparker=seic.com@gnu.org [mailto:help-gnu-emacs-bounces+mparker=seic.com@gnu.org] On Behalf Of zoltan
> Sent: Friday, October 03, 2008 2:43 AM
> To: help-gnu-emacs@gnu.org
> Subject: Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
>
> On Oct 3, 7:46 am, Livin Stephen <livin.step...@gmail.com> wrote:
>> On Oct 3, 3:11 am, "David Lam" <david.k.l...@gmail.com> wrote:
>>
>> >...
>> > i saw this...http://www.wlindley.com/gnu/vi and in the first two rows
>> > theres no listed equivalent
>> > ...
>>
>> David,
>> C-v is how you scroll one-page-at-a-time, so with numerical arguments
>> ( "C-u 1" [ or "Cu -1" ] ),
>> here is how I would do it:
>>
>> C-u 1 C-v for "up", and
>> C-u -1 C-v for "down" .
>>
>> I don't know *any* lisp,
>> so if I found myself wanting to do this a lot,
>> I would probably create a macro and setup a key-binding.
>
> You can also use M-v to scroll up.
> And C-M-v to scroll down the next buffer
>
>
--
(. .)
=ooO=(_)=Ooo=====================================
Chris McMahan | first_initiallastname@one.dot.net
=================================================
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
2008-10-03 15:31 ` How do you scroll the screen without moving the cursor ? (theC-E " Chris McMahan
@ 2008-10-03 16:09 ` Paul R
[not found] ` <mailman.153.1223050175.25473.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 13+ messages in thread
From: Paul R @ 2008-10-03 16:09 UTC (permalink / raw)
To: help-gnu-emacs
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))))
--
Paul
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
[not found] ` <mailman.153.1223050175.25473.help-gnu-emacs@gnu.org>
@ 2008-10-03 20:07 ` Chris McMahan
2008-10-04 0:57 ` David Lam
2008-10-04 9:03 ` Paul R
2008-10-04 21:24 ` Livin Stephen
1 sibling, 2 replies; 13+ messages in thread
From: Chris McMahan @ 2008-10-03 20:07 UTC (permalink / raw)
To: help-gnu-emacs
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
=================================================
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
2008-10-03 20:07 ` Chris McMahan
@ 2008-10-04 0:57 ` David Lam
2008-10-04 9:03 ` Paul R
1 sibling, 0 replies; 13+ messages in thread
From: David Lam @ 2008-10-04 0:57 UTC (permalink / raw)
To: Chris McMahan; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]
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
> =================================================
>
[-- Attachment #2: Type: text/html, Size: 3087 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
2008-10-03 20:07 ` Chris McMahan
2008-10-04 0:57 ` David Lam
@ 2008-10-04 9:03 ` Paul R
1 sibling, 0 replies; 13+ messages in thread
From: Paul R @ 2008-10-04 9:03 UTC (permalink / raw)
To: Chris McMahan; +Cc: help-gnu-emacs
On Fri, 03 Oct 2008 16:07:24 -0400, Chris McMahan <first_initiallastname@one.dot.net> said:
Chris> BTW, where can I get info on the key syntax you're using?
Chris> [down] and [up]...
In emacs documentation, look for "key bindings".
Also, if you want an in-depth review of emacs-all-flavour-all-versions
key bindings syntax, read this good ressource :
http://tiny-tools.sourceforge.net/emacs-keys.html
--
Paul
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
[not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
2008-10-03 5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
@ 2008-10-04 21:11 ` Rodolfo Medina
2008-10-04 22:58 ` Rupert Swarbrick
2008-10-10 21:49 ` Joe Casadonte
2 siblings, 1 reply; 13+ messages in thread
From: Rodolfo Medina @ 2008-10-04 21:11 UTC (permalink / raw)
To: help-gnu-emacs
...how do you scroll the screen without moving point, also in the sense that
you do, say, five times C-v and then five times M-v and find the cursor in the
*same* place as it was before the first C-v...?
I found two packages that do that: pager.el and scroll-in-place.el, but the
side unwished effect is that the `next-screen-context-lines' stops working
properly in TeX and info buffers: you don't have any more the two default lines
of continuity when scrolling by screenfuls, but less, and variable.
Anyone met the same problem?
Rodolfo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
[not found] ` <mailman.153.1223050175.25473.help-gnu-emacs@gnu.org>
2008-10-03 20:07 ` Chris McMahan
@ 2008-10-04 21:24 ` Livin Stephen
1 sibling, 0 replies; 13+ messages in thread
From: Livin Stephen @ 2008-10-04 21:24 UTC (permalink / raw)
To: help-gnu-emacs
On Oct 3, 9:09 pm, Paul R <paul.r...@gmail.com> wrote:
> 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))))
>
> --
> Paul
The initial request from David Lam was for scrolling-in-place such
that
the cursor remained "in place" with respect to the text - not with
respect to the frame/window.
In VI, C-e (C-y is the counterpart),
1. scrolls the page up by line, AND
2. moves the up cursor ALSO by one line - so that it stays at the same
character at which it was originally.
In the lisp examples (thanks for them!), I commented out "(previous-
line 1)" and "(next-line 1)" to achieve this.
I *do* also like what your original lisp samples do.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
@ 2008-10-04 22:58 ` Rupert Swarbrick
2008-10-05 10:48 ` Rodolfo Medina
0 siblings, 1 reply; 13+ messages in thread
From: Rupert Swarbrick @ 2008-10-04 22:58 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 771 bytes --]
Rodolfo Medina <rodolfo.medina@gmail.com> writes:
> ...how do you scroll the screen without moving point, also in the
> sense that you do, say, five times C-v and then five times M-v and
> find the cursor in the *same* place as it was before the first C-v...?
>
I'm afraid I don't actually know the answer to this question (although
I'm sure there will be one). I was also slightly suprised when reading
it that this had never irritated me.
But then I realised what I do: Before starting to scroll, I hit C-Space
to set a mark. Then I wander round the file to my hearts content, not
even necessarily returning to where I started before hitting C-u C-Space
and being back and with point "unmoved".
Maybe this is a useful different way of solving your problem.
Rupert
[-- Attachment #2: Type: application/pgp-signature, Size: 314 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
2008-10-04 22:58 ` Rupert Swarbrick
@ 2008-10-05 10:48 ` Rodolfo Medina
0 siblings, 0 replies; 13+ messages in thread
From: Rodolfo Medina @ 2008-10-05 10:48 UTC (permalink / raw)
To: help-gnu-emacs
Rodolfo Medina <rodolfo.medina@gmail.com> writes:
> ...how do you scroll the screen without moving point, also in the sense that
> you do, say, five times C-v and then five times M-v and find the cursor in the
> *same* place as it was before the first C-v...?
>
> I found two packages that do that: pager.el and scroll-in-place.el, but the
> side unwished effect is that the `next-screen-context-lines' stops working
> properly in TeX and info buffers: you don't have any more the two default
> lines of continuity when scrolling by screenfuls, but less, and variable.
>
> Anyone met the same problem?
Rupert Swarbrick <rswarbrick@gmail.com> writes:
> I'm afraid I don't actually know the answer to this question (although
> I'm sure there will be one). I was also slightly suprised when reading
> it that this had never irritated me.
>
> But then I realised what I do: Before starting to scroll, I hit C-Space
> to set a mark. Then I wander round the file to my hearts content, not
> even necessarily returning to where I started before hitting C-u C-Space
> and being back and with point "unmoved".
>
> Maybe this is a useful different way of solving your problem.
Hey, that's great! Thanks
Rodolfo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi)
[not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
2008-10-03 5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
@ 2008-10-10 21:49 ` Joe Casadonte
2 siblings, 0 replies; 13+ messages in thread
From: Joe Casadonte @ 2008-10-10 21:49 UTC (permalink / raw)
To: help-gnu-emacs
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-<down>") 'scroll-up-in-place)
(global-set-key (read-kbd-macro "M-<up>") '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!
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-10-10 21:49 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.108.1223009092.25473.help-gnu-emacs@gnu.org>
2008-10-03 5:46 ` How do you scroll the screen without moving the cursor ? (the C-E and C-Y keys in vi) Livin Stephen
2008-10-03 6:42 ` zoltan
2008-10-03 14:20 ` How do you scroll the screen without moving the cursor ? (theC-E " Parker, Matthew
2008-10-04 21:11 ` How do you scroll the screen without moving the cursor ? (the C-E " Rodolfo Medina
2008-10-04 22:58 ` Rupert Swarbrick
2008-10-05 10:48 ` Rodolfo Medina
2008-10-10 21:49 ` Joe Casadonte
[not found] <mailman.142.1223043676.25473.help-gnu-emacs@gnu.org>
2008-10-03 15:31 ` How do you scroll the screen without moving the cursor ? (theC-E " Chris McMahan
2008-10-03 16:09 ` Paul R
[not found] ` <mailman.153.1223050175.25473.help-gnu-emacs@gnu.org>
2008-10-03 20:07 ` Chris McMahan
2008-10-04 0:57 ` David Lam
2008-10-04 9:03 ` Paul R
2008-10-04 21:24 ` Livin Stephen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).