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

2023-04-26 Thread Ihor Radchenko
lin Sun writes: > I use the `setopt` in my dot-emacs now, and won't make code changes. > Please feel free to close this ticket, and any code change to enhance > the discussed issue is welcome. Thanks Ok. Canceled. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode

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

2023-04-26 Thread lin Sun
Hi Ihor, I use the `setopt` in my dot-emacs now, and won't make code changes. Please feel free to close this ticket, and any code change to enhance the discussed issue is welcome. Thanks

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

2023-04-26 Thread Ihor Radchenko
lin Sun writes: > Thank you all for the comments, and agree with no code change. > Please feel free to close this ticket. Thanks Will you still be interested to improve the patch covering all other cases in Org code where babel backend is used? Or using `add-variable-watcher'? -- Ihor

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

2023-04-26 Thread Ihor Radchenko
Ruijie Yu writes: >> And it is not us who needs to use `setopt', but users. >> We just have to deal with de facto situation with users using `setq' >> mindlessly. > > Makes sense. So, does that mean nothing should be changed, except for > maybe some additions to documentation mentioning that

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

2023-04-25 Thread lin Sun
Thank you all for the comments, and agree with no code change. Please feel free to close this ticket. Thanks

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

2023-04-25 Thread General discussions about Org-mode.
Ihor Radchenko writes: > Ruijie Yu writes: > >>> 1. `setopt' already triggers loading when variable is set. It is just >>>`setq', often used in place of `setopt', that does not trigger >>>loading/unloading. >> >> Speaking of which, since we now (or are about to?) depend on compat, we

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

2023-04-25 Thread Ihor Radchenko
Ruijie Yu writes: >> 1. `setopt' already triggers loading when variable is set. It is just >>`setq', often used in place of `setopt', that does not trigger >>loading/unloading. > > Speaking of which, since we now (or are about to?) depend on compat, we > can just do (require 'compat) and

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

2023-04-25 Thread General discussions about Org-mode.
Ihor Radchenko writes: > lin Sun writes: > >> Thanks for the comment. >> If we switch to the `add-variable-watcher', it seems we'll load the >> ob-LANG in the callback immediately. >> The previous change can lazyly load the babel languages until the user >> tries to evaluate the source block.

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

2023-04-25 Thread Ihor Radchenko
lin Sun writes: > Thanks for the comment. > If we switch to the `add-variable-watcher', it seems we'll load the > ob-LANG in the callback immediately. > The previous change can lazyly load the babel languages until the user > tries to evaluate the source block. Is there any advantage doing the

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

2023-04-24 Thread lin Sun
Hi Ihor, Thanks for the comment. If we switch to the `add-variable-watcher', it seems we'll load the ob-LANG in the callback immediately. The previous change can lazyly load the babel languages until the user tries to evaluate the source block.

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

2023-04-23 Thread Ihor Radchenko
lin Sun writes: > On Sat, Apr 22, 2023 at 12:42 PM Ihor Radchenko wrote: >> the cleanest way will be using `add-variable-watcher'. > The "add-variable-watcher" may not be able to deal with the > local/global variable `org-babel-load-languages' correctly. May you elaborate? -- Ihor Radchenko

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

2023-04-23 Thread lin Sun
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: >

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

2023-04-22 Thread Ihor Radchenko
lin Sun writes: > Before the error message, the patch will give a try to load the > associated babel language. > > Why does the language exist in the `lang org-babel-load-languages' but > not be loaded? > Because the `org-babel-load-languages' are defined as a customer > variable with :set

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

2023-04-22 Thread General discussions about Org-mode.
lin Sun writes: > Hi, > The function `org-babel-execute-src-block' will emit an error message > if the language is not loaded. > > Before the error message, the patch will give a try to load the > associated babel language. > > Why does the language exist in the `lang org-babel-load-languages'

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

2023-04-22 Thread lin Sun
Hi, The function `org-babel-execute-src-block' will emit an error message if the language is not loaded. Before the error message, the patch will give a try to load the associated babel language. Why does the language exist in the `lang org-babel-load-languages' but not be loaded? Because the