unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Winston <wbe@UBEBLOCK.psr.com.invalid>
To: help-gnu-emacs@gnu.org
Subject: Re: How does one disable (UTF-8?) input "fixup"?
Date: Tue, 12 Jan 2016 02:51:30 -0500	[thread overview]
Message-ID: <ydegdnkzgd.fsf@UBEblock.psr.com> (raw)
In-Reply-To: mailman.2153.1452527358.843.help-gnu-emacs@gnu.org

I originally asked:
>> What mode/variable controls text conversion/fixup when reading a file?

>> I have a mostly ASCII text file that contains a few stray non-ASCII
>> characters.

Eli Zaretskii <eliz@gnu.org> kindly replied:
> You need to prefix "C-x C-f" with "C-x RET c us-ascii RET".  See the
> node "Text Coding" in the Emacs manual.

> Or use "M-x find-file-literally" to disable any conversions.

Ah.  OK.  Thanks!

>> However, if I rename the file "foo.exe", do "emacs foo.exe" and
>> search, I see the original characters (no change).

> Emacs by default visits binary files without any conversions.

...which is what I expected and had been used to, and why I tried
renaming the file "foo.exe" as a work-around to prevent the conversions.
:-)

>> Curiously, after "emacs foo.exe", I did find-file-other-window to
>> read in "foo", and the characters were NOT altered.

> Because the file is already in an Emacs buffer, so Emacs doesn't
> re-read it, it just reuses that buffer's contents.

You appear to be referring to this feature of find-file-literally:

    "You cannot absolutely rely on this function to result in
     visiting the file literally.  If Emacs already has a buffer
     which is visiting the file, you get the existing buffer,
     regardless of whether it was created literally or not."

However, that wasn't the case I described.  I had identical content in
two separate disk files ("foo" and "foo.exe").  The files were not
linked (hard or symbolic).  [Think "bar" instead of "foo" if that
helps.]  I started emacs with "emacs foo.exe".  "foo" was not in any
Emacs buffer at that point.  I then used find-file-other-window to read
"foo".  That created a second buffer to hold "foo".  Although the
contents happened to be identical, from Emacs's standpoint, they were
two separate files in two separate buffers.  I was surprised that
character conversions upon reading "foo" as the second file into a
second buffer were in any way affected by having read some other file
into another buffer before it.

No matter...  You answered my question about how to prevent the
conversions without having to rename the file.  Thanks!
 -WBE


      parent reply	other threads:[~2016-01-12  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 10:16 How does one disable (UTF-8?) input "fixup"? Winston
2016-01-11 15:49 ` Eli Zaretskii
     [not found] ` <mailman.2153.1452527358.843.help-gnu-emacs@gnu.org>
2016-01-12  7:51   ` Winston [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ydegdnkzgd.fsf@UBEblock.psr.com \
    --to=wbe@ubeblock.psr.com.invalid \
    --cc=help-gnu-emacs@gnu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).