emacs-devel
[Top][All Lists]
Advanced

[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: Lars Ingebrigtsen
Subject: Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding
Date: Sun, 15 Aug 2021 23:52:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Tom Gillespie <tgbugs@gmail.com> writes:

>     This patch provides a test and a fix for an edge case when opening
> files literally that have dos crlf line endings. The patch was made
> against master, but a similar fix could be issued for a potential
> Emacs 27.3 release if one is forthcoming. Best!

There probably won't be a 27.3...

> -           (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

?  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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]