From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26538 invoked from network); 7 Oct 2006 02:55:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Oct 2006 02:55:19 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 73858 invoked from network); 7 Oct 2006 02:55:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Oct 2006 02:55:12 -0000 Received: (qmail 4432 invoked by alias); 7 Oct 2006 02:55:04 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10806 Received: (qmail 4421 invoked from network); 7 Oct 2006 02:55:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Oct 2006 02:55:04 -0000 Received: (qmail 72566 invoked from network); 7 Oct 2006 02:55:04 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 7 Oct 2006 02:55:03 -0000 Received: from torch.brasslantern.com ([71.116.118.106]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J6Q00HWBW3PFO43@vms042.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 06 Oct 2006 21:55:02 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k972t0kY029414 for ; Fri, 06 Oct 2006 19:55:00 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k972t0Ck029413 for zsh-users@sunsite.dk; Fri, 06 Oct 2006 19:55:00 -0700 Date: Fri, 06 Oct 2006 19:55:00 -0700 From: Bart Schaefer Subject: Re: Move command line options to start of line In-reply-to: <200610061507.k96F7nU8000999@news01.csr.com> To: zsh-users@sunsite.dk (Zsh users list) Message-id: <061006195500.ZM29412@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200610061507.k96F7nU8000999@news01.csr.com> Comments: In reply to Peter Stephenson "Move command line options to start of line" (Oct 6, 4:07pm) On Oct 6, 4:07pm, Peter Stephenson wrote: } } # This moves an option, possibly with arguments, from before the } # cursor to immediately after the command word. Nice, but not precisely what David Korn had in mind. Given zsh% ls -s file1 file2 -l the result of the command should be zsh% ls -s -l file1 file2 and not zsh% ls -l -s file1 file2 I don't think this can be done without removing the trailing option and its argument(s) from the line before finding the index of the place to insert them again. (Sufficiently deeply nested expansion might still accomplish this in a single replacement.)