Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Feature request: set extension for =( ) created file



On 24 September 2016 at 21:55, Lawrence Velázquez <larryv@xxxxxxxxxxxx> wrote:
>> On Sep 24, 2016, at 3:30 PM, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
>>
>> What vim does is a fancy ignorable thing for some, what other program
>> might do might not be. Extensions are vital parts of file names.
>
> Not really. 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.

Yeah, one of such programs is Vim and it fails recognizing e.g.
ctags/awk.c as ft=zsh.

>> Extension-aware =( ) would be a masterpiece feature for Zsh, though,
>> IMO.
>
> Unless it were implemented using libmagic or something, I would consider
> it a massive waste of time and effort.

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.

Best regards,
Sebastian Gniazdowski



Messages sorted by: Reverse Date, Date, Thread, Author