From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: How to utilize the vc package inside of the edit source block buffer? Date: Sat, 27 Sep 2014 18:33:25 -0500 Message-ID: References: <87mw9qnqre.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XY1Ua-0002Ml-H6 for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 19:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XY1UZ-0007SG-Cm for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 19:33:32 -0400 Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:40734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XY1UZ-0007Ry-67 for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 19:33:31 -0400 Received: by mail-ob0-f178.google.com with SMTP id uy5so698977obc.37 for ; Sat, 27 Sep 2014 16:33:25 -0700 (PDT) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jonathan Leech-Pepin Cc: "emacs-orgmode@gnu.org" Thank you Aaron and Jonathan. Here is what I did: (defadvice vc-next-action (before vc-next-action-in-org-src-block last acti= vate) "If in org source block, exit it." (when (condition-case nil (org-src-in-org-buffer) (error nil)) (org-edit-src-exit))) I had trouble with the latter and I suspect it is due to my personal configuration. That would be quite nice indeed to be able to keep the org source edit buffer open. On Tue, Sep 23, 2014 at 1:52 PM, Jonathan Leech-Pepin wrote: > Hello, > > On 23 September 2014 14:19, Aaron Ecay wrote: >> >> Hi Grant, >> >> 2014ko irailak 23an, Grant Rettke-ek idatzi zuen: >> > >> > Good afternoon, >> > >> > The ability to org-edit-special inside of source block is truly >> > priceless. >> > >> > There is a delightful workflow to be found with approach. >> > >> > It has got me spending more and more time in the edit buffer though, >> > wanting to utilize >> > vc-next-action to initiate a commit. This is not possible because the >> > buffer is not associated >> > with a file. >> > >> > Is there some way to get tell Emacs to execute the action on the >> > source buffer from which the >> > source edit block buffer originated? >> >> One approach might be to advise the vc commands like (pseudocode): >> >> (defadvice vc-foo (around org-src activate) >> (when (in-src-edit-p) >> (org-edit-src-exit)) >> ad-do-it) >> > > The following would work as a wrapper: > > (defun test-buffer () > (interactive) > (when org-edit-src-from-org-mode > (let ((buffer (marker-buffer org-edit-src-beg-marker))) > (with-current-buffer buffer > (message "%s is current for file: %s" > (current-buffer) > (buffer-file-name)))))) > > Replace (message ...) with `vc-next-action` or use the above as advice > [adjusting from (when..) to (if..)]. > > Regards, > Jonathan > >> >> -- >> Aaron Ecay >> > --=20 Grant Rettke gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/ =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) =E2=80=9CLife has become immeasurably better since I have been forced to st= op taking it seriously.=E2=80=9D --Thompson