> I am using mac OSX 10.3. I created a small text file with emacs
> ("enhanced carbon" 21.3) but when I double click on the file's icon it
[quoted text clipped - 3 lines]
> How to make the os remmebr that it is an emacs file? Do I need a
> special ending (like name.emacs)?
:> I am using mac OSX 10.3. I created a small text file with emacs
:> ("enhanced carbon" 21.3) but when I double click on the file's icon it
[quoted text clipped - 15 lines]
:select it as above hit the "change all" button (in Open With). Now all text
:files will open in emacs, unless you tell it otherwise
Emacs will save the file with whatever extension you give it. If it's
.txt, that's what the Mac will see, and will open the file in whatever
app it normally opens *.txt files with. As you point out, this can be
changed with CMD-i.
With Emacs, on OS X, you should probably work on a file-to-file
basis. If you use Emacs to edit your HTML files (say), they'll be
saved as *.html, and probably (hopefully) will open with Firefox. You
don't want Emacs as the default in this case.

Signature
Looks like more of Texas to Me
jacob@ruccs.rutgers.edu - 26 Feb 2005 01:48 GMT
I simply invented a new extension, .emx, for this purpose. After giving
this extension to one file, you can the use get-info to "change all"
with this extension, and henceforth all .emx files open with emacs. As
another poster suggested though, you'll only want to do this with files
that you normally want to open with emacs, which for me is only a small
subset of the files that I use emacs to create.
A distantly related question: I have tried to use OS X's color-coding
scheme to mark files that I am currently working on. But emacs
automatically makes temp backups of files it works on (eg filename~),
and for some reason these files "inherit" the color while the original
file loses it. This makes it unusable of course because you don't want
to open the backup file. Anybody know how to fix this?
-jacob
Paul Mitchum - 26 Feb 2005 02:13 GMT
[..]
> A distantly related question: I have tried to use OS X's color-coding
> scheme to mark files that I am currently working on. But emacs
> automatically makes temp backups of files it works on (eg filename~), and
> for some reason these files "inherit" the color while the original file
> loses it. This makes it unusable of course because you don't want to open
> the backup file. Anybody know how to fix this?
In order to fix it, you'd have to reprogram emacs to copy the color
label info to the new file. You might email the developers about it.
Julian Lighton - 27 Feb 2005 01:22 GMT
>A distantly related question: I have tried to use OS X's color-coding
>scheme to mark files that I am currently working on. But emacs
>automatically makes temp backups of files it works on (eg filename~),
>and for some reason these files "inherit" the color while the original
>file loses it. This makes it unusable of course because you don't want
>to open the backup file. Anybody know how to fix this?
Add:
(setq backup-by-copying t)
to your .emacs
Emacs' default behavior is to make its backup files by renaming the old
one, then writing out a brand new file with the updated contents.
Viktor Haag - 28 Feb 2005 15:25 GMT
> Emacs will save the file with whatever extension you give
> it. If it's .txt, that's what the Mac will see, and will open
> the file in whatever app it normally opens *.txt files with. As
> you point out, this can be changed with CMD-i.
It's not as simple as "file extensions" on OSX; there are also
"creator codes" which, I believe, live in a file's resource
fork. I'm not precisely positive what OSX's policy is, but I
think it's this:
- open a file with that file's creator, if it has a resource fork
with a creator code in it; in this case, ignore the file's name
extension.
- if a file has resource fork, but no creator code, open it with
the application associated with the file's name extension.
- if a file has no resource fork, open it with the application
associated with the file's name extension.
I'm not sure under what circumstances an application will add a
creator code into a file's resource fork when it saves a file,
but I'm sure this behaviour varies from app to app, and is not
part of the basic OSX file API. Also, I'm pretty sure that Emacs
completely ignores the resource fork of files, and so the only
way to get it to automatically open with files is to (a)
associate the app with a file extension, and then (b) make sure
that files with that extension won't have a resource fork with a
creator code written in it.
For example, I'm not sure whether TextEdit.app writes its creator
code into files it saves, but if it does then it will "co-opt"
any file it edits and saves, including ones that you give a
special ".emacs" file extension.
One way to get around this problem is to use 'open' from a
command line -- you can use it to specify an application to open
a file. If you're using Emacs but not the command line, I'm must
admit to being surprised, and suggest you start (using the
command line, that is).
With OSX's memory manager operating the way it does, there's no
need to open Emacs and then quit it all the time; open it when
you log on, and leave it running all the time, hiding it when
you're not using it. That way, editing a file with it is just a
few CMD-TABs and some keystrokes away.

Signature
Viktor Haag : Senior Technical Writer : Research In Motion
Tim Streater - 28 Feb 2005 16:19 GMT
> > Emacs will save the file with whatever extension you give
> > it. If it's .txt, that's what the Mac will see, and will open
[quoted text clipped - 5 lines]
> fork. I'm not precisely positive what OSX's policy is, but I
> think it's this:
No they don't. Word files (.doc under Win) have no resource fork but can
have file type and creator codes.
-- tim
Miles Bader - 28 Feb 2005 22:26 GMT
>> It's not as simple as "file extensions" on OSX; there are also
>> "creator codes" which, I believe, live in a file's resource
[quoted text clipped - 3 lines]
> No they don't. Word files (.doc under Win) have no resource fork but can
> have file type and creator codes.
I vaguely recall hearing that Apple was "de-emphasizing" resource forks
these days (presumably for greater inter-operability with non-Apple
filesystems), though I have no idea what that means in practice....
Is this just a rumour?
-Miles

Signature
.Numeric stability is probably not all that important when you're guessing.