From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Custom keymaps on org blocks Date: Sat, 10 Jun 2017 09:58:46 -0400 Message-ID: References: <878tl5ugl9.fsf@nicolasgoaziou.fr> <87o9u0ylu6.fsf@nicolasgoaziou.fr> <87efusz02q.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJgui-0006uf-TL for emacs-orgmode@gnu.org; Sat, 10 Jun 2017 09:58:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJguf-0005Nn-TH for emacs-orgmode@gnu.org; Sat, 10 Jun 2017 09:58:53 -0400 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:33922) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJguf-0005MA-O1 for emacs-orgmode@gnu.org; Sat, 10 Jun 2017 09:58:49 -0400 Received: by mail-qk0-x230.google.com with SMTP id d14so14263424qkb.1 for ; Sat, 10 Jun 2017 06:58:47 -0700 (PDT) In-reply-to: <87efusz02q.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" 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