emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] before emit an error message, try to load the babel language


From: lin Sun
Subject: Re: [PATCH] before emit an error message, try to load the babel language
Date: Sun, 23 Apr 2023 06:19:27 +0000

On Sat, Apr 22, 2023 at 12:42 PM Ihor Radchenko <yantar92@posteo.net> wrote:
> the cleanest way will be using `add-variable-watcher'.
Hi Ihor,
The "add-variable-watcher" may not be able to deal with the
local/global variable `org-babel-load-languages' correctly.

On Sat, Apr 22, 2023 at 8:33 AM Ruijie Yu <ruijie@netyu.xyz> wrote:
> Instead of that, I think you should have some sort of conditional in the
> `unless' condition.  Something like:
> --8<---------------cut here---------------start------------->8---
> (unless (or (fboundp cmd)
>             (ignore (and (alist-get lang org-babel-load-languages)
>                          (require (intern (concat "ob-" lang)))))
>             (fboundp cmd))
>   (error "... %s" lang))
> --8<---------------cut here---------------end--------------->8---
The logic in the patch will follow the function
`org-babel-do-load-languages' to load the ob-LANG without capturing
the error.
I changed the patch to follow your comments.
Please review the new patch I attached. Thanks.

Attachment: 0001-lisp-ob-core.el-load-lang-in-org-babel-execute-src-b.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]