all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Dima Kogan <lists@dima.secretsauce.net>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: RE: Syntax of "-" in shell-mode
Date: Fri, 24 Jun 2016 14:11:38 -0700 (PDT)	[thread overview]
Message-ID: <1b7dffc4-a61b-4fb7-b94e-af72468d29f2@default> (raw)
In-Reply-To: <87wplecn6s.fsf@secretsauce.net>

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

One thing that could perhaps be done is to set the `syntax-table'
text property on the zone of text up through the last switch.
You might try it.



  reply	other threads:[~2016-06-24 21:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 20:48 Syntax of "-" in shell-mode Dima Kogan
2016-06-24 20:58 ` Drew Adams
2016-06-24 21:05   ` Dima Kogan
2016-06-24 21:11     ` Drew Adams [this message]
2016-06-24 21:55     ` Ivan Andrus
2016-07-07 17:49       ` Dima Kogan
2016-06-25  7:06 ` Eli Zaretskii
2016-06-25  7:12   ` Dima Kogan
2016-06-25  7:27     ` Andreas Schwab
2016-06-25  8:27       ` Eli Zaretskii
2016-06-26  3:31       ` Dima Kogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b7dffc4-a61b-4fb7-b94e-af72468d29f2@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=lists@dima.secretsauce.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.