all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Eide <eeide@cs.utah.edu>
Subject: Re: Is there a way to move to next line in wrapped text?
Date: Wed, 07 Jan 2004 08:58:17 -0700 (MST)	[thread overview]
Message-ID: <ywroetf7nty.fsf@ioka.flux.utah.edu> (raw)
In-Reply-To: pan.2004.01.06.18.52.39.531026@cunningham.net

"Jeff" == Jeff <jeffrey@cunningham.net> writes:

	Jeff> [...] when I do Ctrl-p or Ctrl-n to move up or down a line, it
	Jeff> goes to the next line in terms of linefeeds, not in terms of
	Jeff> wrapped text.  Are there keybindings I don't know about that will
	Jeff> move up and down to the next 'literal' line in the window?
	Jeff> (regardless of where linefeeds are?). If not, is there some other
	Jeff> way to do this?

The `scroll-in-place' package can help you with this.  Get it from:

	<http://www.cs.utah.edu/~eeide/emacs/scroll-in-place.el.gz>

Or if you are using XEmacs, you can get it as part of the XEmacs distribution.

Load the `scroll-in-place' package into your Emacs session, and then you can
use

	C-u 1 C-v	to move the cursor down screen one line ("scroll up")
	C-u 1 M-v	to move the cursor up one screen line ("scroll down")

Of course, `C-u 1 PgDown' and `C-u 1 PgUp' work just as well.

The keys `C-u 1' tell the scrolling commands how many lines to move, and it
turns out that the `scroll-in-place' commands remember the number of lines you
want to scroll, across a sequence of scrolling commands.  In other words, you
don't have to type `C-u 1' every time.  As long as you keep doing C-v and M-v
without interruption, you'll keep moving by the same distance each time.

To make one-line scrolling more convenient, you might want to define you own
one-line scrolling commands and bind them to keys --- something like this:

(defun scroll-down-one-line (arg)
  "Scroll down one line, or number of lines specified by prefix arg."
  (interactive "P")
    (let ((scroll-default-lines 1))
      (scroll-down-in-place arg)))

(global-set-key "\C-c\C-v" 'scroll-down-one-line)

The documentation in the `scroll-in-place.el' file comments (in the "advanced
customization" section) go into more detail about writing your own scrolling
commands.

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide@cs.utah.edu>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX

  parent reply	other threads:[~2004-01-07 15:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-06 18:52 Is there a way to move to next line in wrapped text? Jeff
2004-01-06 19:37 ` Marco Parrone (marc0)
2004-01-06 20:12   ` Benjamin Rutt
2004-01-06 21:50     ` Jeff
2004-01-07  0:53 ` Stefan Monnier
2004-01-07 15:58 ` Eric Eide [this message]
2004-01-08 22:34   ` leo
2004-01-09  0:36     ` Eric Eide

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ywroetf7nty.fsf@ioka.flux.utah.edu \
    --to=eeide@cs.utah.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.