From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Proposal: move write-contents-functions higher up in basic-save-buffer Date: Wed, 24 May 2017 08:29:31 -0400 Message-ID: References: <87zie4yr9s.fsf@ericabrahamsen.net> <83y3tnmn88.fsf@gnu.org> <87wp97xjak.fsf@ericabrahamsen.net> <83h90bm11c.fsf@gnu.org> <87poeyyht2.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1495629021 4101 195.159.176.226 (24 May 2017 12:30:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 May 2017 12:30:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 24 14:30:16 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dDVQe-0000uy-IC for ged-emacs-devel@m.gmane.org; Wed, 24 May 2017 14:30:16 +0200 Original-Received: from localhost ([::1]:54728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDVQj-0000F2-Lu for ged-emacs-devel@m.gmane.org; Wed, 24 May 2017 08:30:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDVQ7-0000Eo-FW for emacs-devel@gnu.org; Wed, 24 May 2017 08:29:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDVQ4-000760-AT for emacs-devel@gnu.org; Wed, 24 May 2017 08:29:43 -0400 Original-Received: from [195.159.176.226] (port=39822 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dDVQ4-00075T-41 for emacs-devel@gnu.org; Wed, 24 May 2017 08:29:40 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dDVPv-0008OM-MV for emacs-devel@gnu.org; Wed, 24 May 2017 14:29:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:9acnNF8IOrX+dHyAs41a+XdmPrE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:215167 Archived-At: > I probably just did a poor job writing the initial message. That's what > I was proposing to begin with: to jiggle `basic-save-buffer' (and I > think also `save-some-buffers') so that the running of > `write-contents-functions' comes earlier in the function, or is > otherwise in its own branch that doesn't require a `buffer-file-name'. I > think it would be a fairly unintrusive change, it would just require a > bit of thought. I can try to produce a patch, if this is acceptable in > principle. I haven't looked at basic-save-buffer recently, but in the worst case we could keep the current code and add a (if (null buffer-file-name) (run-hook-... 'write-contents-functions) ...) but admittedly, it's better if we can move the single call to write-contents-functions so it's shared by the file and the non-file cases. Stefan