From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: garbace collection of point-markers Date: Fri, 31 Jan 2003 16:13:30 GMT Organization: Genuity, Woburn, MA Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <62ede926.0301310049.17611c1a@posting.google.com> <87znphzl2d.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1044030114 31692 80.91.224.249 (31 Jan 2003 16:21:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 31 Jan 2003 16:21:54 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18eduq-0008CN-00 for ; Fri, 31 Jan 2003 17:21:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18eduC-0002X9-02 for gnu-help-gnu-emacs@m.gmane.org; Fri, 31 Jan 2003 11:20:40 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!crtntx1-snh1.gtei.net!news.gtei.net!paloalto-snr1.gtei.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Mail-Copies-To: never X-Newsreader: trn 4.0-test72 (19 April 1999) Originator: barmar@genuity.net (Barry Margolin) Original-Lines: 31 Original-X-Trace: /bdhN62TNSxpbjon9cx1xd1pZt5fXh5n9e5CA+0XIM3ERT5UeI5lE/avdOEphtzQPWWK9yOeTZ+n!kuCyDgUaFQoCF2WdLdAXC+TkKARDRjMTNZ8C/srZcQIKYyT8Je9/AkrCDTY6sUx8Tk7/vdPYA8v2!8u5AlHPHwWHs Original-X-Complaints-To: abuse@gte.net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly Original-NNTP-Posting-Date: Fri, 31 Jan 2003 16:13:30 GMT Original-Distribution: world Original-Xref: shelby.stanford.edu gnu.emacs.help:109647 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6163 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6163 In article <87znphzl2d.fsf@thalassa.informatimago.com>, Pascal Bourguignon wrote: > >kamphausen@creativepharma.com (Stefan Kamphausen) writes: > >> Dear ElispWizards, >> >> when I call (point-marker) and don't store the return value in a >> variable will that marker be removed at the next garbage collection? > >It seems so: > >(show (let ((curpt (point))) > (set-marker (make-marker) curpt) > (cons (buffer-has-markers-at curpt) > (progn (garbage-collect) > (buffer-has-markers-at curpt))))) >==> (t . t) Your test seems to show that the markers are *not* cleaned up by the GC. Buffers keep track of the markers that point to them (so that they can be updated when the buffer is modified), and that keeps them from becoming garbage until the buffer is killed. This would be an ideal application for "weak" references if Emacs Lisp had them, but AFAIK it doesn't. -- Barry Margolin, barmar@genuity.net Genuity, Woburn, MA *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups. Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.