[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
S-RET
From: |
Juri Linkov |
Subject: |
S-RET |
Date: |
Sat, 14 Nov 2020 22:15:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
I've switched to Org Babel as a replacement of Jupyter Notebook since I already
tired copying Julia program texts back and forth between Jupyter pages
in web browsers and Emacs. Fortunately, Org Babel can do everything that
Jupyter Notebook does. Except that there is a small usability feature
that I miss in Org Babel. Typing 'C-RET' in Jupyter evaluates the current
code block. In Org Babel 'C-RET' inserts a new heading at the end of
the current subtree. To evaluate the code block there is 'C-c C-c'
(org-ctrl-c-ctrl-c). Thus the equivalent of 'C-RET' is 'C-c C-c'.
So far, so good.
What I miss in Org Babel is an equivalent of 'S-RET' that in Jupyter
creates a new code block relative to the current code block.
Actually, in Org Babel such a command already exists and is bound to
the needed key 'S-RET', but currently it works only on tables:
the command is 'org-table-copy-down' and it copies the current field
down to the next row and moves point along with it. This is exactly
what is needed also in context of code blocks.
Maybe like there is already the command named 'org-ctrl-c-ctrl-c',
a new general command bound to e.g. 'org-s-ret' could do this
depending on context.
PS: another similarity is how typing RET in shell buffers
inserts a new prompt where the user can type a new command.
'S-RET' in code blocks could work the same way: type 'S-RET'
and write code in the next code block, and type 'S-RET' again.