From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: threads and kill-buffer Date: Wed, 05 Sep 2012 14:13:03 -0400 Message-ID: References: <87a9x55xvd.fsf@fleche.redhat.com> <83d321dvsr.fsf@gnu.org> <87mx148sao.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346868797 6218 80.91.229.3 (5 Sep 2012 18:13:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2012 18:13:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: sds@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 05 20:13:19 2012 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 1T9K6I-0001eo-F5 for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2012 20:13:18 +0200 Original-Received: from localhost ([::1]:47155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9K6F-0005Mj-EO for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2012 14:13:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9K69-0005Kp-QU for emacs-devel@gnu.org; Wed, 05 Sep 2012 14:13:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9K65-0004OW-L7 for emacs-devel@gnu.org; Wed, 05 Sep 2012 14:13:09 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:26604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9K65-0004OR-Gb; Wed, 05 Sep 2012 14:13:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09FxINJ/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA2IQAW6CYsRghWDHgOjM4FYgwWBOg X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="197587902" Original-Received: from 69-196-131-73.dsl.teksavvy.com (HELO pastel.home) ([69.196.131.73]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Sep 2012 14:13:04 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id C058C588E8; Wed, 5 Sep 2012 14:13:03 -0400 (EDT) In-Reply-To: <87mx148sao.fsf@gnu.org> (Sam Steingold's message of "Wed, 05 Sep 2012 10:20:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:153064 Archived-At: >> How about letting kill-buffer succeed, but delay the actual deletion >> of the buffer until no thread has it as current, like what Posix >> filesystems do with file deletion? > I am not sure that Posix file systems do this "by design" and not as a > side effect of an implementation detail. I highly doubt it was a side effect of implementation. More specifically, the implementation has to go to extra length to do this. And it is also a natural result of the design decision that aimed at making read&write as lean&mean as possible, pushing the heavy lifting to `open'. > At any rate, I don't think this behavior is very useful. To the extent that you can get virtually the same result by renaming the file to a well-hidden name, it's pretty useful since it turns this "special situation" into a situation that client code has to deal with anyway thus reducing the number of special cases. Note that for buffers, it's a bit different since a buffer can only have a single name and that it always has one name, so while you can't reliably ask for the file-name corresponding to a POSIX file-descriptor, you can reliably ask for the buffer-name of the current buffer. Stefan