From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Syntax of "-" in shell-mode Date: Fri, 24 Jun 2016 14:11:38 -0700 (PDT) Message-ID: <1b7dffc4-a61b-4fb7-b94e-af72468d29f2@default> References: <87y45ucnyx.fsf@secretsauce.net> <87wplecn6s.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466802773 817 80.91.229.3 (24 Jun 2016 21:12:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jun 2016 21:12:53 +0000 (UTC) Cc: Emacs developers To: Dima Kogan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 24 23:12:41 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bGYOz-0004M8-MS for ged-emacs-devel@m.gmane.org; Fri, 24 Jun 2016 23:12:37 +0200 Original-Received: from localhost ([::1]:47347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGYOy-0008Q9-KS for ged-emacs-devel@m.gmane.org; Fri, 24 Jun 2016 17:12:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGYOE-0008Ow-I0 for emacs-devel@gnu.org; Fri, 24 Jun 2016 17:11:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGYO8-0002Q1-Hf for emacs-devel@gnu.org; Fri, 24 Jun 2016 17:11:49 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:29348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGYO8-0002Pn-8h for emacs-devel@gnu.org; Fri, 24 Jun 2016 17:11:44 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5OLBeeG008113 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 Jun 2016 21:11:41 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u5OLBe53028944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Jun 2016 21:11:40 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u5OLBdvH029978; Fri, 24 Jun 2016 21:11:40 GMT In-Reply-To: <87wplecn6s.fsf@secretsauce.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204739 Archived-At: > >> Hi. What do people think about giving "-" a syntax of "word" in > >> shell-mode? The rationale is that in this mode one is generally editin= g > >> shell commands where "-" precedes commandline options, and strings suc= h > >> 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'). >=20 > 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.