From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: simple first emacs script Date: Thu, 16 Dec 2010 16:55:10 -0500 Organization: A noiseless patient Spider Message-ID: References: <2V2Oo.37337$hW6.28446@newsfe08.ams2> <87hbefytr8.fsf@kuiper.lan.informatimago.com> <87oc8myjar.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292539261 15513 80.91.229.12 (16 Dec 2010 22:41:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Dec 2010 22:41:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 16 23:40:57 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PTMVM-0008U5-IG for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 23:40:56 +0100 Original-Received: from localhost ([127.0.0.1]:40278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTMVL-00055i-U1 for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 17:40:55 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 16 Injection-Info: mx02.eternal-september.org; posting-host="npc8WwhkFofBeKiRj5F6nA"; logging-data="7460"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8AU4NpfbFYx6oNPastMcf" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:ijl8eN0nLdeWt+7puLAwHD3DQv4= sha1:5prxA6R8/jPN7+PBJ0EhKoIbpOE= Original-Xref: usenet.stanford.edu gnu.emacs.help:183353 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77605 Archived-At: > 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