2000-12-05 13:01:11 +00:00
|
|
|
@c This is part of the Emacs manual.
|
|
|
|
@c Copyright (C) 2000 Free Software Foundation, Inc.
|
|
|
|
@c See file emacs.texi for copying conditions.
|
|
|
|
@node Mac OS, MS-DOS, Antinews, Top
|
|
|
|
@appendix Emacs and the Mac OS
|
|
|
|
@cindex Mac OS
|
|
|
|
@cindex Macintosh
|
|
|
|
|
|
|
|
Emacs built on the Mac OS supports many of its major features:
|
|
|
|
multiple frames, colors, scroll bars, menu bars, use of the mouse,
|
|
|
|
fontsets, international characters, input methods, coding systems, and
|
|
|
|
synchronous subprocesses (@code{call-process}). Much of this works in
|
|
|
|
the same way as on other platforms and is therefore documented in the
|
|
|
|
rest of this manual. This section describes the peculiarities of using
|
|
|
|
Emacs under the Mac OS.
|
|
|
|
|
|
|
|
The following features of Emacs are not yet supported on the Mac:
|
|
|
|
unexec (@code{dump-emacs}), asynchronous subprocesses
|
|
|
|
(@code{start-process}), and networking (@code{open-network-connection}).
|
|
|
|
As a result, packages such as Gnus, Ispell, and Comint do not work.
|
|
|
|
|
|
|
|
Since external Unix programs to handle commands such as
|
|
|
|
@code{print-buffer} and @code{diff} are not available on the Mac OS,
|
|
|
|
they are not supported in the Mac OS version.
|
|
|
|
|
|
|
|
@menu
|
2001-02-17 17:40:43 +00:00
|
|
|
* Input: Mac Input. Keyboard input on the Mac.
|
|
|
|
* Intl: Mac International. International character sets on the Mac.
|
|
|
|
* Env: Mac Environment Variables. Setting environment variables for Emacs.
|
|
|
|
* Directories: Mac Directories. Volumes and directories on the Mac.
|
|
|
|
* Font: Mac Font Specs. Specifying fonts on the Mac.
|
|
|
|
* Functions: Mac Functions. Mac-specific Lisp functions.
|
2000-12-05 13:01:11 +00:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Mac Input
|
|
|
|
@section Keyboard Input on the Mac
|
2001-02-21 15:29:46 +00:00
|
|
|
@cindex Meta (Mac OS)
|
|
|
|
@cindex keyboard coding (Mac OS)
|
2000-12-05 13:01:11 +00:00
|
|
|
@vindex mac-command-key-is-meta
|
|
|
|
@vindex mac-keyboard-text-encoding
|
|
|
|
|
|
|
|
On the Mac, Emacs can use either the @key{option} key or the
|
|
|
|
@key{command} key as the @key{META} key. If the value of the variable
|
|
|
|
@code{mac-command-key-is-meta} is non-@code{nil} (its default value),
|
2001-03-03 20:13:13 +00:00
|
|
|
Emacs uses the @key{command} key as the @key{META} key. Otherwise it
|
|
|
|
uses the @key{option} key as the @key{META} key.
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
Most people should want to use the @key{command} key as the @key{META} key,
|
|
|
|
so that dead-key processing with the @key{option} key will still work. This is
|
|
|
|
useful for entering non-ASCII Latin characters directly from the Mac
|
|
|
|
keyboard, for example.
|
|
|
|
|
|
|
|
Emacs recognizes the setting in the Keyboard control panel and
|
|
|
|
supports international and alternative keyboard layouts (e.g., Dvorak).
|
|
|
|
Selecting one of the layouts from the keyboard layout pull-down menu
|
|
|
|
will affect how the keys typed on the keyboard are interpreted.
|
|
|
|
|
|
|
|
The Mac OS intercepts and handles certain key combinations (e.g.,
|
|
|
|
@key{command}-@key{SPC} for switching input languages). These will not
|
|
|
|
be passed to Emacs.
|
|
|
|
|
|
|
|
The Mac keyboard ordinarily generates characters in the Mac Roman
|
|
|
|
encoding. To use it for entering ISO Latin-1 characters directly, set
|
|
|
|
the value of the variable @code{mac-keyboard-text-encoding} to
|
2001-02-27 05:46:51 +00:00
|
|
|
@code{kTextEncodingISOLatin1}. Note that not all Mac Roman characters
|
|
|
|
that can be entered at the keyboard can be converted to ISO Latin-1
|
|
|
|
characters.
|
2000-12-05 13:01:11 +00:00
|
|
|
|
2001-03-03 09:18:52 +00:00
|
|
|
To enter ISO Latin-2 characters directly from the Mac keyboard, set
|
2000-12-05 13:01:11 +00:00
|
|
|
the value of @code{mac-keyboard-text-encoding} to
|
|
|
|
@code{kTextEncodingISOLatin2}. Then let Emacs know that the keyboard
|
2001-03-03 20:13:13 +00:00
|
|
|
generates Latin-2 codes, by typing @kbd{C-x @key{RET} k iso-latin-2
|
|
|
|
@key{RET}}. To make this setting permanent, put this in your
|
|
|
|
@file{.emacs} init file:
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
@lisp
|
2001-02-17 17:40:43 +00:00
|
|
|
(set-keyboard-coding-system 'iso-latin-2)
|
2000-12-05 13:01:11 +00:00
|
|
|
@end lisp
|
|
|
|
|
|
|
|
@node Mac International
|
|
|
|
@section International Character Set Support on the Mac
|
|
|
|
@cindex Mac Roman coding system
|
2001-02-21 15:29:46 +00:00
|
|
|
@cindex clipboard support (Mac OS)
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
The Mac uses a non-standard encoding for the upper 128 single-byte
|
2001-03-03 20:13:13 +00:00
|
|
|
characters. It also deviates from the ISO 2022 standard by using
|
|
|
|
character codes in the range 128-159. The coding system
|
|
|
|
@code{mac-roman} is used to represent this Mac encoding. It is used
|
|
|
|
for editing files stored in this native encoding, and for displaying
|
|
|
|
file names in Dired mode.
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
Any native (non-symbol) Mac font can be used to correctly display
|
|
|
|
characters in the @code{mac-roman} coding system.
|
|
|
|
|
2001-02-27 05:46:51 +00:00
|
|
|
The fontset @code{fontset-mac} is created automatically when Emacs
|
|
|
|
is run on the Mac. It displays characters in the @code{mac-roman}
|
|
|
|
coding system using 12-point Monaco.
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
To insert characters directly in the @code{mac-roman} coding system,
|
2001-03-03 20:13:13 +00:00
|
|
|
type @kbd{C-x @key{RET} k mac-roman @key{RET}}, or put this in your
|
|
|
|
@file{.emacs} init file:
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
@lisp
|
|
|
|
(set-keyboard-coding-system 'mac-roman)
|
|
|
|
@end lisp
|
|
|
|
|
|
|
|
@noindent
|
|
|
|
This is useful for editing documents in native Mac encoding.
|
|
|
|
|
|
|
|
You can use input methods provided either by LEIM (@pxref{Input
|
|
|
|
Methods}) or the Mac OS to enter international characters.
|
|
|
|
|
|
|
|
To use the former, see the International Character Set Support section
|
|
|
|
of the manual.
|
|
|
|
|
|
|
|
To use input methods provided by the Mac OS, set the keyboard coding
|
2001-03-03 20:13:13 +00:00
|
|
|
system accordingly using the @kbd{C-x @key{RET} k} command
|
2000-12-05 13:01:11 +00:00
|
|
|
(@code{set-keyboard-coding-system}). For example, for Traditional
|
2000-12-05 13:15:19 +00:00
|
|
|
Chinese, use @samp{chinese-big5} as keyboard coding system; for
|
2000-12-05 13:01:11 +00:00
|
|
|
Japanese, use @samp{sjis}, etc. Then select the desired input method in
|
|
|
|
the keyboard layout pull-down menu.
|
|
|
|
|
|
|
|
The Mac clipboard and the Emacs kill ring (@pxref{Killing}) are
|
|
|
|
connected as follows: the most recent kill is copied to the clipboard
|
|
|
|
when Emacs is suspended and the contents of the clipboard is inserted
|
|
|
|
into the kill ring when Emacs resumes. The result is that you can yank
|
|
|
|
a piece of text and paste it into another Mac application, or cut or copy
|
|
|
|
one in another Mac application and yank it into a Emacs buffer.
|
|
|
|
|
|
|
|
The encoding of text selections must be specified using the commands
|
2001-03-03 20:13:13 +00:00
|
|
|
@kbd{C-x @key{RET} x} (@code{set-selection-coding-system}) or @kbd{C-x
|
|
|
|
@key{RET} X} (@code{set-next-selection-coding-system}) (e.g., for
|
|
|
|
Traditional Chinese, use @samp{chinese-big5-mac} and for Japanese,
|
2000-12-05 13:01:11 +00:00
|
|
|
@samp{sjis-mac}). @xref{Specify Coding}, for more details.
|
|
|
|
|
|
|
|
|
|
|
|
@node Mac Environment Variables
|
|
|
|
@section Environment Variables and Command Line Arguments.
|
2001-02-21 15:29:46 +00:00
|
|
|
@cindex environment variables (Mac OS)
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
Environment variables and command line arguments for Emacs can be set
|
|
|
|
by modifying the @samp{STR#} resources 128 and 129, respectively. A common
|
|
|
|
environment variable that one may want to set is @samp{HOME}.
|
|
|
|
|
|
|
|
The way to set an environment variable is by adding a string of the
|
|
|
|
form
|
|
|
|
|
|
|
|
@example
|
|
|
|
ENV_VAR=VALUE
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@noindent
|
|
|
|
to resource @samp{STR#} number 128 using @code{ResEdit}. To set up the
|
|
|
|
program to use unibyte characters exclusively, for example, add the
|
|
|
|
string
|
|
|
|
|
|
|
|
@example
|
|
|
|
EMACS_UNIBYTE=1
|
|
|
|
@end example
|
|
|
|
|
|
|
|
|
|
|
|
@node Mac Directories
|
|
|
|
@section Volumes and Directories on the Mac
|
2001-02-21 15:29:46 +00:00
|
|
|
@cindex file names (Mac OS)
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
The directory structure in the Mac OS is seen by Emacs as
|
|
|
|
|
|
|
|
@example
|
2001-02-17 17:40:43 +00:00
|
|
|
/@var{volumename}/@var{filename}
|
2000-12-05 13:01:11 +00:00
|
|
|
@end example
|
|
|
|
|
2001-02-17 17:40:43 +00:00
|
|
|
So when Emacs requests a file name, doing file name completion on
|
2000-12-05 13:01:11 +00:00
|
|
|
@file{/} will display all volumes on the system. As in Unix, @file{..}
|
|
|
|
can be used to go up a directory level.
|
|
|
|
|
|
|
|
To access files and folders on the desktop, look in the folder
|
|
|
|
@file{Desktop Folder} in your boot volume (this folder is usually
|
|
|
|
invisible in the Mac @code{Finder}).
|
|
|
|
|
|
|
|
Emacs creates the Mac folder @file{:Preferences:Emacs:} in the
|
|
|
|
@file{System Folder} and uses it as the temporary directory. The Unix
|
|
|
|
emulation code maps the Unix directory @file{/tmp} to it. Therefore it
|
|
|
|
is best to avoid naming a volume @file{tmp}. If everything works
|
|
|
|
correctly, the program should leave no files in it when it exits. You
|
|
|
|
should be able to set the environment variable @code{TMPDIR} to use
|
|
|
|
another directory but this folder will still be created.
|
|
|
|
|
|
|
|
|
|
|
|
@node Mac Font Specs
|
|
|
|
@section Specifying Fonts on the Mac
|
2001-02-21 15:29:46 +00:00
|
|
|
@cindex font names (Mac OS)
|
2000-12-05 13:01:11 +00:00
|
|
|
|
2001-03-03 20:13:13 +00:00
|
|
|
It is rare that you need to specify a font name in Emacs; usually
|
|
|
|
you specify face attributes instead. But when you do need to specify
|
|
|
|
a font name in Emacs on the Mac, use a standard X font name:
|
2000-12-05 13:01:11 +00:00
|
|
|
|
2001-02-17 17:40:43 +00:00
|
|
|
@smallexample
|
2001-02-27 05:46:51 +00:00
|
|
|
-@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{}
|
|
|
|
@dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{charset}
|
2001-02-17 17:40:43 +00:00
|
|
|
@end smallexample
|
2000-12-05 13:01:11 +00:00
|
|
|
|
2001-02-17 17:40:43 +00:00
|
|
|
@noindent
|
2001-03-03 20:13:13 +00:00
|
|
|
@xref{Font X}. Wildcards are supported as they are on X.
|
2000-12-05 13:01:11 +00:00
|
|
|
|
2001-02-27 05:46:51 +00:00
|
|
|
Native Apple fonts in Mac Roman encoding has maker name @code{apple}
|
2000-12-05 13:01:11 +00:00
|
|
|
and charset @code{mac-roman}. For example 12-point Monaco can be
|
|
|
|
specified by the name @samp{-apple-monaco-*-12-*-mac-roman}.
|
|
|
|
|
|
|
|
Native Apple Traditional Chinese, Simplified Chinese, Japanese, and
|
2001-02-27 05:46:51 +00:00
|
|
|
Korean fonts have charsets @samp{big5-0}, @samp{gb2312.1980-0},
|
|
|
|
@samp{jisx0208.1983-sjis}, and @samp{ksc5601.1989-0}, respectively.
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
Single-byte fonts converted from GNU fonts in BDF format, which are not
|
|
|
|
in the Mac Roman encoding, have foundry, family, and character sets
|
|
|
|
encoded in the names of their font suitcases. E.g., the font suitcase
|
|
|
|
@samp{ETL-Fixed-ISO8859-1} contains fonts which can be referred to by
|
|
|
|
the name @samp{-ETL-fixed-*-iso8859-1}.
|
|
|
|
|
|
|
|
|
|
|
|
@node Mac Functions
|
2001-02-17 17:43:17 +00:00
|
|
|
@section Mac-Specific Lisp Functions
|
2001-02-21 15:29:46 +00:00
|
|
|
@cindex Lisp functions specific to Mac OS
|
2000-12-05 13:01:11 +00:00
|
|
|
|
|
|
|
@findex do-applescript
|
|
|
|
The function @code{do-applescript} takes a string argument,
|
|
|
|
executes it as an AppleScript command, and returns the result as a
|
|
|
|
string.
|
|
|
|
|
|
|
|
@findex mac-filename-to-unix
|
|
|
|
@findex unix-filename-to-mac
|
2001-02-17 17:40:43 +00:00
|
|
|
The function @code{mac-filename-to-unix} takes a Mac file name and
|
2000-12-05 13:01:11 +00:00
|
|
|
returns the Unix equivalent. The function @code{unix-filename-to-mac}
|
|
|
|
performs the opposite conversion. They are useful for constructing
|
|
|
|
AppleScript commands to be passed to @code{do-applescript}.
|