From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1288 invoked by alias); 24 Sep 2016 20:36:22 -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: 21965 Received: (qmail 25110 invoked from network); 24 Sep 2016 20:36:22 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.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(66.111.4.26):SA:0(0.0/5.0):. Processed in 0.152417 secs); 24 Sep 2016 20:36:22 -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: larryv@macports.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at macports.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ioleUtXH9RpSnjs 9AHi43LncQQk=; b=GNJA8ShSwB391XnzvKW91BUPneTQnPL/6bxgisOn5PkkWa7 2ZQfmP5kZWgXryHx/lMMQUDUbrc4XtJgQymEpy+fMnqwkMC/DutFva/h8YNTqkLo 7FS9ZQtzE7MGYtX6++dB/y5Gu18tBhZhDL34QsPJBjEXkRAkht1EmvUNkho0= X-Sasl-enc: jngaTFRia9uzHVoFqx/WViAocmXDVmI3ain9SEn83+OG 1474749379 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Feature request: set extension for =( ) created file From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= In-Reply-To: Date: Sat, 24 Sep 2016 16:36:19 -0400 Cc: zsh-users@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <2225F03B-B940-40CF-8582-2FF912CA01E6@macports.org> References: <4DC55226-A041-42E5-B8B1-3AB1E7E6AB53@macports.org> To: Sebastian Gniazdowski X-Mailer: Apple Mail (2.3124) > On Sep 24, 2016, at 4:14 PM, Sebastian Gniazdowski > wrote: >=20 >> On 24 September 2016 at 21:55, Lawrence Vel=C3=A1zquez >> wrote: >>=20 >> Any competently written program that cares about the structure of its >> input has some other way of validating said structure, like actually >> parsing it or checking for a file signature / header / magic number. >> Programs that process stdin already have to do this. >=20 > Yeah, one of such programs is Vim and it fails recognizing e.g. > ctags/awk.c as ft=3Dzsh. Then vim's file detection logic needs work. (Or maybe your vim is not configured correctly. I downloaded ctags literally 30 seconds ago and opened awk.c, and my vim set filetype=3Dc correctly.) Not zsh's problem. >>> Extension-aware =3D( ) would be a masterpiece feature for Zsh, >>> though, IMO. >>=20 >> Unless it were implemented using libmagic or something, I would >> consider it a massive waste of time and effort. >=20 > What time and effort? I guess it can be a beautiful few lines patch. > Modify name of file? Something like strcat. Parsing clever syntax that > would provide the extension? Also possibly basic. A few lines (of C!) to reliably detect dozens/hundreds/thousands of file formats? Okay. (FWIW, file(1) -- a whole program/library made expressly for this purpose -- gives me hilariously bad results on a regular basis.) vq=