Article View: gnu.emacs.help
Article #188850Re: End of file detection
From: Mike Williams
Date: Tue, 18 Jun 1991 08:17
Date: Tue, 18 Jun 1991 08:17
38 lines
2250 bytes
2250 bytes
>>> On 15 Jun 91 09:03:59 GMT,
>>> "kpc" == kpc@pluto.arc.nasa.gov (kpc) writes:
kpc> here is a change to have C-n not move past eob. put it in your .emacs
kpc> if you like it. use C-xC-e at the end of it to try it for the rest of
kpc> your emacs session.
kpc> (defun next-line (arg)
kpc> "Local version of the command. Does not insert newlines. Only one line
kpc> has changed.
kpc> [...etc...]
In fact, the following redefinition works too:
(defun next-line (arg)
"Move cursor vertically down ARG lines.
If there is no character in the target line exactly under the current column,
the cursor is positioned after the character in that line which spans this
column, or at the end of the line if it is not long enough.
If there is no line in the buffer after this one, the cursor is not moved.
The command \\[set-goal-column] can be used to create
a semipermanent goal column to which this command always moves.
Then it does not try to move vertically.
If you are thinking of using this in a Lisp program, consider
using `forward-line' instead. It is usually easier to use
and more reliable (no dependence on goal column, etc.)."
(interactive "p")
(line-move arg))
--
/-------------------- mike-w@cs.aukuni.ac.nz ---------------------\
| Mike Williams, Computer Science, Auckland University, Aotearoa. |
\--------- Quick, turn on the machine that goes "ping"! ----------/
--
New administrater uofa.
Technical Details
Message-ID:
<MIKE-W.91Jun18101742@cs17.cs.aukuni.ac.nz>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!comp.vuw.ac.nz!waikato.ac.nz!aukuni.ac.nz!mike-wReferences:
<B=C-A-+@engin.umich.edu><KPC.91Jun15020359@kronos-fi.arc.nasa.gov>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,aede17fcc792d7dd X-Google-Attributes: gid103b8b,public X-Google-ArrivalTime: 1991-06-17 23:41:19 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!comp.vuw.ac.nz!waikato.ac.nz!aukuni.ac.nz!mike-w From: mike-w@cs.aukuni.ac.nz (Mike Williams) Newsgroups: gnu.emacs.help Subject: Re: End of file detection Message-ID: <MIKE-W.91Jun18101742@cs17.cs.aukuni.ac.nz> Date: 18 Jun 91 08:17:42 GMT References: <B=C-A-+@engin.umich.edu><KPC.91Jun15020359@kronos-fi.arc.nasa.gov> Sender: news@ccu1.aukuni.ac.nz (News Owner) Organization: University of Auckland, New Zealand. Lines: 38 In-Reply-To: kpc@pluto.arc.nasa.gov's message of 15 Jun 91 09:03:59 GMT Nntp-Posting-Host: cs17.cs.aukuni.ac.nz X-News-Software: GNUS 3.13