Org-mode mailing list
 help / color / mirror / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Juri Linkov <juri@linkov.net>
Cc: org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: S-RET
Date: Sat, 14 Nov 2020 17:27:43 -0500
Message-ID: <CAJ51ETo6-p4uNndY42yCuy2eGWY3AwFm6s+FnDtnKRG-3a9reA@mail.gmail.com> (raw)
In-Reply-To: <87sg9bn19u.fsf@mail.linkov.net>

[-- Attachment #1: Type: text/plain, Size: 2467 bytes --]

you can find a lot of functions like the ones in jupyter at
https://github.com/jkitchin/scimax/blob/master/scimax-ob.el. I setup my
ipython like this:
https://github.com/jkitchin/scimax/blob/master/scimax-org-babel-ipython-upstream.el#L89

although I will note there are several setups in that file, e.g. this hydra:
https://github.com/jkitchin/scimax/blob/master/scimax-org-babel-ipython-upstream.el#L271

and these:
edit:
https://github.com/jkitchin/scimax/blob/master/scimax-org-babel-ipython-upstream.el#L271
command:
https://github.com/jkitchin/scimax/blob/master/scimax-org-babel-ipython-upstream.el#L526

I don't use them all, but leave them to remind me sometimes.

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, Nov 14, 2020 at 3:20 PM Juri Linkov <juri@linkov.net> wrote:

> 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.
>
>

[-- Attachment #2: Type: text/html, Size: 3828 bytes --]

  reply	other threads:[~2020-11-14 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14 20:15 S-RET Juri Linkov
2020-11-14 22:27 ` John Kitchin [this message]
2020-11-15  9:31   ` S-RET Juri Linkov
2020-11-16 18:37     ` S-RET John Kitchin
2020-11-16  8:37 ` S-RET Leo
2020-11-16  9:49   ` S-RET Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ51ETo6-p4uNndY42yCuy2eGWY3AwFm6s+FnDtnKRG-3a9reA@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git