Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-20 Thread Max Nikulin
On 17/04/2023 22:21, Ihor Radchenko wrote: Matt writes: I was able to resolve it by simply requiring `sh-script' in `org-src'. Committed and pushed. Note that it will break Emacs 26. org-protocol.el defines polyfill for `flatten-tree'.

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-17 Thread Ihor Radchenko
Matt writes: > I was able to resolve it by simply requiring `sh-script' in `org-src'. > Committed and pushed. Note that it will break Emacs 26. Which will fix itself once we merge compat.el support. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-17 Thread Matt
On Fri, 07 Apr 2023 11:29:59 -0400 Matt wrote --- > > On Tue, 04 Apr 2023 08:30:34 -0400 Ihor Radchenko wrote --- > > > See the attached tentative patch. > > After applying the patch, I get the following error when trying to load > Emacs: > > Warning (comp):

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-07 Thread Derek Chen-Becker
In the code I posted, I had to explicitly (require 'sh-script) to ensure that the sh-ancestor-alist is loaded before the code. I'm not enough of an elisp guru to know if there's a way to defer that. Cheers, Derek On Fri, Apr 7, 2023 at 9:30 AM Matt wrote: > > On Tue, 04 Apr 2023

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-07 Thread Matt
On Tue, 04 Apr 2023 08:30:34 -0400 Ihor Radchenko wrote --- > See the attached tentative patch. After applying the patch, I get the following error when trying to load Emacs: Warning (comp): /home/ahab/Projects/org-mode/lisp/org.el: Error: Symbol's value as variable is void

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-04 Thread Derek Chen-Becker
The patch looks good to me! Thanks, Derek On Tue, Apr 4, 2023 at 6:30 AM Ihor Radchenko wrote: > Derek Chen-Becker writes: > > > I fiddled around a little bit this weekend and confirmed that this > (sloppy) > > code makes highlighting work for all shell types that sh-script supports: > > > >

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-04 Thread Ihor Radchenko
Derek Chen-Becker writes: > I fiddled around a little bit this weekend and confirmed that this (sloppy) > code makes highlighting work for all shell types that sh-script supports: > > ;;A quick hack to try and support more shells syntax highlight in org babel > (require 'sh-script) > (require

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-03 Thread Derek Chen-Becker
I fiddled around a little bit this weekend and confirmed that this (sloppy) code makes highlighting work for all shell types that sh-script supports: ;;A quick hack to try and support more shells syntax highlight in org babel (require 'sh-script) (require 'ob-shell) (let ((shells (seq-filter

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-04-01 Thread Matt
On Thu, 30 Mar 2023 04:55:32 -0400 Ihor Radchenko wrote --- > Matt m...@excalamus.com> writes: > > > I think this approach will work fine. I tried examples for each shell > > type and keywords like if/then/else and function names are highlighted. > > Even for posh

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-31 Thread Ihor Radchenko
Derek Chen-Becker writes: > When I asked the question I was just thinking of using it as a reference > for expanding the current org-src-lang-modes values, but now that you've > asked the question, perhaps we could dynamically amend org-src-lang-modes > based on the contents of

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-31 Thread Derek Chen-Becker
When I asked the question I was just thinking of using it as a reference for expanding the current org-src-lang-modes values, but now that you've asked the question, perhaps we could dynamically amend org-src-lang-modes based on the contents of sh-ancestor-alist. Does that make sense? Thanks,

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-31 Thread Ihor Radchenko
Derek Chen-Becker writes: > Would it be fair to use the sh-ancestor-alist as a basis for all of the > supported shell variants? > > https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/sh-script.el#L177 How can we use it? -- Ihor Radchenko // yantar92, Org mode contributor, Learn

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-30 Thread Derek Chen-Becker
Would it be fair to use the sh-ancestor-alist as a basis for all of the supported shell variants? https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/sh-script.el#L177 Cheers, Derek On Thu, Mar 30, 2023 at 2:54 AM Ihor Radchenko wrote: > Matt writes: > > > I think this approach

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-30 Thread Ihor Radchenko
Matt writes: > I think this approach will work fine. I tried examples for each shell type > and keywords like if/then/else and function names are highlighted. Even for posh (powershell)? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-29 Thread Matt
On Wed, 29 Mar 2023 13:04:31 -0400 Derek Chen-Becker wrote --- > Cool, I would be happy to submit a patch! Sure, if that's something you'd enjoy. I'm happy to assist, if needed. > On Wed, Mar 29, 2023 at 3:33 AM Ihor Radchenko yanta...@posteo.net> wrote: > > Org provides some

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-29 Thread Derek Chen-Becker
Cool, I would be happy to submit a patch! Thanks, Derek On Wed, Mar 29, 2023 at 3:33 AM Ihor Radchenko wrote: > Matt writes: > > > Does anyone know which function is responsible for re-fontifing source > blocks? > > `org-src-font-lock-fontify-block', which is using major-mode's native >

Re: [BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-29 Thread Ihor Radchenko
Matt writes: > Does anyone know which function is responsible for re-fontifing source > blocks? `org-src-font-lock-fontify-block', which is using major-mode's native fontification. The major mode is determined by `org-src-get-lang-mode', which can be customized using `org-src-lang-modes'.

[BUG] No font lock in src blocks for shells in org-babel-shell-names (was Re: Font lock for org-babel shell scripts?)

2023-03-28 Thread Matt
Of the shells given in `org-babel-shell-names' (that is, "sh" "bash" "zsh" "fish" "csh" "ash" "dash" "ksh" "mksh" "posh"), only "sh" and "bash" have font locking in source blocks. For example, #+begin_src sh if [ -z $TEST ]; then echo Fontified fi #+end_src #+begin_src bash if [