From c4df88177766853ebaa9b4e8db96dcfe280977a0 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Thu, 11 May 2023 20:37:56 +0200 Subject: [PATCH] Zap aliases in `org-babel-active-languages' and sort the result --- README.org | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/README.org b/README.org index b6d4dc0..e50084a 100644 --- a/README.org +++ b/README.org @@ -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