I would like to have a link that runs a Babel source-code block. Does Org-mode support running something from the library of babel in a link, or a source block via a file+blockname reference? A Hyperbole button would also be acceptable.
You can easily define your own link type that runs source blocks:
(org-link-set-parameters "run" :follow (lambda (path) (save-excursion (org-babel-goto-named-src-block path) (org-babel-execute-src-block-maybe))) )
Afterwards a click on
run:hello executes the source block in the following Orgmode file.
#+name: hello #+begin_src emacs-lisp (message "Hello") #+end_src #+RESULTS: hello : Hello run:hello
The usual way to do this is like this:
#+name: mysum #+BEGIN_SRC emacs-lisp (+ 5 5) #+END_SRC #+call: mysum() #+RESULTS: : 10
I am not sure what the point of doing this in a link would be, where would the results go for example?
You can make a link like this: [[elisp:(progn (org-babel-goto-named-src-block "mysum") (org-babel-execute-src-block-maybe))]]
which will jump to that block and run it.