diff options
| -rw-r--r-- | man/macos.texi | 369 |
1 files changed, 257 insertions, 112 deletions
diff --git a/man/macos.texi b/man/macos.texi index bcb25a7e52e..97952943893 100644 --- a/man/macos.texi +++ b/man/macos.texi | |||
| @@ -3,48 +3,47 @@ | |||
| 3 | @c 2005 Free Software Foundation, Inc. | 3 | @c 2005 Free Software Foundation, Inc. |
| 4 | @c See file emacs.texi for copying conditions. | 4 | @c See file emacs.texi for copying conditions. |
| 5 | @node Mac OS, MS-DOS, Antinews, Top | 5 | @node Mac OS, MS-DOS, Antinews, Top |
| 6 | @appendix Emacs and the Mac OS | 6 | @appendix Emacs and Mac OS |
| 7 | @cindex Mac OS | 7 | @cindex Mac OS |
| 8 | @cindex Macintosh | 8 | @cindex Macintosh |
| 9 | 9 | ||
| 10 | Emacs built on Mac OS X supports most of its major features: | 10 | This section briefly describes the peculiarities of using Emacs |
| 11 | multiple frames, colors, scroll bars, menu bars, use of the mouse, | 11 | under Mac OS with native window system support. For Mac OS X, Emacs |
| 12 | fontsets, international characters, input methods, coding systems, | 12 | can be built either without window system support, with X11, or with |
| 13 | asynchronous and synchronous subprocesses, unexec (@code{dump-emacs}), | 13 | Carbon API. This section only applies to the Carbon build. For Mac |
| 14 | and networking (@code{open-network-stream}). Support for various | 14 | OS Classic, Emacs can be built with or without Carbon API, and this |
| 15 | image file formats has not been implemented yet. | 15 | section applies to either of them because they run on the native |
| 16 | 16 | window system. | |
| 17 | The following features of Emacs are not yet supported on the Mac OS | 17 | |
| 18 | 8 or 9: unexec (@code{dump-emacs}), asynchronous subprocesses | 18 | Emacs built on Mac OS X supports most of its major features except |
| 19 | (@code{start-process}), and networking (@code{open-network-stream}). | 19 | display support of PostScript images. The following features of Emacs |
| 20 | As a result, packages such as Gnus, GUD, and Comint do not work. | 20 | are not supported on Mac OS Classic: unexec (@code{dump-emacs}), |
| 21 | However, synchronous subprocesses (@code{call-process}) are supported. | 21 | asynchronous subprocesses (@code{start-process}), and networking |
| 22 | Since external programs to handle commands such as @code{print-buffer} | 22 | (@code{open-network-stream}). As a result, packages such as Gnus, |
| 23 | and @code{diff} are not available on Mac OS 8 or 9, they are not | 23 | GUD, and Comint do not work. Synchronous subprocesses |
| 24 | supported. | 24 | (@code{call-process}) are supported on non-Carbon build, but |
| 25 | 25 | specially-crafted external programs are needed. Since external | |
| 26 | Most of the features that are supported work in the same way as on | 26 | programs to handle commands such as @code{print-buffer} and |
| 27 | other platforms and are therefore documented in the rest of this | 27 | @code{diff} are not available on Mac OS Classic, they are not |
| 28 | manual. This section describes the peculiarities of using Emacs under | 28 | supported. Non-Carbon build on Mac OS Classic does not support some |
| 29 | the Mac OS. | 29 | features such as file dialogs, drag-and-drop, and Unicode menus. |
| 30 | 30 | ||
| 31 | @menu | 31 | @menu |
| 32 | * Input: Mac Input. Keyboard input on the Mac. | 32 | * Input: Mac Input. Keyboard and mouse input on Mac. |
| 33 | * Intl: Mac International. International character sets on the Mac. | 33 | * Intl: Mac International. International character sets on Mac. |
| 34 | * Env: Mac Environment Variables. Setting environment variables for Emacs. | 34 | * Env: Mac Environment Variables. Setting environment variables for Emacs. |
| 35 | * Directories: Mac Directories. Volumes and directories on the Mac. | 35 | * Directories: Mac Directories. Volumes and directories on Mac. |
| 36 | * Font: Mac Font Specs. Specifying fonts on the Mac. | 36 | * Font: Mac Font Specs. Specifying fonts on Mac. |
| 37 | * Functions: Mac Functions. Mac-specific Lisp functions. | 37 | * Functions: Mac Functions. Mac-specific Lisp functions. |
| 38 | @end menu | 38 | @end menu |
| 39 | 39 | ||
| 40 | @node Mac Input | 40 | @node Mac Input |
| 41 | @section Keyboard Input on the Mac | 41 | @section Keyboard and Mouse Input on Mac |
| 42 | @cindex Meta (Mac OS) | 42 | @cindex Meta (Mac OS) |
| 43 | @cindex keyboard coding (Mac OS) | 43 | @cindex keyboard coding (Mac OS) |
| 44 | @vindex mac-command-key-is-meta | ||
| 45 | @vindex mac-keyboard-text-encoding | ||
| 46 | 44 | ||
| 47 | On the Mac, Emacs can use either the @key{option} key or the | 45 | @vindex mac-command-key-is-meta |
| 46 | On Mac, Emacs can use either the @key{option} key or the | ||
| 48 | @key{command} key as the @key{META} key. If the value of the variable | 47 | @key{command} key as the @key{META} key. If the value of the variable |
| 49 | @code{mac-command-key-is-meta} is non-@code{nil} (its default value), | 48 | @code{mac-command-key-is-meta} is non-@code{nil} (its default value), |
| 50 | Emacs uses the @key{command} key as the @key{META} key. Otherwise it | 49 | Emacs uses the @key{command} key as the @key{META} key. Otherwise it |
| @@ -55,89 +54,124 @@ so that dead-key processing with the @key{option} key will still work. This is | |||
| 55 | useful for entering non-@acronym{ASCII} Latin characters directly from the Mac | 54 | useful for entering non-@acronym{ASCII} Latin characters directly from the Mac |
| 56 | keyboard, for example. | 55 | keyboard, for example. |
| 57 | 56 | ||
| 58 | Emacs recognizes the setting in the Keyboard control panel and | 57 | Emacs recognizes the setting in the Keyboard control panel (Mac OS |
| 59 | supports international and alternative keyboard layouts (e.g., Dvorak). | 58 | Classic) or the International system preference pane (Mac OS X) and |
| 60 | Selecting one of the layouts from the keyboard layout pull-down menu | 59 | supports international and alternative keyboard layouts (e.g., Dvorak) |
| 61 | will affect how the keys typed on the keyboard are interpreted. | 60 | if its script is either Roman, Japanese, Traditional Chinese, Korean, |
| 62 | 61 | Cyrillic, Simplified Chinese, or Central European. Keyboard layouts | |
| 63 | The Mac OS intercepts and handles certain key combinations (e.g., | 62 | based on Unicode may not work properly. Selecting one of the layouts |
| 63 | from the keyboard layout pull-down menu will affect how the keys typed | ||
| 64 | on the keyboard are interpreted. | ||
| 65 | |||
| 66 | @vindex mac-pass-command-to-system | ||
| 67 | @vindex mac-pass-control-to-system | ||
| 68 | Mac OS intercepts and handles certain key combinations (e.g., | ||
| 64 | @key{command}-@key{SPC} for switching input languages). These will not | 69 | @key{command}-@key{SPC} for switching input languages). These will not |
| 65 | be passed to Emacs. | 70 | be passed to Emacs. One can disable this interception by setting |
| 66 | 71 | @code{mac-pass-command-to-system} or @code{mac-pass-control-to-system} | |
| 67 | The Mac keyboard ordinarily generates characters in the Mac Roman | 72 | to @code{nil}. |
| 68 | encoding. To use it for entering ISO Latin-1 characters directly, set | 73 | |
| 69 | the value of the variable @code{mac-keyboard-text-encoding} to | 74 | @vindex mac-emulate-three-button-mouse |
| 70 | @code{kTextEncodingISOLatin1}. Note that not all Mac Roman characters | 75 | Especially for one-button mice, the multiple button feature can be |
| 71 | that can be entered at the keyboard can be converted to ISO Latin-1 | 76 | emulated by setting @code{mac-emulate-three-button-mouse} to @code{t} |
| 72 | characters. | 77 | or @code{reverse}. If set to @code{t} (@code{reverse}, respectively), |
| 73 | 78 | pressing the mouse button with the @key{option} key is recognized as | |
| 74 | To enter ISO Latin-2 characters directly from the Mac keyboard, set | 79 | the second (third) button, and that with the @key{command} key is |
| 75 | the value of @code{mac-keyboard-text-encoding} to | 80 | recognized as the third (second) button. |
| 76 | @code{kTextEncodingISOLatin2}. Then let Emacs know that the keyboard | 81 | |
| 77 | generates Latin-2 codes, by typing @kbd{C-x @key{RET} k iso-latin-2 | 82 | @vindex mac-wheel-button-is-mouse-2 |
| 78 | @key{RET}}. To make this setting permanent, put this in your | 83 | For multi-button mice, the wheel button and the secondary button are |
| 79 | @file{.emacs} init file: | 84 | recognized as the second and the third button, respectively. If |
| 80 | 85 | @code{mac-wheel-button-is-mouse-2} is set to @code{nil}, their roles | |
| 81 | @lisp | 86 | are exchanged. |
| 82 | (set-keyboard-coding-system 'iso-latin-2) | ||
| 83 | @end lisp | ||
| 84 | 87 | ||
| 85 | @node Mac International | 88 | @node Mac International |
| 86 | @section International Character Set Support on the Mac | 89 | @section International Character Set Support on Mac |
| 87 | @cindex Mac Roman coding system | 90 | @cindex Mac Roman coding system |
| 88 | @cindex clipboard support (Mac OS) | 91 | @cindex clipboard support (Mac OS) |
| 89 | 92 | ||
| 90 | The Mac uses a non-standard encoding for the upper 128 single-byte | 93 | Mac uses non-standard encodings for the upper 128 single-byte |
| 91 | characters. It also deviates from the ISO 2022 standard by using | 94 | characters. They also deviate from the ISO 2022 standard by using |
| 92 | character codes in the range 128-159. The coding system | 95 | character codes in the range 128-159. The coding systems |
| 93 | @code{mac-roman} is used to represent this Mac encoding. It is used | 96 | @code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic} |
| 94 | for editing files stored in this native encoding, and for displaying | 97 | are used to represent these Mac encodings. |
| 95 | file names in Dired mode. | ||
| 96 | |||
| 97 | Any native (non-symbol) Mac font can be used to correctly display | ||
| 98 | characters in the @code{mac-roman} coding system. | ||
| 99 | 98 | ||
| 100 | The fontset @code{fontset-mac} is created automatically when Emacs | 99 | The fontset @code{fontset-mac} is created automatically when Emacs |
| 101 | is run on the Mac. It displays characters in the @code{mac-roman} | 100 | is run on Mac, and used by default. It displays as many kinds of |
| 102 | coding system using 12-point Monaco. | 101 | characters as possible using 12-point Monaco as a base font. If you |
| 103 | 102 | see some character as a hollow box with this fontset, then it's almost | |
| 104 | To insert characters directly in the @code{mac-roman} coding system, | 103 | impossible to display it only by customizing font settings (@pxref{Mac |
| 105 | type @kbd{C-x @key{RET} k mac-roman @key{RET}}, customize the variable | 104 | Font Specs}). |
| 106 | @code{keyboard-coding-system}, or put this in your init file: | ||
| 107 | |||
| 108 | @lisp | ||
| 109 | (set-keyboard-coding-system 'mac-roman) | ||
| 110 | @end lisp | ||
| 111 | |||
| 112 | @noindent | ||
| 113 | This is useful for editing documents in native Mac encoding. | ||
| 114 | 105 | ||
| 115 | You can use input methods provided either by LEIM (@pxref{Input | 106 | You can use input methods provided either by LEIM (@pxref{Input |
| 116 | Methods}) or the Mac OS to enter international characters. | 107 | Methods}) or Mac OS to enter international characters. To use the |
| 117 | 108 | former, see the International Character Set Support section of the | |
| 118 | To use the former, see the International Character Set Support section | 109 | manual (@pxref{International}). |
| 119 | of the manual (@pxref{International}). | ||
| 120 | 110 | ||
| 121 | To use input methods provided by the Mac OS, set the keyboard coding | 111 | Emacs on Mac OS automatically changes the value of |
| 122 | system accordingly using the @kbd{C-x @key{RET} k} command | 112 | @code{keyboard-coding-system} according to the current keyboard |
| 123 | (@code{set-keyboard-coding-system}). For example, for Traditional | 113 | layout. So users don't need to set it manually, and even if set, it |
| 124 | Chinese, use @samp{chinese-big5} as keyboard coding system; for | 114 | will be changed when the keyboard layout change is detected next time. |
| 125 | Japanese, use @samp{sjis}, etc. Then select the desired input method in | ||
| 126 | the keyboard layout pull-down menu. | ||
| 127 | 115 | ||
| 128 | The Mac clipboard and the Emacs kill ring (@pxref{Killing}) are | 116 | The Mac clipboard and the Emacs kill ring (@pxref{Killing}) are |
| 129 | connected as follows: the most recent kill is copied to the clipboard | 117 | synchronized by default: you can yank a piece of text and paste it |
| 130 | when Emacs is suspended and the contents of the clipboard is inserted | 118 | into another Mac application, or cut or copy one in another Mac |
| 131 | into the kill ring when Emacs resumes. The result is that you can yank | 119 | application and yank it into a Emacs buffer. This feature can be |
| 132 | a piece of text and paste it into another Mac application, or cut or copy | 120 | disabled by setting @code{x-select-enable-clipboard} to @code{nil}. |
| 133 | one in another Mac application and yank it into a Emacs buffer. | 121 | One can still do copy and paste with another application from the Edit |
| 134 | 122 | menu. | |
| 135 | The encoding of text selections must be specified using the commands | 123 | |
| 136 | @kbd{C-x @key{RET} x} (@code{set-selection-coding-system}) or @kbd{C-x | 124 | On Mac, the role of the coding system for selection that is set by |
| 137 | @key{RET} X} (@code{set-next-selection-coding-system}) (e.g., for | 125 | @code{set-selection-coding-system} (@pxref{Specify Coding}) is |
| 138 | Traditional Chinese, use @samp{chinese-big5-mac} and for Japanese, | 126 | two-fold. First, it is used as a preferred coding system for the |
| 139 | @samp{sjis-mac}). @xref{Specify Coding}, for more details. | 127 | traditional text flavor that does not specify any particular encodings |
| 140 | 128 | and is mainly used by applications on Mac OS Classic. Second, it | |
| 129 | specifies the intermediate encoding for the UTF-16 text flavor that is | ||
| 130 | mainly used by applications on Mac OS X. | ||
| 131 | |||
| 132 | When pasting UTF-16 text data from the clipboard, it is first | ||
| 133 | converted to the encoding specified by the selection coding system | ||
| 134 | using the converter in the Mac OS system, and then decoded into the | ||
| 135 | Emacs internal encoding using the converter in Emacs. If the first | ||
| 136 | conversion failed, then the UTF-16 data is directly converted to Emacs | ||
| 137 | internal encoding using the converter in Emacs. Copying UTF-16 text | ||
| 138 | to the clipboard goes through the inverse path. The reason for this | ||
| 139 | two-path decoding is to avoid subtle differences in Unicode mappings | ||
| 140 | between the Mac OS system and Emacs such as various kinds of hyphens, | ||
| 141 | and to minimize users' customization. For example, users that mainly | ||
| 142 | use Latin characters would prefer Greek characters to be decoded into | ||
| 143 | the @code{mule-unicode-0100-24ff} charset, but Japanese users would | ||
| 144 | prefer them to be decoded into the @code{japanese-jisx0208} charset. | ||
| 145 | Since the coding system for selection is automatically set according | ||
| 146 | to the system locale setting, users usually don't have to set it | ||
| 147 | manually. | ||
| 148 | |||
| 149 | The default language environment (@pxref{Language Environments}) is | ||
| 150 | set according to the locale setting at the startup time. On Mac OS, | ||
| 151 | the locale setting is consulted in the following order: | ||
| 152 | |||
| 153 | @enumerate | ||
| 154 | @item | ||
| 155 | Environment variables @env{LC_ALL}, @env{LC_CTYPE} and @env{LANG} as | ||
| 156 | in other systems. | ||
| 157 | |||
| 158 | @item | ||
| 159 | Preference @code{AppleLocale} that is set by default on Mac OS X 10.3 | ||
| 160 | and later. | ||
| 161 | |||
| 162 | @item | ||
| 163 | Preference @code{AppleLanguages} that is set by default on Mac OS X | ||
| 164 | 10.1 and later. | ||
| 165 | |||
| 166 | @item | ||
| 167 | Variable @code{mac-system-locale} that is derived from the system | ||
| 168 | language and region codes. This variable is available on all | ||
| 169 | supported Mac OS versions including Mac OS Classic. | ||
| 170 | @end enumerate | ||
| 171 | |||
| 172 | The default values of almost all variables about coding systems are | ||
| 173 | also set according to the language environment. So usually you don't | ||
| 174 | have to customize these variables manually. | ||
| 141 | 175 | ||
| 142 | @node Mac Environment Variables | 176 | @node Mac Environment Variables |
| 143 | @section Environment Variables and Command Line Arguments. | 177 | @section Environment Variables and Command Line Arguments. |
| @@ -145,10 +179,23 @@ Traditional Chinese, use @samp{chinese-big5-mac} and for Japanese, | |||
| 145 | 179 | ||
| 146 | On Mac OS X, when Emacs is run in a terminal, it inherits the values | 180 | On Mac OS X, when Emacs is run in a terminal, it inherits the values |
| 147 | of environment variables from the shell from which it is invoked. | 181 | of environment variables from the shell from which it is invoked. |
| 148 | However, when it is run from the Finder as a GUI application, it | 182 | However, when it is run from the Finder as a GUI application, it only |
| 149 | inherits no environment variable values. | 183 | inherits environment variable values defined in the file |
| 184 | @file{~/.MacOSX/environment.plist} that affects all the applications | ||
| 185 | invoked from the Finder or the @command{open} command. | ||
| 150 | 186 | ||
| 151 | On Mac OS 8 or 9, environment variables and command line arguments | 187 | Command line arguments are specified like |
| 188 | |||
| 189 | @example | ||
| 190 | /Applications/Emacs.app/Contents/MacOS/Emacs -geometry 80x25 & | ||
| 191 | @end example | ||
| 192 | |||
| 193 | @noindent | ||
| 194 | if Emacs is installed at @file{/Applications/Emacs.app}. If Emacs is | ||
| 195 | invoked like this, then it also inherits the values of environment | ||
| 196 | variables from the shell from which it is invoked. | ||
| 197 | |||
| 198 | On Mac OS Classic, environment variables and command line arguments | ||
| 152 | for Emacs can be set by modifying the @samp{STR#} resources 128 and | 199 | for Emacs can be set by modifying the @samp{STR#} resources 128 and |
| 153 | 129, respectively. A common environment variable that one may want to | 200 | 129, respectively. A common environment variable that one may want to |
| 154 | set is @samp{HOME}. | 201 | set is @samp{HOME}. |
| @@ -169,12 +216,45 @@ string | |||
| 169 | EMACS_UNIBYTE=1 | 216 | EMACS_UNIBYTE=1 |
| 170 | @end example | 217 | @end example |
| 171 | 218 | ||
| 219 | @cindex Mac Preferences | ||
| 220 | Although Emacs on Mac does not support X resources (@pxref{X | ||
| 221 | Resources}) directly, one can use the Preferences system in place of X | ||
| 222 | resources. For example, adding the line | ||
| 223 | |||
| 224 | @example | ||
| 225 | Emacs.cursorType: bar | ||
| 226 | @end example | ||
| 227 | |||
| 228 | @noindent | ||
| 229 | to @file{~/.Xresources} in X11 corresponds to the execution of | ||
| 230 | |||
| 231 | @example | ||
| 232 | defaults write org.gnu.Emacs Emacs.cursorType bar | ||
| 233 | @end example | ||
| 234 | |||
| 235 | @noindent | ||
| 236 | on Mac OS X. One can use boolean or numeric values as well as string | ||
| 237 | values as follows: | ||
| 238 | |||
| 239 | @example | ||
| 240 | defaults write org.gnu.Emacs Emacs.toolBar -bool false | ||
| 241 | defaults write org.gnu.Emacs Emacs.lineSpacing -int 3 | ||
| 242 | @end example | ||
| 243 | |||
| 244 | @noindent | ||
| 245 | Try @kbd{M-x man RET defaults RET} for the usage of the | ||
| 246 | @command{defaults} command. Alternatively, if you have Developer | ||
| 247 | Tools installed on Mac OS X, you can use Property List Editor to edit | ||
| 248 | the file @file{~/Library/Preferences/org.gnu.Emacs.plist}. | ||
| 249 | |||
| 172 | 250 | ||
| 173 | @node Mac Directories | 251 | @node Mac Directories |
| 174 | @section Volumes and Directories on the Mac | 252 | @section Volumes and Directories on Mac |
| 175 | @cindex file names (Mac OS) | 253 | @cindex file names (Mac OS) |
| 176 | 254 | ||
| 177 | The directory structure in the Mac OS is seen by Emacs as | 255 | This node applies to Mac OS Classic only. |
| 256 | |||
| 257 | The directory structure in Mac OS Classic is seen by Emacs as | ||
| 178 | 258 | ||
| 179 | @example | 259 | @example |
| 180 | /@var{volumename}/@var{filename} | 260 | /@var{volumename}/@var{filename} |
| @@ -184,11 +264,11 @@ So when Emacs requests a file name, doing file name completion on | |||
| 184 | @file{/} will display all volumes on the system. You can use @file{..} | 264 | @file{/} will display all volumes on the system. You can use @file{..} |
| 185 | to go up a directory level. | 265 | to go up a directory level. |
| 186 | 266 | ||
| 187 | On Mac OS 8 or 9, to access files and folders on the desktop, look | 267 | On Mac OS Classic, to access files and folders on the desktop, look |
| 188 | in the folder @file{Desktop Folder} in your boot volume (this folder | 268 | in the folder @file{Desktop Folder} in your boot volume (this folder |
| 189 | is usually invisible in the Mac @code{Finder}). | 269 | is usually invisible in the Mac @code{Finder}). |
| 190 | 270 | ||
| 191 | On Mac OS 8 or 9, Emacs creates the Mac folder | 271 | On Mac OS Classic, Emacs creates the Mac folder |
| 192 | @file{:Preferences:Emacs:} in the @file{System Folder} and uses it as | 272 | @file{:Preferences:Emacs:} in the @file{System Folder} and uses it as |
| 193 | the temporary directory. Emacs maps the directory name @file{/tmp/} | 273 | the temporary directory. Emacs maps the directory name @file{/tmp/} |
| 194 | to that. Therefore it is best to avoid naming a volume @file{tmp}. | 274 | to that. Therefore it is best to avoid naming a volume @file{tmp}. |
| @@ -199,12 +279,12 @@ created. | |||
| 199 | 279 | ||
| 200 | 280 | ||
| 201 | @node Mac Font Specs | 281 | @node Mac Font Specs |
| 202 | @section Specifying Fonts on the Mac | 282 | @section Specifying Fonts on Mac |
| 203 | @cindex font names (Mac OS) | 283 | @cindex font names (Mac OS) |
| 204 | 284 | ||
| 205 | It is rare that you need to specify a font name in Emacs; usually | 285 | It is rare that you need to specify a font name in Emacs; usually |
| 206 | you specify face attributes instead. But when you do need to specify | 286 | you specify face attributes instead. But when you do need to specify |
| 207 | a font name in Emacs on the Mac, use a standard X font name: | 287 | a font name in Emacs on Mac, use a standard X font name: |
| 208 | 288 | ||
| 209 | @smallexample | 289 | @smallexample |
| 210 | -@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{} | 290 | -@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{} |
| @@ -216,11 +296,57 @@ a font name in Emacs on the Mac, use a standard X font name: | |||
| 216 | 296 | ||
| 217 | Native Apple fonts in Mac Roman encoding has maker name @code{apple} | 297 | Native Apple fonts in Mac Roman encoding has maker name @code{apple} |
| 218 | and charset @code{mac-roman}. For example 12-point Monaco can be | 298 | and charset @code{mac-roman}. For example 12-point Monaco can be |
| 219 | specified by the name @samp{-apple-monaco-*-12-*-mac-roman}. | 299 | specified by the name @samp{-apple-monaco-*-12-*-mac-roman}. When |
| 300 | using a particular size of scalable fonts, it must be specified in a | ||
| 301 | format containing 14 @samp{-}s like | ||
| 302 | @samp{-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman}. | ||
| 303 | |||
| 304 | You can specify a @code{mac-roman} font for @acronym{ASCII} | ||
| 305 | characters like | ||
| 220 | 306 | ||
| 221 | Native Apple Traditional Chinese, Simplified Chinese, Japanese, and | 307 | @lisp |
| 222 | Korean fonts have charsets @samp{big5-0}, @samp{gb2312.1980-0}, | 308 | (add-to-list |
| 223 | @samp{jisx0208.1983-sjis}, and @samp{ksc5601.1989-0}, respectively. | 309 | 'default-frame-alist |
| 310 | '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman")) | ||
| 311 | @end lisp | ||
| 312 | |||
| 313 | @noindent | ||
| 314 | but that does not extend to ISO-8859-1: specifying a @code{mac-roman} | ||
| 315 | font for Latin-1 characters introduces wrong glyphs. | ||
| 316 | |||
| 317 | Native Apple Traditional Chinese, Simplified Chinese, Japanese, | ||
| 318 | Korean, Central European, Cyrillic, Symbol, and Dingbats fonts have | ||
| 319 | charsets @samp{big5-0}, @samp{gb2312.1980-0}, | ||
| 320 | @samp{jisx0208.1983-sjis} and @samp{jisx0201.1976-0}, | ||
| 321 | @samp{ksc5601.1989-0}, @samp{mac-centraleurroman}, | ||
| 322 | @samp{mac-cyrillic}, @samp{mac-symbol}, and @samp{mac-dingbats}, | ||
| 323 | respectively. | ||
| 324 | |||
| 325 | Since Emacs as of the current version uses QuickDraw Text routines | ||
| 326 | for drawing texts, only characters in the charsets listed above can be | ||
| 327 | displayed with the OS-bundled fonts, even if other applications that | ||
| 328 | use @acronym{ATSUI} or Cocoa can display variety of characters with | ||
| 329 | them. | ||
| 330 | |||
| 331 | The use of @code{create-fontset-from-fontset-spec} (@pxref{Defining | ||
| 332 | Fontsets}) for defining fontsets often results in wrong ones | ||
| 333 | especially when using only OS-bundled fonts. The recommended way is | ||
| 334 | to create a fontset using @code{create-fontset-from-mac-roman-font}: | ||
| 335 | |||
| 336 | @lisp | ||
| 337 | (create-fontset-from-mac-roman-font | ||
| 338 | "-apple-courier-medium-r-normal--13-*-*-*-*-*-mac-roman" | ||
| 339 | nil "foo") | ||
| 340 | @end lisp | ||
| 341 | |||
| 342 | @noindent | ||
| 343 | and then optionally specifying Chinese, Japanese, or Korean font | ||
| 344 | families using @code{set-fontset-font}: | ||
| 345 | |||
| 346 | @lisp | ||
| 347 | (set-fontset-font "fontset-foo" | ||
| 348 | 'chinese-gb2312 '("song" . "gb2312.1980-0")) | ||
| 349 | @end lisp | ||
| 224 | 350 | ||
| 225 | Single-byte fonts converted from GNU fonts in BDF format, which are not | 351 | Single-byte fonts converted from GNU fonts in BDF format, which are not |
| 226 | in the Mac Roman encoding, have foundry, family, and character sets | 352 | in the Mac Roman encoding, have foundry, family, and character sets |
| @@ -228,6 +354,12 @@ encoded in the names of their font suitcases. E.g., the font suitcase | |||
| 228 | @samp{ETL-Fixed-ISO8859-1} contains fonts which can be referred to by | 354 | @samp{ETL-Fixed-ISO8859-1} contains fonts which can be referred to by |
| 229 | the name @samp{-ETL-fixed-*-iso8859-1}. | 355 | the name @samp{-ETL-fixed-*-iso8859-1}. |
| 230 | 356 | ||
| 357 | @vindex mac-allow-anti-aliasing | ||
| 358 | Emacs uses the QuickDraw text rendering by default. On Mac OS X | ||
| 359 | 10.2 and later, it can be changed so that it uses the Quartz 2D text | ||
| 360 | rendering (aka CG text rendering) by setting | ||
| 361 | @code{mac-allow-anti-aliasing} to @code{t}. However, it is reported | ||
| 362 | to sometimes leave some garbages. | ||
| 231 | 363 | ||
| 232 | @node Mac Functions | 364 | @node Mac Functions |
| 233 | @section Mac-Specific Lisp Functions | 365 | @section Mac-Specific Lisp Functions |
| @@ -246,6 +378,19 @@ returns the GNU or Unix equivalent. The function | |||
| 246 | are useful for constructing AppleScript commands to be passed to | 378 | are useful for constructing AppleScript commands to be passed to |
| 247 | @code{do-applescript}. | 379 | @code{do-applescript}. |
| 248 | 380 | ||
| 381 | @findex mac-set-file-creator | ||
| 382 | @findex mac-get-file-creator | ||
| 383 | @findex mac-set-file-type | ||
| 384 | @findex mac-get-file-type | ||
| 385 | The functions @code{mac-set-file-creator}, | ||
| 386 | @code{mac-get-file-creator}, @code{mac-set-file-type}, and | ||
| 387 | @code{mac-get-file-type} can be used to set and get creator and file | ||
| 388 | codes. | ||
| 389 | |||
| 390 | @findex mac-get-preference | ||
| 391 | The function @code{mac-get-preference} returns the preferences value | ||
| 392 | converted to a Lisp object for a specified key and application. | ||
| 393 | |||
| 249 | @ignore | 394 | @ignore |
| 250 | arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6 | 395 | arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6 |
| 251 | @end ignore | 396 | @end ignore |