From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 12 Feb 2018 02:19:33 +0000 (UTC) From: Elmar Pruesse Reply-To: kyleam/snakemake-mode Message-ID: Subject: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a80f9b5cdabf_41022ad14a426ecc36912c"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Subscribed ----==_mimepart_5a80f9b5cdabf_41022ad14a426ecc36912c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Since it's already supported for embedded R, any chance to do this for embedded bash? It may make sense for not just the `shell:` field, but for all strings as they are likely to be passed through the shell at some point. Although that might be too slow, considering the number of small pieces. Alternatively, highlighting the `{wildcard}` parts of the strings would be neat. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25 ----==_mimepart_5a80f9b5cdabf_41022ad14a426ecc36912c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Since it's already supported for embedded R, any chance to do this for embedded bash?

It may make sense for not just the shell: field, but for all strings as they are likely to be passed through the shell at some point. Although that might be too slow, considering the number of small pieces.

Alternatively, highlighting the {wildcard} parts of the strings would be neat.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

----==_mimepart_5a80f9b5cdabf_41022ad14a426ecc36912c-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 12 Feb 2018 03:41:42 +0000 (UTC) From: Kyle Meyer Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a810cf6a6eb8_57532acf0e5e0ecc43353"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Kyle Meyer , Your activity ----==_mimepart_5a810cf6a6eb8_57532acf0e5e0ecc43353 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > Since it's already supported for embedded R, any chance to do this for embedded bash? Thanks for the suggestion. The thought hadn't occurred to me. (Well, the embedded R fontification didn't occur to me either. @endrebak added that feature.) The R highlighting depends on finding triple quote markers like `R("""`. I'm not sure if doing that for a `shell: ".*` with mmm-mode would be more complicated to handle or more expensive to process. Worth looking into. > Alternatively, highlighting the {wildcard} parts of the strings would be neat. Yeah, I think that'd be nice to add. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25#issuecomment-364822250 ----==_mimepart_5a810cf6a6eb8_57532acf0e5e0ecc43353 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Since it's already supported for embedded R, any chance to do this for e= mbedded bash?

Thanks for the suggestion. The thought hadn't occurred to me. (Well, the embedded R fontification didn't occur to me either. @endrebak
added that feature.)

The R highlighting depends on finding triple quote markers like
R(""". I'm not sure if doing that for a shell: ".* with mmm-mode
would be more complicated to handle or more expensive to process.
Worth looking into.

Alternatively, highlighting the {wildcard} parts of the strings would be= neat.

Yeah, I think that'd be nice to add.

&mda= sh;
You are receiving this because you are subscribed to this thread.<= br />Reply to this email directly, view it on GitHub, or mute the thread.3D""

= ----==_mimepart_5a810cf6a6eb8_57532acf0e5e0ecc43353-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 12 Feb 2018 00:46:56 -0800 From: Endre Bakken Stovner Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a81548065a2a_5aec3f9f2449af2c30317c"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Kyle Meyer , Comment ----==_mimepart_5a81548065a2a_5aec3f9f2449af2c30317c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This sounds like a good idea, but I do not use the R syntax highlighting = anymore since using scripts or wrappers is recommended. There were some hiccups mixing modes with mmm for me. R indentation in Sn= akemake buffers became weird for example. If you=E2=80=99ve had no proble= ms using it you should attempt to implement this :) -- = You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25#issuecomment-364859637= ----==_mimepart_5a81548065a2a_5aec3f9f2449af2c30317c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

This sounds like a good idea, but I do not use the R syntax highlighti= ng anymore since using scripts or wrappers is recommended.

There were some hiccups mixing modes with mmm for me. R indentation in= Snakemake buffers became weird for example. If you=E2=80=99ve had no pro= blems using it you should attempt to implement this :)

&m= dash;
You are receiving this because you commented.
Reply to th= is email directly, view it on GitHub, or mute the thread.3D""

= ----==_mimepart_5a81548065a2a_5aec3f9f2449af2c30317c-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 12 Feb 2018 08:48:46 +0000 (UTC) From: Endre Bakken Stovner Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a8154ee734f0_201b3f9a55234f2c305047"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Kyle Meyer , Comment ----==_mimepart_5a8154ee734f0_201b3f9a55234f2c305047 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E2=80=9CIt may make sense for not just the shell: field, but for all strin= gs as they are likely to be passed through the shell at some point.=E2=80= =9D This I do not understand? Shell highlighting for all strings? --=20 You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25#issuecomment-364860085= ----==_mimepart_5a8154ee734f0_201b3f9a55234f2c305047 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

=E2=80=9CIt may make sense for not just the shell: field, but for all st= rings as they are likely to be passed through the shell at some point.=E2= =80=9D

This I do not understand? Shell highlighting for all strings?

&mda= sh;
You are receiving this because you commented.
Reply to this e= mail directly, view it on GitHub, or mute the thread.3D""

= ----==_mimepart_5a8154ee734f0_201b3f9a55234f2c305047-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 12 Feb 2018 12:44:01 -0800 From: Elmar Pruesse Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a81fc91aa111_65ce2b06b8a0eecc22857"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Kyle Meyer , Comment ----==_mimepart_5a81fc91aa111_65ce2b06b8a0eecc22857 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > This I do not understand? Shell highlighting for all strings? Yep :) I tried implementing this with `polymode` a while back -- it sort of worked but was slow enough to be annoying, although that's perhaps my lack of skill with lisp. I eventually got stuck when I realized that the "bash parts" are actually "bash + python format mini language": the curly braces kept messing things up. Deriving a python-string-shell-mode from shell-mode was beyond me. Perhaps the low hanging fruit - just applying font locks to the python format mini language parts - would suffice. Although that one should probably just be implemented in python-mode? Curious that python-mode doesn't do that already... -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25#issuecomment-365055718 ----==_mimepart_5a81fc91aa111_65ce2b06b8a0eecc22857 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

This I do not understand? Shell highlighting for all strings?

Yep :)

I tried implementing this with polymode a while back -- i= t sort of worked but was slow enough to be annoying, although that's perh= aps my lack of skill with lisp. I eventually got stuck when I realized th= at the "bash parts" are actually "bash + python format mini language": th= e curly braces kept messing things up. Deriving a python-string-shell-mo= de from shell-mode was beyond me.

Perhaps the low hanging fruit - just applying font locks to the python= format mini language parts - would suffice. Although that one should pro= bably just be implemented in python-mode? Curious that python-mode doesn'= t do that already...

&m= dash;
You are receiving this because you commented.
Reply to th= is email directly, view it on GitHub, or mute the thread.3D""

= ----==_mimepart_5a81fc91aa111_65ce2b06b8a0eecc22857-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 13 Feb 2018 01:32:37 +0000 (UTC) From: Kyle Meyer Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a824034e6833_63f63fd55d20af2c2171c2"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Kyle Meyer , Your activity ----==_mimepart_5a824034e6833_63f63fd55d20af2c2171c2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit >> This I do not understand? Shell highlighting for all strings? > > Yep :) > > I tried implementing this with `polymode` a while back -- it sort of worked but was slow enough to be annoying, although that's perhaps my lack of skill with lisp. I eventually got stuck when I realized that the "bash parts" are actually "bash + python format mini language": the curly braces kept messing things up. Deriving a python-string-shell-mode from shell-mode was beyond me. I share @endrebak's confusion on the "all strings" bit. It doesn't seem like it'd be useful to highlight fields like input/output/threads as bash. > Perhaps the low hanging fruit - just applying font locks to the python > format mini language parts - would suffice. I see them as mostly orthogonal, at least in implementation. The mini-language parts would be highlighted via snakemake-font-lock-keywords; the shell string would need mmm-mode (or or another similar mode). The mini-language parts would be highlighted by default; for the shell string, users would have to install/activate mmm-mode, like they now have to do for R bits, and I believe it'd override any other fontification. Anyway, I'll plan to add highlighting for at least some mini-language parts. For the shell mmm-mode stuff, I may find time to play around with it (I don't use mmm-mode/wouldn't use this feature personally), but I'd certainly welcome a PR adding it if you get something working nicely. > Although that one should probably just be implemented in python-mode? Curious that python-mode doesn't do that already... Dunno. I suppose I can't think of any programming modes that have special fontification of formatting specs (e.g., emacs-lisp-mode: (format "all string %s" "font")), but there are of course lots out there, so there may be good examples. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25#issuecomment-365121740 ----==_mimepart_5a824034e6833_63f63fd55d20af2c2171c2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable >> This I do not understand? Shell highlighting for all strings?
>
> Yep :)
>
> I tried implementing this with `polymode` a while back -- it sort of w= orked but was slow enough to be annoying, although that's perhaps my la= ck of skill with lisp. I eventually got stuck when I realized that the &quo= t;bash parts" are actually "bash + python format mini language&qu= ot;: the curly braces kept messing things up. Deriving a python-string-she= ll-mode from shell-mode was beyond me.

I share @endrebak's confusion on the "all strings" bit. It d= oesn't seem
like it'd be useful to highlight fields like input/output/threads as
bash.

> Perhaps the low hanging fruit - just applying font locks to the python=
> format mini language parts - would suffice.

I see them as mostly orthogonal, at least in implementation. The
mini-language parts would be highlighted via
snakemake-font-lock-keywords; the shell string would need mmm-mode (or
or another similar mode). The mini-language parts would be highlighted
by default; for the shell string, users would have to install/activate
mmm-mode, like they now have to do for R bits, and I believe it'd
override any other fontification.

Anyway, I'll plan to add highlighting for at least some mini-language parts. For the shell mmm-mode stuff, I may find time to play around
with it (I don't use mmm-mode/wouldn't use this feature personally)= , but
I'd certainly welcome a PR adding it if you get something working
nicely.

> Although that one should probably just be implemented in python-mode? = Curious that python-mode doesn't do that already...

Dunno. I suppose I can't think of any programming modes that have
special fontification of formatting specs (e.g., emacs-lisp-mode:
(format "all string %s" "font")), but there are of cour= se lots out
there, so there may be good examples.

&mda= sh;
You are receiving this because you are subscribed to this thread.<= br />Reply to this email directly, view it on GitHub, or mute the thread.3D""

= ----==_mimepart_5a824034e6833_63f63fd55d20af2c2171c2-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 16 Feb 2018 17:37:53 -0800 From: Kyle Meyer Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a8787717ecb2_6ff42ab3265baec445745"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Kyle Meyer , Your activity ----==_mimepart_5a8787717ecb2_6ff42ab3265baec445745 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit OK, so I've played around with adding the different fontification for the minilanguage parts, and ... I really don't like it! :) I think the thing is, my brain is so used to a break in the string fontfication signaling the end of a string, so all my strings just look broken. Dunno, perhaps it's something I'd get used to. To try this out yourself, you could do something like (changing `font-lock-variable-name-face` to whatever face you'd like): ``` (add-to-list 'snakemake-font-lock-keywords `("{[^}]+}" 0 font-lock-variable-name-face t)) ``` What do others think? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25#issuecomment-366404799 ----==_mimepart_5a8787717ecb2_6ff42ab3265baec445745 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

OK, so I've played around with adding the different fontification for = the minilanguage parts, and ... I really don't like it! :) I think the t= hing is, my brain is so used to a break in the string fontfication signal= ing the end of a string, so all my strings just look broken. Dunno, perh= aps it's something I'd get used to.

To try this out yourself, you could do something like (changing = font-lock-variable-name-face to whatever face you'd like):

(add-to-list 'snakemake-font-lock-keywords
             `("{[^}]+}" 0 font-lock-variable-name-face t))

What do others think?

&m= dash;
You are receiving this because you are subscribed to this thre= ad.
Reply to this email directly, view it on GitHub= , or mute the thread.

= ----==_mimepart_5a8787717ecb2_6ff42ab3265baec445745-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 13 Apr 2020 16:52:55 -0700 From: Kyle Meyer Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: shell/bash highlighting? (#25) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5e94fb57c61ad_22423f8b3eecd96c1461db"; charset=UTF-8 Content-Transfer-Encoding: 7bit List-ID: kyleam/snakemake-mode List-Archive: https://github.com/kyleam/snakemake-mode List-Post: List-Unsubscribe: , To: kyleam/snakemake-mode Cc: Kyle Meyer , Your activity ----==_mimepart_5e94fb57c61ad_22423f8b3eecd96c1461db Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Closed #25. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kyleam/snakemake-mode/issues/25#event-3228955037 ----==_mimepart_5e94fb57c61ad_22423f8b3eecd96c1461db Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #25.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

----==_mimepart_5e94fb57c61ad_22423f8b3eecd96c1461db--