From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Lomov Subject: Re: Bug: Write file while editing babel code block doesn't work as expected [8.3.4 (release_8.3.4-778-g8127b3 @ /usr/local/share/emacs/site-lisp/org/)] Date: Sun, 15 May 2016 19:00:16 +0800 Message-ID: <20160515110016.GB1188@smoon.vl-lomov.ru> References: <87vb2ki8vl.fsf@saiph.selenimh> <87eg969697.fsf@gmail.com> <87d1oq9mxn.fsf@saiph.selenimh> <20160515041152.GA1188@smoon.vl-lomov.ru> <87h9dzwyzw.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1tma-0005K8-0H for emacs-orgmode@gnu.org; Sun, 15 May 2016 07:00:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1tmW-0006av-PB for emacs-orgmode@gnu.org; Sun, 15 May 2016 07:00:23 -0400 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:34213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1tmW-0006al-H2 for emacs-orgmode@gnu.org; Sun, 15 May 2016 07:00:20 -0400 Received: by mail-lb0-x232.google.com with SMTP id n11so41478662lbh.1 for ; Sun, 15 May 2016 04:00:20 -0700 (PDT) Received: from smoon ([164.215.81.77]) by smtp.gmail.com with ESMTPSA id xx7sm4092852lbb.19.2016.05.15.04.00.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 May 2016 04:00:18 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87h9dzwyzw.fsf@saiph.selenimh> 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 Hello, ** Nicolas Goaziou [2016-05-15 09:40:03 +0200]: > Hello, > > Vladimir Lomov writes: > >> I have small example that worked before the commit, please see attached >> Org document. > > While it's true this worked before, I don't consider it to be > a regression. There was no guarantee that `save-buffer' would save the > source buffer. In fact, I think instrumenting `save-buffer' is not > a good idea, because it is surprising. Usually, minor modes change > bindings instead of altering functions. > > You can bind `org-edit-src-save' to F2 in this case. Correct me if I understand you wrong, but you suggest to bind ~F2~ key to ~org-edit-src-save~. But then this will work only in Org buffer, and how about LaTeX mode then. Or I should bind ~F2~ to something like that: (global-set-key [f2] (if (functionp org-edit-src-save) org-edit-src-save save-buffer)) (don't test this code, just idea, may be this code won't work or even there is more elegant code and idea). On second thought, I considered org-src buffer as auxiliary buffer, depending on (main) Org document buffer, so saving org-src buffer should save Org document buffer. I agree that there should be possibility to save org-src buffer and if ~write-buffer~ works it is Ok and it is Ok to call it manually. This is just my thoughts. > > Regards, > > -- > Nicolas Goaziou --- WBR, Vladimir Lomov -- Q: Why does Washington have the most lawyers per capita and New Jersey the most toxic waste dumps? A: God gave New Jersey first choice.