From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: function for inserting a block Date: Sun, 03 Sep 2017 03:19:52 -0500 Message-ID: <878thwdwif.fsf@alphapapa.net> References: <877exghblx.fsf@ericabrahamsen.net> <87efromccg.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1doQ8v-0004DA-Iq for emacs-orgmode@gnu.org; Sun, 03 Sep 2017 04:20:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1doQ8l-000155-Ah for emacs-orgmode@gnu.org; Sun, 03 Sep 2017 04:20:27 -0400 Received: from [195.159.176.226] (port=40745 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1doQ8l-000146-3h for emacs-orgmode@gnu.org; Sun, 03 Sep 2017 04:20:23 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1doQ8R-0007JV-9c for emacs-orgmode@gnu.org; Sun, 03 Sep 2017 10:20:03 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Nicolas Goaziou writes: > You need to clean these markers at the end of the function. Markers set > to a position are never garbage-collected. Usually, it happens at the > end of an `unwind-protect'. Not that I oppose cleaning up markers after you're done with them, but are they actually never collected? The manual says: "...it is a good idea to make a marker point nowhere if you are sure you don’t need it any more. Markers that can no longer be accessed are eventually removed (*note Garbage Collection::)." I asked on /r/emacs about this but never got a firm answer; some thought that they are never collected and require manual clearing, others thought that ones that go out-of-scope are eventually collected and that it's not typically necessary to clear them manually. I also recall seeing some code recently that didn't manually clear the markers it created, so I wonder if that is true.