From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14145 invoked by alias); 26 Sep 2016 18:03:01 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21978 Received: (qmail 28861 invoked from network); 26 Sep 2016 18:03:01 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.177):SA:0(0.0/5.0):. Processed in 0.560141 secs); 26 Sep 2016 18:03:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=DwbhR1aH0KaYhsHzqT6VxRL72kYLUje42Gi0JIFqJNI=; b=ws3rwoFI2b5RPvQTvMuyggHt8xvYsuicxI3XuTwg0jWdZvGYA4OzGVxOYRmhSUFJbg 7M68HfWz7t8aeQthF4p+ubmZ/TvTakO41zcrUqxlBzF7z83jZrZlBbcvMDsMCIM3+1YW pCDgYf4rzlRXcHxSuWsonxVM94qYnk1zvLtLvr5GxLoLSg1VkC8cCQz3ViqkLb2OvHRJ yUdWhnO/C+qd41fd7nr12dD8Q8xCXWMIhYzKeyoLmJ6yb++1DpF1TEzMFIFMW4FptBXN VI5dbjJSiGndOHkz86GvjJRrMlPhI0B7gwBQ03/OGc2wpXjYDWwNBBfh0vaQj779LeCw 2/Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=DwbhR1aH0KaYhsHzqT6VxRL72kYLUje42Gi0JIFqJNI=; b=d7WauTrkowCEOsqgx92rUJc5eWsJRRhjsQb1wDDl1i6By0OuPHeKRswcNhBE3fLteE ObdyOdqngJzRo53rMyxqUmOT01sGBJc2CeShzhqUZFDeOhxsTtgkVOoR/n24vM4Gsg5I SUDf7b2kKLnOp1C7AJJOLHwt49kC5o2tbP7Ea5x2sw1am9/GA9G/4YNTexvYdhlkV2eL YWyYnemc4+YrWzvUyMe07ccOvijOuF0nE4Y83hXL/PvaHsL+AB/QIpzVy1WmCT+XrXm1 sTegcT/YXKaIEsWO2/lXycZaUVEgfMt+HaRj0n5P+j7kGdWf+bhFgskWRPG7wi/LS/L4 LgYQ== X-Gm-Message-State: AE9vXwNnAZixGuP/ZOJL5BBUT7c3Yt7KtfclrMbRgcq+HfP+faGtvAMy0WT7OC3VC1pniw== X-Received: by 10.98.10.145 with SMTP id 17mr40385612pfk.144.1474912973512; Mon, 26 Sep 2016 11:02:53 -0700 (PDT) From: Bart Schaefer Message-Id: <160926110305.ZM27464@torch.brasslantern.com> Date: Mon, 26 Sep 2016 11:03:05 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Feature request: set extension for =( ) created file" (Sep 25, 8:17am) References: <4DC55226-A041-42E5-B8B1-3AB1E7E6AB53@macports.org> <1082821474761933@web24j.yandex.ru> <160924221731.ZM30342@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Feature request: set extension for =( ) created file MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 25, 8:17am, Sebastian Gniazdowski wrote: } } First thing that came to my mind is use of [], not () like Nikolay } proposed, so e.g. vim =( cat ... )[java], although it also suffers } from colliding with globbing, which is IMO a serious drawback. Hmm ... maybe colliding with globbing is exactly what we need. Consider (line breaks added for readability): vim =( git -C /home/user/github/proj.git cat-file blob 1e08920 )(e?'reply=($REPLY.java); ln $REPLY $reply'?) This covers everything that's wanted except for the auto-removal of the .java file; even "java" can be replaced by a $(git ls-tree ...) to obtain the file extension. So if we could replace "ln" with a builtin that implements "make this link, but remove it when the current command context finishes" we'd have a complete solution. One step further to make it it's own glob qualifier (hardest part may be coming up with what character to use) and we're set. In the meantime, alias vimtmp='() { { vim $1 } always { rm $1 } }' And, good grief, I just realized this is another answer to FAQ #2.3.