Re: [O] Custom keymaps on org blocks

2018-09-05 Thread Matt Price
Necroposting here. I was wondering if anyone has tried polymode recently, and whether it still has the problems John described in his earlier posts. I notice that poly-org is being actively developed but I haven't tried it out yet... On Sat, Jun 10, 2017 at 3:32 PM John Kitchin wrote: > In case

Re: [O] Custom keymaps on org blocks

2017-06-10 Thread John Kitchin
In case anyone would like to try this themselves, I documented what I tried here: http://kitchingroup.cheme.cmu.edu/blog/2017/06/10/Adding-keymaps-to-src-blocks-via-org-font-lock-hook/ John --- Professor John Kitchin Doherty Hall A207F Department of Chemical Engine

Re: [O] Custom keymaps on org blocks

2017-06-10 Thread John Kitchin
Nicolas Goaziou writes: > Hello, > > John Kitchin writes: > >> On the other hand, there are times when I am working on a document that has >> a lot of short code blocks, e.g. for lecture notes or blog posts, where it >> is sufficiently tedious to me to switch in and out of the special edit mode

Re: [O] Custom keymaps on org blocks

2017-06-10 Thread Nicolas Goaziou
Hello, John Kitchin writes: > On the other hand, there are times when I am working on a document that has > a lot of short code blocks, e.g. for lecture notes or blog posts, where it > is sufficiently tedious to me to switch in and out of the special edit mode > that I wanted to try this solutio

Re: [O] Custom keymaps on org blocks

2017-06-07 Thread Grant Rettke
On Wed, Jun 7, 2017 at 8:50 AM, John Kitchin wrote: > On the other hand, there are times when I am working on a document that has > a lot of short code blocks, e.g. for lecture notes or blog posts, where it > is sufficiently tedious to me to switch in and out of the special edit mode These bindin

Re: [O] Custom keymaps on org blocks

2017-06-07 Thread Grant Rettke
On Wed, Jun 7, 2017 at 7:49 AM, John Kitchin wrote: > Grant Rettke writes: > >> You want Polymode: https://github.com/vspinu/polymode > > I have never been able to get polymode to work. Do have an incantation > that works? I forgot that I set it up for R markdown files. But it did work on my mach

Re: [O] Custom keymaps on org blocks

2017-06-07 Thread John Kitchin
I can see that. There are plenty of cases that certainly would not work, e.g. in a Python block it would be a mistake to run a command that sends the buffer to the interpreter! In the example I provided, you can see I also had to "preserve" a few org-bindings so you could still do C-c ' to get to t

Re: [O] Custom keymaps on org blocks

2017-06-07 Thread Nicolas Goaziou
Hello, John Kitchin writes: > For once in a while uses this works, but this isn't really a solution > for key-bindings that are composable, e.g. in lispy. There you can use > single key-presses to navigate, rearrange, insert code, etc... > > Also it adds three chords to every key-binding out of

Re: [O] Custom keymaps on org blocks

2017-06-07 Thread John Kitchin
Nicolas Goaziou writes: > Hello, > > John Kitchin writes: > >> Is there any interest in having custom keymaps on org blocks? >> >> The idea I had is to have the option to make the major-mode keymaps be >> active on the src blocks. > > There is already `org-babel-do-key-sequence-in-edit-buffer',

Re: [O] Custom keymaps on org blocks

2017-06-07 Thread John Kitchin
Grant Rettke writes: > On Mon, Jun 5, 2017 at 4:53 PM, John Kitchin wrote: >> Is there any interest in having custom keymaps on org blocks? >> >> The idea I had is to have the option to make the major-mode keymaps be >> active on the src blocks. > > You want Polymode: https://github.com/vspinu/p

Re: [O] Custom keymaps on org blocks

2017-06-06 Thread Grant Rettke
On Mon, Jun 5, 2017 at 4:53 PM, John Kitchin wrote: > Is there any interest in having custom keymaps on org blocks? > > The idea I had is to have the option to make the major-mode keymaps be > active on the src blocks. You want Polymode: https://github.com/vspinu/polymode > I have tried this, an

Re: [O] Custom keymaps on org blocks

2017-06-06 Thread Nicolas Goaziou
Hello, John Kitchin writes: > Is there any interest in having custom keymaps on org blocks? > > The idea I had is to have the option to make the major-mode keymaps be > active on the src blocks. There is already `org-babel-do-key-sequence-in-edit-buffer', i.e., C-c C-v C-x. Regards, -- Nicol

[O] Custom keymaps on org blocks

2017-06-06 Thread John Kitchin
Is there any interest in having custom keymaps on org blocks? The idea I had is to have the option to make the major-mode keymaps be active on the src blocks. For example, you might want to use something like this to use the elpy in ipython blocks and lispy-mode-map in emacs-lisp blocks (defcust