From: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
To: Grant Rettke <gcr@wisdomandwonder.com>,
"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: How to utilize the vc package inside of the edit source block buffer?
Date: Tue, 23 Sep 2014 14:52:38 -0400 [thread overview]
Message-ID: <CAEWDx5fMq0qn0KvxpiN92qU-TepYttP9dQsXuyv4JL+m+hSraA@mail.gmail.com> (raw)
In-Reply-To: <87mw9qnqre.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]
Hello,
On 23 September 2014 14:19, Aaron Ecay <aaronecay@gmail.com> 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
>
>
[-- Attachment #2: Type: text/html, Size: 2245 bytes --]
next prev parent reply other threads:[~2014-09-23 18:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 17:15 How to utilize the vc package inside of the edit source block buffer? Grant Rettke
2014-09-23 18:19 ` Aaron Ecay
2014-09-23 18:52 ` Jonathan Leech-Pepin [this message]
2014-09-27 23:33 ` Grant Rettke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEWDx5fMq0qn0KvxpiN92qU-TepYttP9dQsXuyv4JL+m+hSraA@mail.gmail.com \
--to=jonathan.leechpepin@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=gcr@wisdomandwonder.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).