unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Quick Emacs Question
@ 2008-05-01 16:12 Paul S
  2008-05-01 22:49 ` Peter Dyballa
  0 siblings, 1 reply; 4+ messages in thread
From: Paul S @ 2008-05-01 16:12 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

Hi there!

When you are in Emacs, and the cursor is at the top of the window, you press
UP and it does a Page Up.

Is there any way to scroll up line-by-line? (IE you press up, ONE line
disappears at the bottom and ONE more line is visible at the top. Rather
than 20 lines at a time). (Useful for when you want to keep looking at two
different things in a C file.)

Thanks!
Paul

[-- Attachment #2: Type: text/html, Size: 406 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Quick Emacs Question
  2008-05-01 16:12 Quick Emacs Question Paul S
@ 2008-05-01 22:49 ` Peter Dyballa
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2008-05-01 22:49 UTC (permalink / raw)
  To: Paul S; +Cc: help-gnu-emacs


Am 01.05.2008 um 18:12 schrieb Paul S:

> Is there any way to scroll up line-by-line?


How are these:

(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))

(From an ancient Sun related ELisp file.)

--
Greetings

   Pete

Windows, c'est un peu comme le beaujolais nouveau: à chaque nouvelle  
cuvée on sait que ce sera dégueulasse, mais on en prend quand même,  
par masochisme.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Quick Emacs Question
       [not found] <mailman.11044.1209680383.18990.help-gnu-emacs@gnu.org>
@ 2008-05-01 23:02 ` Giorgos Keramidas
  2008-05-02  9:43 ` Rupert Swarbrick
  1 sibling, 0 replies; 4+ messages in thread
From: Giorgos Keramidas @ 2008-05-01 23:02 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 1 May 2008 09:12:30 -0700, "Paul S" <paul22000@gmail.com> wrote:
> Hi there!
>
> When you are in Emacs, and the cursor is at the top of the window, you
> press UP and it does a Page Up.
>
> Is there any way to scroll up line-by-line? (IE you press up, ONE line
> disappears at the bottom and ONE more line is visible at the
> top. Rather than 20 lines at a time). (Useful for when you want to
> keep looking at two different things in a C file.)

Hi Paul,

Yes, there is a way to customize scrolling to achieve what you want.

To get the behavior you just described, you can customize or set in your
~/.emacs file `scroll-conservatively' to 1.

Note that the value of `scroll-conservatively' becomes buffer-local when
set, so it can have different values in different modes.  For example if
you want the default to be 1 for all new buffers (the behavior you just
described), but the original Emacs behavior is ok for C code, you can
use the following in your ~/.emacs file to set its value:

    (setq-default scroll-conservatively 1)
    (add-hook c-mode-common-hook
      '(lambda ()
         (setq scroll-conservatively 0)))



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Quick Emacs Question
       [not found] <mailman.11044.1209680383.18990.help-gnu-emacs@gnu.org>
  2008-05-01 23:02 ` Giorgos Keramidas
@ 2008-05-02  9:43 ` Rupert Swarbrick
  1 sibling, 0 replies; 4+ messages in thread
From: Rupert Swarbrick @ 2008-05-02  9:43 UTC (permalink / raw)
  To: help-gnu-emacs

"Paul S" <paul22000@gmail.com> writes:

> Hi there!
>
> When you are in Emacs, and the cursor is at the top of the window, you press UP
> and it does a Page Up.
>
> Is there any way to scroll up line-by-line? (IE you press up, ONE line
> disappears at the bottom and ONE more line is visible at the top. Rather than
> 20 lines at a time). (Useful for when you want to keep looking at two different
> things in a C file.)
>
> Thanks!
> Paul

In addition to the other good answers you got, I'd mention
smooth-scroll.el [1] which I found on EmacsWiki and have been using
very very happily ever since. It basically doesn't scroll until you go
up/down lines near the top/bottom of the buffer.

Rupert


[1] http://files.adamspiers.org/elisp/smooth-scrolling.el


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-02  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01 16:12 Quick Emacs Question Paul S
2008-05-01 22:49 ` Peter Dyballa
     [not found] <mailman.11044.1209680383.18990.help-gnu-emacs@gnu.org>
2008-05-01 23:02 ` Giorgos Keramidas
2008-05-02  9:43 ` Rupert Swarbrick

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).