Stefan Monnier | 26 Jun 2012 01:21
Picon

Re: non-ASCII characters in auto-save files

>     - Can Emacs be persuaded to to encode auto-save files in a more useful
> manner ?

No.  Auto-save files are encoded using Emacs's internal coding-system,
which makes the operation a lot more reliable and efficient (no need to
worry about the case where some char(s) can't be encoded, for example).

>     - Is there a systematic way to convert #myfile# to iso-latin-9 (or
> iso-latin-1) code, other than painstakingly searching and replacing
> offending chars ?

Just open the file with the right coding-system (typically, opening
"myfile" and then hitting M-x recover-this-file RET should do the
trick).

        Stefan

grivet | 26 Jun 2012 12:13
Picon
Favicon

Re: non-ASCII characters in auto-save files


     - Is there a systematic way to convert #myfile# to iso-latin-9 (or
iso-latin-1) code, other than painstakingly searching and replacing
offending chars ?

> Just open the file with the right coding-system (typically, opening
> "myfile" and then hitting M-x recover-this-file RET should do the
> trick).
>
>
>          Stefan
#myfile# c&n be opened in this way but cannot be saved, as the coding 
system is not recognized.
JP Grivet

Eli Zaretskii | 26 Jun 2012 17:40
Picon

Re: non-ASCII characters in auto-save files

> Date: Tue, 26 Jun 2012 12:13:21 +0200
> From: grivet <grivet <at> cnrs-orleans.fr>
> 
> 
>      - Is there a systematic way to convert #myfile# to iso-latin-9 (or
> iso-latin-1) code, other than painstakingly searching and replacing
> offending chars ?

Yes.  

   C-x RET c emacs-internal RET C-x C-f #myfile# RET
   C-x RET f latin-9 RET
   C-x C-s

> > Just open the file with the right coding-system (typically, opening
> > "myfile" and then hitting M-x recover-this-file RET should do the
> > trick).
> >
> >
> >          Stefan
> #myfile# c&n be opened in this way but cannot be saved, as the coding 
> system is not recognized.

You should open myfile, not #myfile#.  Then Emacs will automatically
notice that the auto-save file for it exists, and offer to recover it.

Xah Lee | 27 Jun 2012 13:52
Picon
Gravatar

Re: non-ASCII characters in auto-save files

On Jun 25, 4:21 pm, Stefan Monnier <monn... <at> iro.umontreal.ca> wrote:
> >     - Can Emacs be persuaded to to encode auto-save files in a more useful
> > manner ?
>
> No.  Auto-save files are encoded using Emacs's internal coding-system,
> which makes the operation a lot more reliable and efficient (no need to
> worry about the case where some char(s) can't be encoded, for example).

i thought emacs 23/24 uses a superset of utf-8 as internal encoding?
so that i thought those #autosave# files are encoded in utf-8, and as
long as one open them with utf-8 decoding all chars would show. Is
this not correct?

(i turned of auto-save and auto backup few years ago)

 Xah

Eli Zaretskii | 27 Jun 2012 18:44
Picon

Re: non-ASCII characters in auto-save files

> From: Xah Lee <xahlee <at> gmail.com>
> Date: Wed, 27 Jun 2012 04:52:41 -0700 (PDT)
> 
> i thought emacs 23/24 uses a superset of utf-8 as internal encoding?

It does.

> so that i thought those #autosave# files are encoded in utf-8, and as
> long as one open them with utf-8 decoding all chars would show. Is
> this not correct?

Not 100%, because it's a superset.  That is, there could be codes
there that UTF-8 will fail to decode.


Gmane