Zap aliases in `org-babel-active-languages' and sort the result

This commit is contained in:
Gerard Vermeulen 2023-05-11 20:37:56 +02:00
parent 3f31f3d094
commit c4df881777
1 changed files with 21 additions and 20 deletions

View File

@ -2529,45 +2529,46 @@ Return a list of items where the filename is the `car' of each item and the
#+header: :wrap "src emacs-lisp :results silent :tangle no"
#+begin_src emacs-lisp :exports both :results value pp
(defun org-babel-active-languages ()
(let ((result '("conf" "latex-extra-header" "latex-header" "text" "toml")))
(let ((result '("conf" "text" "toml")))
(mapatoms
(lambda (x)
(when (and
(string-prefix-p "org-babel-execute:" (symbol-name x))
(not (eq 'org-babel-shell-initialize (get x 'definition-name))))
;; Get rid of all sub-modes in `ob-shell':
(not (eq 'org-babel-shell-initialize (get x 'definition-name)))
;; Get rid of aliases:
(not (eq 'symbol (type-of (symbol-function x)))))
(when (symbol-file x)
(push (string-remove-prefix "org-babel-execute:" (symbol-name x))
result)))))
result))
(mapcar #'list (org-babel-active-languages))
(mapcar #'list (cl-sort (org-babel-active-languages) #'string<))
#+end_src
#+caption[Active Org Babel languages]:
#+caption: Active Org Babel languages.
#+RESULTS: lst:org-babel-active-languages
#+begin_src emacs-lisp :results silent :tangle no
(("calc")
("perl")
("lisp")
("eshell")
("maxima")
("fortran")
("D")
("C")
(("C")
("C++")
("latex-header")
("org")
("cpp")
("js")
("shell")
("elisp")
("latex-extra-header")
("latex")
("emacs-lisp")
("D")
("calc")
("conf")
("cpp")
("emacs-lisp")
("eshell")
("fortran")
("js")
("latex")
("latex-extra-header")
("latex-header")
("lisp")
("maxima")
("org")
("perl")
("scheme")
("shell")
("text")
("toml"))
#+end_src