[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Syntax of "-" in shell-mode
From: |
Ivan Andrus |
Subject: |
Re: Syntax of "-" in shell-mode |
Date: |
Fri, 24 Jun 2016 15:55:45 -0600 |
On Fri, Jun 24, 2016 at 3:05 PM, Dima Kogan <address@hidden> wrote:
> Drew Adams <address@hidden> writes:
>
>>> Hi. What do people think about giving "-" a syntax of "word" in
>>> shell-mode? The rationale is that in this mode one is generally editing
>>> shell commands where "-" precedes commandline options, and strings such
>>> as "--help" generally represent a single semantic token.
I'm not in favor. I like the distinction between words and symbols.
>>> More specifically if I have something like "xxx --yyy" with the point in
>>> the whitespace, and I invoke (transpose-words) I want the result to be
>>> "--yyy xxx" and not "yyy --xxx". The latter means something very
>>> different in a shell command.
It's already has symbol syntax which allows transpose-sexps to work.
Personally, I find that I regularly do want to change --yyy xxx to --xxx yyy.
That probably has to do with the style of typos that I commit.
>> Maybe not so simple. A shell command can involve lots of stuff,
>> including arguments to commands that use their own syntax (think
>> `find').
>
> Of course the true syntax depends on context, but in my experience, in
> shell commands "-" is a word far more often than it isn't.
I disagree. They are symbols, not words. I don't want forward-word to skip
past dashes, that's a job for forward-sexp.
-Ivan