From: Tom Gillespie <tgbugs@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: [PATCH] Fix hack-local-variables for find-file-literally with dos encoding
Date: Sun, 15 Aug 2021 15:21:19 -0700 [thread overview]
Message-ID: <CA+G3_PORBJ9RcBmNBpix-d2b_B-FRVgohmawyOjMfDFmxN7VQw@mail.gmail.com> (raw)
In-Reply-To: <87o89ygyu8.fsf@gnus.org>
> 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.
next prev parent reply other threads:[~2021-08-15 22:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-15 21:23 [PATCH] Fix hack-local-variables for find-file-literally with dos encoding Tom Gillespie
2021-08-15 21:35 ` Tom Gillespie
2021-08-15 21:52 ` Lars Ingebrigtsen
2021-08-15 22:14 ` Lars Ingebrigtsen
2021-08-15 22:31 ` Tom Gillespie
2021-08-15 22:21 ` Tom Gillespie [this message]
2021-08-15 22:39 ` Tom Gillespie
2021-08-15 23:09 ` Tom Gillespie
2021-08-16 11:32 ` Eli Zaretskii
2021-08-16 12:01 ` Lars Ingebrigtsen
2021-08-16 12:06 ` Lars Ingebrigtsen
2021-08-16 12:29 ` Eli Zaretskii
2021-08-16 12:53 ` Lars Ingebrigtsen
2021-08-16 13:22 ` Eli Zaretskii
2021-08-16 17:44 ` Tom Gillespie
2021-08-16 17:49 ` Stefan Monnier
2021-08-16 18:09 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+G3_PORBJ9RcBmNBpix-d2b_B-FRVgohmawyOjMfDFmxN7VQw@mail.gmail.com \
--to=tgbugs@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.