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

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

Re: simple first emacs script


From: Stefan Monnier
Subject: Re: simple first emacs script
Date: Thu, 16 Dec 2010 16:55:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> If you want to memorize a buffer position in the course of editing that
> may change its absolute position (insertion and deletions), you may use
> markers (see the functions make-marker and set-marker), but markers need
> to be 'freed' explicitely by reseting them to nil,

Actually, they don't need to be freed explicitly (it may sometimes be
beneficial to performance, but only if there are many of them).

BTW, instead of using markers, you can often avoid the problem
altogether by simply performing the modifications starting from the end
of the region (so while the (point-max) you've computed at the beginning
is not valid at the end any more, it doesn't matter because you're done
processing that part of the buffer).


        Stefan


reply via email to

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