From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: good examples of Emacs modules? Date: Thu, 31 Mar 2016 22:23:56 +0200 Message-ID: <87twjm5rc3.fsf@wanadoo.es> References: <56FC5E99.7090804@cs.ucla.edu> <8737r67jbo.fsf@wanadoo.es> <83a8levbaf.fsf@gnu.org> <87y48y60fi.fsf@wanadoo.es> <834mbmv95h.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1459455871 14459 80.91.229.3 (31 Mar 2016 20:24:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2016 20:24:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 31 22:24:23 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1alj8e-0004qd-Jt for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2016 22:24:20 +0200 Original-Received: from localhost ([::1]:34284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alj8e-0004xc-1M for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2016 16:24:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alj8Z-0004xL-VU for emacs-devel@gnu.org; Thu, 31 Mar 2016 16:24:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alj8V-0000xj-0V for emacs-devel@gnu.org; Thu, 31 Mar 2016 16:24:15 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:60267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alj8U-0000xe-Q0 for emacs-devel@gnu.org; Thu, 31 Mar 2016 16:24:10 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1alj8S-0004ii-8Q for emacs-devel@gnu.org; Thu, 31 Mar 2016 22:24:08 +0200 Original-Received: from 151.red-79-153-146.dynamicip.rima-tde.net ([79.153.146.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Mar 2016 22:24:08 +0200 Original-Received: from ofv by 151.red-79-153-146.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Mar 2016 22:24:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 151.red-79-153-146.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) Cancel-Lock: sha1:7gfLmnLIhdGNRibKqtOps3TExsQ= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:202529 Archived-At: Eli Zaretskii writes: >> Thank you, that file acts as a nice cookbook. Still need to figure out >> how to best handle a long-lived session with an external API. > > Not sure what you mean by "a long-lived session with an external > API". Can you elaborate? Some APIs are session-based. Those give the user an object that lives through the session and needs to be disposed at the end. On the case of VC or Magit, Emacs would request from libgit2 to work with a given repo, operate on it and close the session. That means that if the user kills the magit-status buffer that was visiting a repo, the associated session object must be closed (this is a simplistic scenario, in practice things are more complicated.) It would be nice to explain how to handle this use case on a robust way (the failure to properly close a session, transaction, whatever on some packages can produce very annoying consequences.) How objects created by the module system interact with garbage collection is an start. [snip]