On Sat, Apr 22, 2023 at 12:42 PM Ihor Radchenko 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 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.