From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: Custom keymaps on org blocks Date: Wed, 5 Sep 2018 11:52:09 -0400 Message-ID: References: <878tl5ugl9.fsf@nicolasgoaziou.fr> <87o9u0ylu6.fsf@nicolasgoaziou.fr> <87efusz02q.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f7158d057521beed" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxa5U-00009l-E7 for emacs-orgmode@gnu.org; Wed, 05 Sep 2018 11:51:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxa5T-0001iS-5o for emacs-orgmode@gnu.org; Wed, 05 Sep 2018 11:51:24 -0400 Received: from mail-io0-x230.google.com ([2607:f8b0:4001:c06::230]:45791) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxa5S-0001hH-VS for emacs-orgmode@gnu.org; Wed, 05 Sep 2018 11:51:23 -0400 Received: by mail-io0-x230.google.com with SMTP id e12-v6so6324462iok.12 for ; Wed, 05 Sep 2018 08:51:22 -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" To: Org Mode --000000000000f7158d057521beed Content-Type: text/plain; charset="UTF-8" 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 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 Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > > On Sat, Jun 10, 2017 at 9:58 AM, John Kitchin > wrote: > >> >> 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 >> >> that I wanted to try this solution out, and it became clear you can't >> >> really try it out without modifying the core org code that does the >> >> font-locking on a block. >> > >> > Are you sure about it? There are two hooks related to fontification: >> > `org-font-lock-set-keywords-hook' and `org-font-lock-hook'. I'm >> > surprised none can help you in this case. >> >> You are totally right on this. I can use org-font-lock-hook to take care >> of this. Thanks for the pointer. >> >> > >> >> I don't think we have to go so far as to say we make multiple major >> mode >> >> keybindings available, so much as context specific keybindings >> available >> >> where there is value in it. We already have this in org-speed keys for >> >> example, and even these can be context specific to do different things >> on >> >> headings (even different things on headings with specific properties) >> and >> >> blocks ( >> >> >> http://kitchingroup.cheme.cmu.edu/blog/2016/12/22/Context-specific-org-mode-speed-keys/ >> >> ). >> > >> > Neat hack. >> >> Thanks! >> >> > >> >> If there was a change to org to enable this, I wouldn't expect the >> core to >> >> change behavior for anyone, it would just make it possible for users to >> >> change this if they wanted to. The same way they can customize the >> face of >> >> a code block for different languages. >> > >> > Fair enough. Would you want to provide a proper patch? >> >> With the hook I don't think it is necessary. Thanks for all the >> discussion though (everyone) it was helpful to think it through. >> > >> > Thank you. >> > >> > >> > Regards, >> >> >> -- >> Professor John Kitchin >> Doherty Hall A207F >> Department of Chemical Engineering >> Carnegie Mellon University >> Pittsburgh, PA 15213 >> 412-268-7803 >> @johnkitchin >> http://kitchingroup.cheme.cmu.edu >> > > --000000000000f7158d057521beed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Necroposting here.=C2=A0 I was wondering if anyone has tri= ed polymode recently, and whether it still has the problems John described = in his earlier posts. I notice that poly-org is being actively developed bu= t I haven't tried it out yet...

On Sat, Jun 10, 2017 at 3:32 PM John Kitchin <jkitchin@andrew.cmu.edu> wrote:<= br>
In case anyone wou= ld like to try this themselves, I documented what I tried here:=C2=A0http://kitchingroup.che= me.cmu.edu/blog/2017/06/10/Adding-keymaps-to-src-blocks-via-org-font-lock-h= ook/

John

---------------------= --------------
Professor John Kitchin=C2=A0
Doherty Hall A207F
Dep= artment of Chemical Engineering
Carnegie Mellon University
Pittsburgh= , PA 15213
412-268-7803

On Sat, Jun 10, 2017 at 9:58 AM, John Kitchi= n <jkitchin@andrew.cmu.edu> wrote:

Nicolas Goaziou writes:

> Hello,
>
> John Kitchin <jkitchin@andrew.cmu.edu> 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 solution out, and it became clear you ca= n't
>> really try it out without modifying the core org code that does th= e
>> font-locking on a block.
>
> Are you sure about it? There are two hooks related to fontification: > `org-font-lock-set-keywords-hook' and `org-font-lock-hook'. I&= #39;m
> surprised none can help you in this case.

You are totally right on this. I can use org-font-lock-hook to take = care
of this. Thanks for the pointer.

>
>> I don't think we have to go so far as to say we make multiple = major mode
>> keybindings available, so much as context specific keybindings ava= ilable
>> where there is value in it. We already have this in org-speed keys= for
>> example, and even these can be context specific to do different th= ings on
>> headings (even different things on headings with specific properti= es) and
>> blocks (
>> http= ://kitchingroup.cheme.cmu.edu/blog/2016/12/22/Context-specific-org-mode-spe= ed-keys/
>> ).
>
> Neat hack.

Thanks!

>
>> If there was a change to org to enable this, I wouldn't expect= the core to
>> change behavior for anyone, it would just make it possible for use= rs to
>> change this if they wanted to. The same way they can customize the= face of
>> a code block for different languages.
>
> Fair enough. Would you want to provide a proper patch?

With the hook I don't think it is necessary. Thanks for all the<= br> discussion though (everyone) it was helpful to think it through.
>
> Thank you.
>
>
> Regards,


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-2= 68-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

--000000000000f7158d057521beed--