[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix hack-local-variables for find-file-literally with dos en
From: |
Tom Gillespie |
Subject: |
Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding |
Date: |
Sun, 15 Aug 2021 15:21:19 -0700 |
> There probably won't be a 27.3...
Ok, good to know.
> > - (subst-char-in-region (point) (point-max) ?\^m ?\n)
> > + (unless noconv
> > + (subst-char-in-region (point) (point-max) ?\^m ?\n))
>
> I don't quite understand the logic here -- shouldn't this be a
>
> (when noconv
No, when we read a file literally we don't want to normalize anything.
The issue is that 'when noconv' is set (i.e. we are in find-file-literally)
then we don't want to convert ?\^m because the value of suffix
contains ?\^m. Does this make sense? I tried other approaches
including modifying the suffix but this one was by far the cleanest.
> ? That is, if we're visiting the file literally, we want to delete the
> carriage returns, but not otherwise? (If we're not visiting the file
> literally, the CRLFs will already have been translated into newlines.)
>
> > + (with-current-buffer (find-file-literally tempfile)
> > + (hack-local-variables)))
>
> Should probably be a `should' in here to make it work as a test, I think.
I think that is right, it kind of works at the moment because the previous
behavior produces an error.
- [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Tom Gillespie, 2021/08/15
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Tom Gillespie, 2021/08/15
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Lars Ingebrigtsen, 2021/08/15
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Lars Ingebrigtsen, 2021/08/16
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Lars Ingebrigtsen, 2021/08/16
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Eli Zaretskii, 2021/08/16
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Lars Ingebrigtsen, 2021/08/16
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Eli Zaretskii, 2021/08/16
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Tom Gillespie, 2021/08/16
- Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding, Stefan Monnier, 2021/08/16