Article View: gnu.emacs.help
Article #188784next-line question
From: Peter de Waal
Date: Tue, 09 Jul 1991 13:04
Date: Tue, 09 Jul 1991 13:04
20 lines
1446 bytes
1446 bytes
In my .emacs file I have
(defun my-next-line (arg)
"doesn't next-line past end of buffer"
(interactive "p")
(if (not (eobp)) (next-line arg)))
as an alternative for the standard 'next-line'. It has the advantage
that it doesn't add new lines at the end of a buffer. The disadvantage
is that is forgets the original column position of the cursor whenever
you do a 'my-next-line' to a line that is shorter then the previous
one. In particular this means that doing a 'my-next-line' while
crossing an empty line causes the cursor to end up in column 1 and
stay there during subsequent my-next-lines. The original 'next-line',
however, handles this correctly. Can anybody explain me why? Does
anybody know a cure?
=============================================================================
Peter de Waal, CWI, Amsterdam ---------------------- Thunderbirds are GO!
=============================================================================
Technical Details
Message-ID:
<3845@charon.cwi.nl>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!hp4nl!cwi.nl!waalShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,b8a9d8f033088283,start X-Google-Attributes: gid103b8b,public X-Google-ArrivalTime: 1991-07-09 11:12:51 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!hp4nl!cwi.nl!waal From: waal@cwi.nl (Peter de Waal) Newsgroups: gnu.emacs.help Subject: next-line question Message-ID: <3845@charon.cwi.nl> Date: 9 Jul 91 13:04:56 GMT Sender: news@cwi.nl Organization: CWI Lines: 20 Originator: waal@gans.cwi.nl