emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Dan Davison <davison@stats.ox.ac.uk>
Cc: emacs org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Indent code with TAB in Org buffer
Date: Sun, 15 Aug 2010 09:42:07 +0200	[thread overview]
Message-ID: <8E5505D7-A7CD-4EB6-AC4A-D8B8B92115D6@gmail.com> (raw)
In-Reply-To: <87mxsocr4i.fsf@stats.ox.ac.uk>


On Aug 15, 2010, at 8:43 AM, Dan Davison wrote:

> With this patch TAB in a code block aligns the code according to the
> major mode. The macro could be used to do the same thing for other
> commands (i.e. allow other commands to be invoked in the Org buffer,  
> but
> actually carried out in the code buffer.)
>
> Patch attached and in branch src-block-tab at
> git@github.com:dandavison/org-devel.git.
>
> diff --git a/lisp/org-src.el b/lisp/org-src.el
> index baa2b11..fc15a83 100644
> --- a/lisp/org-src.el
> +++ b/lisp/org-src.el
> @@ -435,6 +435,19 @@ the fragment in the Org-mode buffer."
>       (message "%s" msg)
>       t)))
>
> +(defmacro org-src-do-in-edit-buffer (&rest body)
> +  "Evaluate BODY in edit buffer if there is a code block at point.
> +Return t if a code block was found at point, nil otherwise."
> +  `(when (org-edit-src-code)

Wow, an excursion to the temp buffer for every TAB call
in a source code block?

Sounds heavy.  But I see that it could be nice together with
the new fontification stuff.  My gut feeling would be to have
both of these feature off by default.  But I have not tried
them yet.

- Carsten

  reply	other threads:[~2010-08-15  7:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15  6:43 [PATCH] Indent code with TAB in Org buffer Dan Davison
2010-08-15  7:42 ` Carsten Dominik [this message]
2010-08-15 23:00   ` Dan Davison
2010-08-16  6:56     ` Carsten Dominik

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=8E5505D7-A7CD-4EB6-AC4A-D8B8B92115D6@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /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).