Like many Unix refugee, I prefer emacs as my default editor for text files, programming, and system administration, but also enjoy using
the Mac GUI. This code snippet, when added to your ~/.emacs file, does the following:
[robg adds: I haven't tested this one, and the binary plist handling is also covered in this hint, but this one adds the mode info to the saved files as well.]
- Saves shell scripts and text-mode files, including TeX and troff files or files with no suffix (but excluding html/sgml/xml), with the file-type set to TEXT, so they are automatically indexed by spotlight. If you configure Emacs in the finder as the default application to open one of these files, double-clicking will open them in a GUI version of emacs such as Aqua Emacs or xemacs.
- Edits plists, including binary plists, in emacs, saving the binary plists as binaries. Saving in binary format is not necessary, but some readers of the forums seemed to think it important.
- You can add other file types to the save-as-mac-text function with a cond clause, for example, if you write a lot of perl scripts without a .pl or .cgi suffix and want them to automatically open in emacs in perl-mode when double clicked.
[robg adds: I haven't tested this one, and the binary plist handling is also covered in this hint, but this one adds the mode info to the saved files as well.]
•
[5,558 views]

