From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1891 invoked by alias); 4 Mar 2012 01:25:37 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30310 Received: (qmail 29182 invoked from network); 4 Mar 2012 01:25:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120303172521.ZM11549@torch.brasslantern.com> Date: Sat, 03 Mar 2012 17:25:21 -0800 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Regarding emulate: a thought, and refresh my memory? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii First the memory bump: The code in bin_emulate dating all the way back to Andrej's patch in zsh-workers/26425 rejects the combination of -L and -c. The stated reason for this is "do not confuse user who reads manuals." However, the -c option always restores everything at the end, and anyway one can always run emulate zsh -c 'setopt localoptions; ...' so I'm hoping someone can remind me why we bother throwing an error on that combination. The reason I ask is because it suddenly popped into my head that the emulate command might just as well parse other startup-time options besides just -c. Primarily this means that instead of e.g. emulate zsh -c 'setopt xtrace; blah blah blah ...' one could simply do emulate zsh -x -c 'blah blah blah ...' Simlarly there are all sorts of functions that begin with stuff like emulate -R zsh setopt extendedglob which could become emulate -R zsh -o extendedglob and off you go. I've got this 98% working by factoring a loop out of init.c:parseargs() but it seems silly that emulate -L zsh -c '...' throws an error when emulate zsh --localoptions -c '...' does not. (Of course -L means a bit more than --localoptions, but you see my point, I hope.)