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--