emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Emacs-29.0.60: (setopt org-babel-load-languages ...) may cause warnings
@ 2023-01-31  7:19 gerard.vermeulen
  2023-01-31 10:34 ` Ihor Radchenko
  0 siblings, 1 reply; 8+ messages in thread
From: gerard.vermeulen @ 2023-01-31  7:19 UTC (permalink / raw)
  To: Emacs orgmode

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

Hi,

I have been replacing to calls to =custom-set-variables= with calls to 
the safer
=setopt= (new in Emacs-29.0.60) and I discovered that calling
src_emacs-lisp{(setopt org-babel-load-languages '((eshell t) (emacs-lisp 
t)))}
raises a warning because =eshell= is missing from the 
=org-babel-load-languages=
=defcustom=.  The code below shows that this =defcustom= is quit out of 
sync with
the rest of the code base:

#+header: :wrap "src emacs-lisp :results silent :tangle no"
#+begin_src emacs-lisp :exports both :results value pp :exports both
(defun all-org-babel-execute-fns ()
   "Find `ob-LANGUAGE' files in Org defining 
`org-babel-execute:LANGUAGE'.

Return a list of items where the filename is the `car' of each item and 
the
`cdr' of each item lists the `org-babel-execute:LANGUAGE' functions."
   (let* ((dir (file-name-parent-directory (locate-library "org")))
          (names (directory-files dir t (rx "ob-" (+ print)  ".el" 
eos))))
     (cl-loop for name in names
              for found = (has-org-babel-execute-fn name)
              when found collect found)))

(defun has-org-babel-execute-fn (name)
   (let* ((buffer (find-file-noselect name))
          (base (file-name-base (buffer-file-name buffer)))
          (regexp (rx "defun" (+ blank) "org-babel-execute:" (group (+ 
graphic))))
          (matches))
     (save-match-data
       (save-excursion
         (with-current-buffer buffer
           (save-restriction
             (widen)
             (goto-char 1)
             (while (re-search-forward regexp nil t 1)
               (push (match-string-no-properties 1) matches))))))
     (when matches
       `(,base ,@matches))))

(all-org-babel-execute-fns)
#+end_src

#+RESULTS:
#+begin_src emacs-lisp :results silent :tangle no
(("ob-C" "C" "D" "C++" "cpp")
  ("ob-R" "R")
  ("ob-awk" "awk")
  ("ob-calc" "calc")
  ("ob-clojure" "clojurescript" "clojure")
  ("ob-css" "css")
  ("ob-ditaa" "ditaa")
  ("ob-dot" "dot")
  ("ob-emacs-lisp" "emacs-lisp")
  ("ob-eshell" "eshell")
  ("ob-forth" "forth")
  ("ob-fortran" "fortran")
  ("ob-gnuplot" "gnuplot")
  ("ob-groovy" "groovy")
  ("ob-haskell" "haskell")
  ("ob-java" "java")
  ("ob-js" "js")
  ("ob-julia" "julia")
  ("ob-latex" "latex")
  ("ob-lilypond" "lilypond")
  ("ob-lisp" "lisp")
  ("ob-lua" "lua")
  ("ob-makefile" "makefile")
  ("ob-maxima" "maxima")
  ("ob-ocaml" "ocaml")
  ("ob-octave" "octave" "matlab")
  ("ob-org" "org")
  ("ob-perl" "perl")
  ("ob-plantuml" "plantuml")
  ("ob-processing" "processing")
  ("ob-python" "python")
  ("ob-ruby" "ruby")
  ("ob-sass" "sass")
  ("ob-scheme" "scheme")
  ("ob-screen" "screen")
  ("ob-sed" "sed")
  ("ob-shell" "shell")
  ("ob-sql" "sql")
  ("ob-sqlite" "sqlite"))
#+end_src

The attached patch synchronizes the =defcustom= with the rest of the
code base, groups languages by org-babel file, and uses camel-case to
spell languages (the new fashion).

Best regards -- Gerard

[-- Attachment #2: fix-org-babel-load-languages.patch --]
[-- Type: application/octet-stream, Size: 2151 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index 1947c63a8..a3471ff64 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -302,42 +302,44 @@ requirement."
 		:key-type
 		(choice
 		 (const :tag "Awk" awk)
-		 (const :tag "C" C)
+		 (const :tag "C, D, C++, and cpp" C)
 		 (const :tag "R" R)
                  (const :tag "Calc" calc)
-		 (const :tag "Clojure" clojure)
+		 (const :tag "Clojure and ClojureScript" clojure)
 		 (const :tag "CSS" css)
 		 (const :tag "Ditaa" ditaa)
 		 (const :tag "Dot" dot)
                  (const :tag "Emacs Lisp" emacs-lisp)
+                 (const :tag "Eshell" eshell)
 		 (const :tag "Forth" forth)
 		 (const :tag "Fortran" fortran)
-		 (const :tag "Gnuplot" gnuplot)
+		 (const :tag "GnuPlot" gnuplot)
+		 (const :tag "Groovy" groovy)
 		 (const :tag "Haskell" haskell)
                  (const :tag "Java" java)
-		 (const :tag "Javascript" js)
-		 (const :tag "LaTeX" latex)
-                 (const :tag "Lilypond" lilypond)
+		 (const :tag "JavaScript" js)
+                 (const :tag "Julia" julia)
+                 (const :tag "LaTeX" latex)
+                 (const :tag "LilyPond" lilypond)
 		 (const :tag "Lisp" lisp)
+                 (const :tag "Lua" lua)
 		 (const :tag "Makefile" makefile)
 		 (const :tag "Maxima" maxima)
-		 (const :tag "Matlab" matlab)
-                 (const :tag "Ocaml" ocaml)
-		 (const :tag "Octave" octave)
+                 (const :tag "OCaml" ocaml)
+		 (const :tag "Octave and MatLab" octave)
 		 (const :tag "Org" org)
 		 (const :tag "Perl" perl)
-		 (const :tag "Pico Lisp" picolisp)
+                 (const :tag "Processing" processing)
 		 (const :tag "PlantUML" plantuml)
 		 (const :tag "Python" python)
 		 (const :tag "Ruby" ruby)
 		 (const :tag "Sass" sass)
-		 (const :tag "Scala" scala)
 		 (const :tag "Scheme" scheme)
 		 (const :tag "Screen" screen)
+                 (const :tag "Sed" sed)
 		 (const :tag "Shell Script" shell)
                  (const :tag "Sql" sql)
-		 (const :tag "Sqlite" sqlite)
-		 (const :tag "Stan" stan))
+		 (const :tag "Sqlite" sqlite))
 		:value-type (boolean :tag "Activate" :value t)))
 
 ;;;; Customization variables

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-03 14:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31  7:19 [BUG] Emacs-29.0.60: (setopt org-babel-load-languages ...) may cause warnings gerard.vermeulen
2023-01-31 10:34 ` Ihor Radchenko
2023-02-01 14:22   ` gerard.vermeulen
2023-02-02  8:26     ` Ihor Radchenko
2023-02-02 19:33       ` gerard.vermeulen
2023-03-03 14:58         ` Ihor Radchenko
2023-02-28  9:31       ` Bastien Guerry
2023-03-03 15:00         ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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