view man/macos.texi @ 83310:e58cb448e07c

Merged from miles@gnu.org--gnu-2005 (patch 80-82, 350-422) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-350 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-351 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-352 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-353 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-354 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-355 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-356 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-357 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-358 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-359 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-360 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-361 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-362 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-363 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364 Remove "-face" suffix from widget faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365 Remove "-face" suffix from custom faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-366 Remove "-face" suffix from change-log faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-367 Remove "-face" suffix from compilation faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-368 Remove "-face" suffix from diff-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-369 lisp/longlines.el (longlines-visible-face): Face removed * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370 Remove "-face" suffix from woman faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-371 Remove "-face" suffix from whitespace-highlight face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372 Remove "-face" suffix from ruler-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-373 Remove "-face" suffix from show-paren faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374 Remove "-face" suffix from log-view faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-375 Remove "-face" suffix from smerge faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-376 Remove "-face" suffix from show-tabs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-377 Remove "-face" suffix from highlight-changes faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-378 Remove "-face" suffix from and downcase info faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379 Remove "-face" suffix from pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-380 Update uses of renamed pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-381 Tweak ChangeLog * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-382 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-383 Remove "-face" suffix from strokes-char face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-384 Remove "-face" suffix from compare-windows face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-385 Remove "-face" suffix from calendar faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-386 Remove "-face" suffix from diary-button face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-387 Remove "-face" suffix from testcover faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-388 Remove "-face" suffix from viper faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-389 Remove "-face" suffix from org faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-390 Remove "-face" suffix from sgml-namespace face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-391 Remove "-face" suffix from table-cell face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-392 Remove "-face" suffix from tex-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-393 Remove "-face" suffix from texinfo-heading face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-394 Remove "-face" suffix from flyspell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-395 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-396 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-397 Remove "-face" suffix from gomoku faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-398 Remove "-face" suffix from mpuz faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-399 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-401 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-403 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-404 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-405 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-406 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-407 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-408 Remove "-face" suffix from Buffer-menu-buffer face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409 Remove "-face" suffix from antlr-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410 Remove "-face" suffix from ebrowse faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-411 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-412 Remove "-face" suffix from flymake faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413 Remove "-face" suffix from idlwave faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-414 Remove "-face" suffix from sh-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-415 Remove "-face" suffix from vhdl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-416 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-417 Remove "-face" suffix from which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-418 Remove "-face" suffix from cperl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419 Remove "-face" suffix from ld-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-420 Fix cperl-mode font-lock problem * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421 Tweak which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-422 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-80 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-81 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-82 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-350
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 15 Jun 2005 12:57:51 +0000
parents 0816b427495a
children 3723093a21fd fa9654493afb
line wrap: on
line source

@c This is part of the Emacs manual.
@c Copyright (C) 2000,2001,2002 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 Mac OS X supports most of its major features:
multiple frames, colors, scroll bars, menu bars, use of the mouse,
fontsets, international characters, input methods, coding systems,
asynchronous and synchronous subprocesses, unexec (@code{dump-emacs}),
and networking (@code{open-network-stream}).  Support for various
image file formats has not been implemented yet.

  The following features of Emacs are not yet supported on the Mac OS
8 or 9: unexec (@code{dump-emacs}), asynchronous subprocesses
(@code{start-process}), and networking (@code{open-network-stream}).
As a result, packages such as Gnus, GUD, and Comint do not work.
However, synchronous subprocesses (@code{call-process}) are supported.
Since external programs to handle commands such as @code{print-buffer}
and @code{diff} are not available on Mac OS 8 or 9, they are not
supported.

  Most of the features that are supported work in the same way as on
other platforms and are therefore documented in the rest of this
manual.  This section describes the peculiarities of using Emacs under
the Mac OS.

@menu
* 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.
@end menu

@node Mac Input
@section Keyboard Input on the Mac
@cindex Meta (Mac OS)
@cindex keyboard coding (Mac OS)
@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),
Emacs uses the @key{command} key as the @key{META} key.  Otherwise it
uses the @key{option} key as the @key{META} key.

  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-@acronym{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
@code{kTextEncodingISOLatin1}.  Note that not all Mac Roman characters
that can be entered at the keyboard can be converted to ISO Latin-1
characters.

  To enter ISO Latin-2 characters directly from the Mac keyboard, set
the value of @code{mac-keyboard-text-encoding} to
@code{kTextEncodingISOLatin2}.  Then let Emacs know that the keyboard
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:

@lisp
(set-keyboard-coding-system 'iso-latin-2)
@end lisp

@node Mac International
@section International Character Set Support on the Mac
@cindex Mac Roman coding system
@cindex clipboard support (Mac OS)

  The Mac uses a non-standard encoding for the upper 128 single-byte
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.

  Any native (non-symbol) Mac font can be used to correctly display
characters in the @code{mac-roman} coding system.

  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.

  To insert characters directly in the @code{mac-roman} coding system,
type @kbd{C-x @key{RET} k mac-roman @key{RET}}, customize the variable
@code{keyboard-coding-system}, or put this in your init file:

@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 (@pxref{International}).

  To use input methods provided by the Mac OS, set the keyboard coding
system accordingly using the @kbd{C-x @key{RET} k} command
(@code{set-keyboard-coding-system}).  For example, for Traditional
Chinese, use @samp{chinese-big5} as keyboard coding system; for
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
@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,
@samp{sjis-mac}).  @xref{Specify Coding}, for more details.


@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
inherits no environment variable values.

  On Mac OS 8 or 9, 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
@cindex file names (Mac OS)

  The directory structure in the Mac OS is seen by Emacs as

@example
/@var{volumename}/@var{filename}
@end example

So when Emacs requests a file name, doing file name completion on
@file{/} will display all volumes on the system.  You can use @file{..}
to go up a directory level.

  On Mac OS 8 or 9, 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}).

  On Mac OS 8 or 9, Emacs creates the Mac folder
@file{:Preferences:Emacs:} in the @file{System Folder} and uses it as
the temporary directory.  Emacs maps the directory name @file{/tmp/}
to that.  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
@cindex font names (Mac OS)

  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:

@smallexample
-@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}
@end smallexample

@noindent
@xref{Font X}.  Wildcards are supported as they are on X.

  Native Apple fonts in Mac Roman encoding has maker name @code{apple}
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
Korean fonts have charsets @samp{big5-0}, @samp{gb2312.1980-0},
@samp{jisx0208.1983-sjis}, and @samp{ksc5601.1989-0}, respectively.

  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
@section Mac-Specific Lisp Functions
@cindex Lisp functions specific to Mac OS

@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-file-name-to-posix
@findex posix-file-name-to-mac
  The function @code{mac-file-name-to-posix} takes a Mac file name and
returns the GNU or Unix equivalent.  The function
@code{posix-file-name-to-mac} performs the opposite conversion.  They
are useful for constructing AppleScript commands to be passed to
@code{do-applescript}.

@ignore
   arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6
@end ignore