help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding String to Beginning of Lines


From: Michael Heerdegen
Subject: Re: Adding String to Beginning of Lines
Date: Wed, 11 Nov 2020 19:12:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Christopher Dimech <dimech@gmx.com> writes:

> Have put the following, bet the insert is not progressing to the
> last line of the selected region.  I started my selected region
> on the first character of 'RFrec-field-nwltok' and ended my
> selected region on the last character of 'insert'.

Oh, of course, while inserting the stuff your specified end position
gets outdated.  You can use a marker instead of a number:

  (copy-marker (region-end))

it will automatically be adjusted.  Arithmetic relations like `<' also
accept markers, so you don't need to rewrite your code.

BTW, your function calls `region-beginning' and `region-end' in the
interactive spec and a second time in the function body: The function
arguments BEG and END are ignored in the body.  That makes no sense.

Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]