-@node Mac Input
-@section Keyboard and Mouse Input on Mac
-@cindex Meta (Mac OS)
-@cindex keyboard coding (Mac OS)
-
-@vindex mac-control-modifier
-@vindex mac-command-modifier
-@vindex mac-option-modifier
-@vindex mac-function-modifier
- On Mac, Emacs can use @key{control}, @key{command}, @key{option}, and
-laptop @key{function} keys as any of Emacs modifier keys except
-@key{SHIFT} (i.e., @key{ALT}, @key{CTRL}, @key{HYPER}, @key{META}, and
-@key{SUPER}). The assignment is controlled by the variables
-@code{mac-control-modifier}, @code{mac-command-modifier},
-@code{mac-option-modifier}, and @code{mac-function-modifier}. The value
-for each of these variables can be one of the following symbols:
-@code{alt}, @code{control}, @code{hyper}, @code{meta}, @code{super}, and
-@code{nil} (no particular assignment). By default, the @key{control}
-key works as @key{CTRL}, and the @key{command} key as @key{META}.
-
- For the @key{option} key, if @code{mac-option-modifier} is set to
-@code{nil}, which is the default, the key works as the normal
-@key{option} key, i.e., dead-key processing will work. This is useful
-for entering non-@acronym{ASCII} Latin characters directly from the
-Mac keyboard, for example.
-
- Emacs recognizes the setting in the Keyboard control panel (Mac OS
-Classic) or the International system preference pane (Mac OS X) 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.
-
-@vindex mac-pass-command-to-system
-@vindex mac-pass-control-to-system
- 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. One can disable this interception by setting
-@code{mac-pass-command-to-system} or @code{mac-pass-control-to-system}
-to @code{nil}.
-
-@vindex mac-emulate-three-button-mouse
- Especially for one-button mice, the multiple button feature can be
-emulated by setting @code{mac-emulate-three-button-mouse} to @code{t}
-or @code{reverse}. If set to @code{t} (@code{reverse}, respectively),
-pressing the mouse button with the @key{option} key is recognized as
-the second (third) button, and that with the @key{command} key is
-recognized as the third (second) button.
-
-@vindex mac-wheel-button-is-mouse-2
- For multi-button mice, the wheel button and the secondary button are
-recognized as the second and the third button, respectively. If
-@code{mac-wheel-button-is-mouse-2} is set to @code{nil}, their roles
-are exchanged.
-
-@node Mac International
-@section International Character Set Support on Mac
-@cindex Mac Roman coding system
-@cindex clipboard support (Mac OS)
-
- Mac uses non-standard encodings for the upper 128 single-byte
-characters. They also deviate from the ISO 2022 standard by using
-character codes in the range 128-159. The coding systems
-@code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic}
-are used to represent these Mac encodings.
-
- You can use input methods provided either by LEIM (@pxref{Input
-Methods}) or Mac OS to enter international characters. To use the
-former, see the International Character Set Support section of the
-manual (@pxref{International}).
-
- Emacs on Mac OS automatically changes the value of
-@code{keyboard-coding-system} according to the current keyboard
-layout. So users don't need to set it manually, and even if set, it
-will be changed when the keyboard layout change is detected next time.
-
- The Mac clipboard and the Emacs kill ring (@pxref{Killing}) are
-synchronized by default: 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. This feature can be
-disabled by setting @code{x-select-enable-clipboard} to @code{nil}.
-One can still do copy and paste with another application from the Edit
-menu.
-
- On Mac, the role of the coding system for selection that is set by
-@code{set-selection-coding-system} (@pxref{Communication Coding}) is
-two-fold. First, it is used as a preferred coding system for the
-traditional text flavor that does not specify any particular encodings
-and is mainly used by applications on Mac OS Classic. Second, it
-specifies the intermediate encoding for the UTF-16 text flavor that is
-mainly used by applications on Mac OS X.
-
- When pasting UTF-16 text data from the clipboard, it is first
-converted to the encoding specified by the selection coding system
-using the converter in the Mac OS system, and then decoded into the
-Emacs internal encoding using the converter in Emacs. If the first
-conversion failed, then the UTF-16 data is directly converted to Emacs
-internal encoding using the converter in Emacs. Copying UTF-16 text
-to the clipboard goes through the inverse path. The reason for this
-two-pass decoding is to avoid subtle differences in Unicode mappings
-between the Mac OS system and Emacs such as various kinds of hyphens,
-and to minimize users' customization. For example, users that mainly
-use Latin characters would prefer Greek characters to be decoded into
-the @code{mule-unicode-0100-24ff} charset, but Japanese users would
-prefer them to be decoded into the @code{japanese-jisx0208} charset.
-Since the coding system for selection is automatically set according
-to the system locale setting, users usually don't have to set it
-manually.
-
- The default language environment (@pxref{Language Environments}) is
-set according to the locale setting at the startup time. On Mac OS,
-the locale setting is consulted in the following order:
-
-@enumerate
-@item
-Environment variables @env{LC_ALL}, @env{LC_CTYPE} and @env{LANG} as
-in other systems.
-
-@item
-Preference @code{AppleLocale} that is set by default on Mac OS X 10.3
-and later.
-
-@item
-Preference @code{AppleLanguages} that is set by default on Mac OS X
-10.1 and later.
-
-@item
-Variable @code{mac-system-locale} that is derived from the system
-language and region codes. This variable is available on all
-supported Mac OS versions including Mac OS Classic.
-@end enumerate
-
- The default values of almost all variables about coding systems are
-also set according to the language environment. So usually you don't
-have to customize these variables manually.
-
-@node Mac Environment Variables
-@section Environment Variables and Command Line Arguments.
-@cindex environment variables (Mac OS)
-
- On Mac OS X, when Emacs is run in a terminal, it inherits the values
-of environment variables from the shell from which it is invoked.
-However, when it is run from the Finder as a GUI application, it only
-inherits environment variable values defined in the file
-@file{~/.MacOSX/environment.plist} that affects all the applications
-invoked from the Finder or the @command{open} command.
-
- Command line arguments are specified like
-
-@example
-/Applications/Emacs.app/Contents/MacOS/Emacs -g 80x25 &
-@end example
-
-@noindent
-if Emacs is installed at @file{/Applications/Emacs.app}. If Emacs is
-invoked like this, then it also inherits the values of environment
-variables from the shell from which it is invoked.
-
- On Mac OS Classic, 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
-
-@cindex Mac Preferences
- Although Emacs on Mac does not support X resources (@pxref{X
-Resources}) directly, one can use the Preferences system in place of X
-resources. For example, adding the line
-
-@example
-Emacs.cursorType: bar
-@end example
-
-@noindent
-to @file{~/.Xresources} in X11 corresponds to the execution of
-
-@example
-defaults write org.gnu.Emacs Emacs.cursorType bar
-@end example
-
-@noindent
-on Mac OS X. One can use boolean or numeric values as well as string
-values as follows:
-
-@example
-defaults write org.gnu.Emacs Emacs.toolBar -bool false
-defaults write org.gnu.Emacs Emacs.lineSpacing -int 3
-@end example
-
-@noindent
-Try @kbd{M-x man RET defaults RET} for the usage of the
-@command{defaults} command. Alternatively, if you have Developer
-Tools installed on Mac OS X, you can use Property List Editor to edit
-the file @file{~/Library/Preferences/org.gnu.Emacs.plist}.
-