all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why ("/#[^/]+#\\'" . emacs-mule) ?
@ 2013-03-25 13:08 Per Starbäck
  2013-03-25 13:21 ` Andreas Schwab
  2013-03-25 14:13 ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Per Starbäck @ 2013-03-25 13:08 UTC (permalink / raw)
  To: emacs-devel

Why are #autosave# files opened with the emacs-mule coding?

I don't use recover-file a lot. When I have to use autosave files I
usually open them up in their own buffers and compare and copy
"manually".
Very often when I open them I have to immediately use
revert-buffer-with-coding-system because they are utf8 files.

For a long time I have wished that the coding of those files would be
recognised like for other files. I thought of reporting this as a bug,
but since
auto-coding-list (in lisp/international/mule.el) has an explicit line

    ("/#[^/]+#\\'" . emacs-mule)))

it's evidently on purpose, so instead I will ask here. What is that purpose?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why ("/#[^/]+#\\'" . emacs-mule) ?
  2013-03-25 13:08 Why ("/#[^/]+#\\'" . emacs-mule) ? Per Starbäck
@ 2013-03-25 13:21 ` Andreas Schwab
  2013-03-25 13:59   ` Eli Zaretskii
  2013-03-25 14:13 ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2013-03-25 13:21 UTC (permalink / raw)
  To: Per Starbäck; +Cc: emacs-devel

Per Starbäck <per@starback.se> writes:

> Why are #autosave# files opened with the emacs-mule coding?

This is wrong, it should be utf8-emacs-unix instead.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why ("/#[^/]+#\\'" . emacs-mule) ?
  2013-03-25 13:21 ` Andreas Schwab
@ 2013-03-25 13:59   ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2013-03-25 13:59 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: per, emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Mon, 25 Mar 2013 14:21:33 +0100
> Cc: emacs-devel@gnu.org
> 
> Per Starbäck <per@starback.se> writes:
> 
> > Why are #autosave# files opened with the emacs-mule coding?
> 
> This is wrong, it should be utf8-emacs-unix instead.

Unless the Emacs version is really old, like v22.x.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why ("/#[^/]+#\\'" . emacs-mule) ?
  2013-03-25 13:08 Why ("/#[^/]+#\\'" . emacs-mule) ? Per Starbäck
  2013-03-25 13:21 ` Andreas Schwab
@ 2013-03-25 14:13 ` Eli Zaretskii
  2013-03-25 14:50   ` Andreas Schwab
  2013-03-26 15:57   ` [SPG,spf=20]Re: " Per Starbäck
  1 sibling, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2013-03-25 14:13 UTC (permalink / raw)
  To: Per Starbäck; +Cc: emacs-devel

> Date: Mon, 25 Mar 2013 14:08:36 +0100
> From: Per Starbäck <per@starback.se>
> 
> Why are #autosave# files opened with the emacs-mule coding?

They are not, not in latest versions of Emacs.

> I don't use recover-file a lot. When I have to use autosave files I
> usually open them up in their own buffers and compare and copy
> "manually".
> Very often when I open them I have to immediately use
> revert-buffer-with-coding-system because they are utf8 files.

Strange that you need that.  When I do "M-x recover-this-file RET", I
get a buffer in utf-8-emacs-unix, which is what I expect.

> For a long time I have wished that the coding of those files would be
> recognised like for other files. I thought of reporting this as a bug,
> but since
> auto-coding-list (in lisp/international/mule.el) has an explicit line
> 
>     ("/#[^/]+#\\'" . emacs-mule)))
> 
> it's evidently on purpose, so instead I will ask here. What is that purpose?

The purpose is back-compatibility with auto-save files from prior
versions.  But recover-file overrides this and uses auto-save-coding,
so I'm unsure why the above matters in your case.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Why ("/#[^/]+#\\'" . emacs-mule) ?
  2013-03-25 14:13 ` Eli Zaretskii
@ 2013-03-25 14:50   ` Andreas Schwab
  2013-03-26 15:57   ` [SPG,spf=20]Re: " Per Starbäck
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2013-03-25 14:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Per Starbäck, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> The purpose is back-compatibility with auto-save files from prior
> versions.  But recover-file overrides this and uses auto-save-coding,
> so I'm unsure why the above matters in your case.

It matters if you find an auto-save file manually (try doing that with
the HELLO file, for example).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [SPG,spf=20]Re: Why ("/#[^/]+#\\'" . emacs-mule) ?
  2013-03-25 14:13 ` Eli Zaretskii
  2013-03-25 14:50   ` Andreas Schwab
@ 2013-03-26 15:57   ` Per Starbäck
  1 sibling, 0 replies; 6+ messages in thread
From: Per Starbäck @ 2013-03-26 15:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

>> Very often when I open them I have to immediately use
>> revert-buffer-with-coding-system because they are utf8 files.
>
> Strange that you need that.  When I do "M-x recover-this-file RET", I
> get a buffer in utf-8-emacs-unix, which is what I expect.

I wasn't talking about recover-this-file though. I was talking about
just opening the file.

> The purpose is back-compatibility with auto-save files from prior
> versions.

Back-compatibility is nice, but if we only can open old files *or* new
files correctly the choice should obviously be the new files.

But is that choice even necessary? I dug up an old autosave file I had
(from 2003) with non-ascii characters in it.
Opening it in an Emacs of today worked fine, identifying it correctly
as emacs-mule-unix.
But the setting in auto-coding-alist wasn't necessary for that, but
that was done by normal coding-recognition as well.

I removed the entry ("/#[^/]+#\\'" . emacs-mule) from
auto-coding-alist, and now I can open both old and new autosave files
correctly.
If there are no non-ascii characters I get undecided instead of
emacs-mule with the same buffer contents, which I don't see as a
drawback.

I think the current situation where Emacs can't correctly open files
it is creating itself doesn't make sense. What would make sense
is one of:

1. Remove the #-line in auto-coding-alist and let Emacs detect coding
system normally. Maybe it won't work for some file, I don't know,
but that is no big deal since you don't open these that often.

2. Replace emacs-mule with utf-8-emacs so it works for current files.
It won't work for old autosave files, but that is no big deal since
you almost never open those.

3. Make some special detection rule for autosave files that only
detects if it is utf-8-emacs or emacs-mule. The "perfect" solution,
but
too ambitious for this.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-26 15:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 13:08 Why ("/#[^/]+#\\'" . emacs-mule) ? Per Starbäck
2013-03-25 13:21 ` Andreas Schwab
2013-03-25 13:59   ` Eli Zaretskii
2013-03-25 14:13 ` Eli Zaretskii
2013-03-25 14:50   ` Andreas Schwab
2013-03-26 15:57   ` [SPG,spf=20]Re: " Per Starbäck

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.