[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: [BABEL] [PROPOSAL] Seemless editing of Babel Blocks
From: |
Dan Davison |
Subject: |
[Orgmode] Re: [BABEL] [PROPOSAL] Seemless editing of Babel Blocks |
Date: |
Fri, 03 Sep 2010 16:45:54 -0400 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
Tom Short <address@hidden> writes:
> On Thu, Sep 2, 2010 at 7:41 PM, Dan Davison <address@hidden> wrote:
>> There have been some recent changes with the aim of making code blocks
>> more pleasant to use in Org, such as fontification and making TAB and
>> other major-mode commands available in the Org buffer (with a current
>> master branch, see the variable `org-src-tab-acts-natively' and
>> `org-babel-do-key-sequence-in-edit-buffer' which is bound to key
>> bindings C-c C-v x and C-c C-v C-x)
>
> I really like the fontification and the tab-acts-natively. Would it be
> hard to extend
> that to a few more keys? Here's a first try for a nice key to have in
> R source blocks
> ("_"):
>
> (add-hook 'org-mode-hook
> (lambda ()
> (define-key org-mode-map "_"
> '(lambda () (interactive)
> (org-babel-do-key-sequence-in-edit-buffer (kbd "_")))))
>
> That works in R (and other) blocks, but doesn't work outside that. Any hints
> to
> get me a little further?
Hey Tom,
Good idea. I'll definitely use
that. `org-babel-do-key-sequence-in-edit-buffer' returns nil only if it
is not in a code block[1], so we could use this in
your code above:
(or (org-babel-do-key-sequence-in-edit-buffer (kbd "_"))
(org-self-insert-command 1))
Dan
>
> - Tom
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Footnotes:
[1] To be more exact, it returns nil if org-edit-src-code doesn't
generate an edit buffer.