unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: North Year <ny-ml@outlook.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: org-babel: how to evaluate code block with "alias" language?
Date: Tue, 22 Nov 2022 15:29:02 -0500	[thread overview]
Message-ID: <MW4PR14MB53277E939B4895089429B4D3E70D9@MW4PR14MB5327.namprd14.prod.outlook.com> (raw)


suppose I want to evaluate the following code block in an org file:

#+begin_src r
data.frame(
    dog = rnorm(5),
    cat = rnorm(5)
)
#+end_src

then I will get the following error:
"org-babel-execute-src-block: No org-babel-execute function for r!"

I tried the following config in my init file, but they does not to work

#+begin_src emacs-lisp

(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

(add-to-list 'org-src-lang-modes '("r" . R))
#+end_src

and the following elisp

#+begin_src emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((r . t)))
#+end_src

will yield error:
"failed to provide feature ‘ob-r’"

I know this problem is trivial to solve by simply replace "r" by "R".
However aliases are something expected to frequently happened and
can anyone has idea on how to make evaluating code blcok with "alias" language work?



             reply	other threads:[~2022-11-22 20:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 20:29 North Year [this message]
2022-11-23 20:35 ` org-babel: how to evaluate code block with "alias" language? Bastien
2022-11-24  2:03   ` North Year
2022-11-24  5:23   ` tomas

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=MW4PR14MB53277E939B4895089429B4D3E70D9@MW4PR14MB5327.namprd14.prod.outlook.com \
    --to=ny-ml@outlook.com \
    --cc=help-gnu-emacs@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).