From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: Custom keymaps on org blocks Date: Tue, 6 Jun 2017 20:22:19 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIPfz-0007va-Ci for emacs-orgmode@gnu.org; Tue, 06 Jun 2017 21:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIPfy-000726-D3 for emacs-orgmode@gnu.org; Tue, 06 Jun 2017 21:22:23 -0400 Received: from mail-io0-x230.google.com ([2607:f8b0:4001:c06::230]:35918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIPfy-0006zl-8D for emacs-orgmode@gnu.org; Tue, 06 Jun 2017 21:22:22 -0400 Received: by mail-io0-x230.google.com with SMTP id y77so955483ioe.3 for ; Tue, 06 Jun 2017 18:22:20 -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: John Kitchin Cc: "emacs-orgmode@gnu.org" 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, and seems ok, and I wondered if anyone had an opinion > for or against this idea. It is confusing alternating between the Org major a mode and the source block major mode as you scroll through documents. One second you are an author for humans and the other an author for the computer. That is how literate programming is defined in theory, but in practice I don't do it like that because it is mentally jarring. I spell check my Org-Mode Literate Documents. But the spell checker does not check source blocks. That is up to the major mode for that source block, not for the containing literate document. When you think about it, probably every Org-Mode literate programming has it set up this way, otherwise the spell checker would go crazy on typical source code. That is revealing. The source blocks are very different "things" than the containing document. For me the source block is another cognitive workspace that I enter consciously. I am digging deeper into the document itself. For me the source block is a window into that world of the source block. In the top level document I write literature about things, including the various source blocks. Then I jump into editing the source block itself. John you once had a discussion (or answered a (my?) question) about making source blocks not-editable. That is how I would like it to work all the time. That is why I don't fontify source blocks natively and that is why I wouldn't enjoy what you describe.