From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 17 Nov 2016 15:05:58 -0800 From: Kyle Meyer Reply-To: kyleam/snakemake-mode Message-ID: In-Reply-To: References: Subject: Re: Not consider "input" a python keyword? (#20) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_582e37d6a3da5_70413fd9c8e7d13c68847"; 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_582e37d6a3da5_70413fd9c8e7d13c68847 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > Rules have an input and an output directive, which are often used by > name in code. I find it slightly annoying that `input` has the look of > a Python keyword, while output does not. Thanks for bringing this up. It's the result of python.el's `python-font-lock-keywords`, which assigns `font-lock-builtin-face` to "input" because `input` is a built-in function. Currently, Snakemake mode's `snakemake-font-lock-keywords` only overrides this when it thinks "input" is being used as a field key (i.e., matches "^ +input *:"), in which case `font-lock-type-face` is used. So, if I understand correctly, the main place where you're seeing "input" highlighted differently than "output" is in the `run:` body, while "input" in the `shell:` commands and in the `input:` field name is highlighted the same as "output". Is that right? > How do you feel about this? Would you consider changing > `snakemake-mode` to not consider `input` a keyword for > syntax-highlighting purposes? I agree that "input" and "output" should have the same look. Although Python's `input` function works fine in Snakefiles when used outside of rule blocks, I can't think of any good use-cases for it, so it doesn't make sense for `python-font-lock-keywords` to have priority here. I'm OK overriding `python-font-lock-keywords` and removing the highlighting of "input", but I wonder whether it's better to go the other way. Should output (and other built-in Snakemake objects that can be accessed in the run block, like "wildcards" and "params") be highlighted rather than removing the highlighting from input? -- 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/20#issuecomment-261398558 ----==_mimepart_582e37d6a3da5_70413fd9c8e7d13c68847 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Rules have an input and an output directive, which are often used by name in code. I find it slightly annoying that input has the= look of
a Python keyword, while output does not.

Thanks for bringing this up. It's the result of python.el's
python-font-lock-keywords, which assigns font-lock-bui= ltin-face to
"input" because input is a built-in function. Currently, Sn= akemake
mode's snakemake-font-lock-keywords only overrides this when= it
thinks "input" is being used as a field key (i.e., matches "^ +input *:")= ,
in which case font-lock-type-face is used.

So, if I understand correctly, the main place where you're seeing
"input" highlighted differently than "output" is in the run:= body,
while "input" in the shell: commands and in the input:= field name
is highlighted the same as "output". Is that right?

How do you feel about this? Would you consider changing
snakemake-mode to not consider input a keyword = for
syntax-highlighting purposes?

I agree that "input" and "output" should have the same look. Although=
Python's input function works fine in Snakefiles when used o= utside
of rule blocks, I can't think of any good use-cases for it, so it
doesn't make sense for python-font-lock-keywords to have pri= ority
here.

I'm OK overriding python-font-lock-keywords and removing = the
highlighting of "input", but I wonder whether it's better to go the
other way. Should output (and other built-in Snakemake objects that
can be accessed in the run block, like "wildcards" and "params") be
highlighted rather than removing the highlighting from input?

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