Monday, July 14, 2014

Re: RFE: honor 'eol' setting regardless of 'binary' flag.

On 14.07.14 10:01, Christian Brabandt wrote:
> I'll look into it but not sure, Bram will accept such a change.
> For the time being, I think a autocommand such as this should work
> (untested, but the idea should be clear):

> fu! DetectNoEOL()
> if !&eol
> au BufWrite <buffer> :set binary noeol
> au BufWritePost <buffer> :set nobinary
> endif
> endfu
>
> augroup EOL
> au!
> au BufEnter * :call DetectNoEOL()
> augroup


Hi Christian,

While that looks good to go, there will be side effects, IIUC.
With binary set for the duration of the edit session, the stuff at
":h binary" will be clobbered. AIUI, that's why the scripting at the URL
provided upthread sets it only temporarily. Having not tried that
script, I can't vouch for its perfection, but user satisfaction is
expressed on the web page.

Being able to deal with broken file formats seems marginally acceptable,
but only if there is prevention of proliferation of such formats in
public VCSs. Since the use of broken editors cannot be prevented there,
the only way to protect the VCS seems to be a file format filter on
check-ins. CVS supports that, but does GIT, I wonder? Fortunately we
have the maintainers as a last resort.

Erik

--
As Saint-Exupery said,
"Perfection [in design] is achieved not when there is nothing more to
add, but rather when there is nothing more to take away."

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment