diff options
| author | Adrian Robert | 2008-11-26 05:27:11 +0000 |
|---|---|---|
| committer | Adrian Robert | 2008-11-26 05:27:11 +0000 |
| commit | a71703d369edebf916611544d1b2a57a32e66848 (patch) | |
| tree | 711fa1efe3d05e9a5c8fb6aba4b02b6390923adc | |
| parent | 5c6e52b01b2b9ac56dd40c424a4543446dae41ee (diff) | |
| download | emacs-a71703d369edebf916611544d1b2a57a32e66848.tar.gz emacs-a71703d369edebf916611544d1b2a57a32e66848.zip | |
* macos.texi: Add Prev/Next/Top pointers to all nodes. (Mac Basics): Merge in Grabbing Environment Variables from earlier version. (Mac Customization): Rewrite Preferences Panel section and merge in to this node, add Open files by dragging to an Emacs window. * emacs.texi: Remove TOC reference to Mac Preferences Panel section.
| -rw-r--r-- | doc/emacs/ChangeLog | 10 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 1 | ||||
| -rw-r--r-- | doc/emacs/macos.texi | 360 |
3 files changed, 208 insertions, 163 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 9b9f6556c04..f92030b3165 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2008-11-26 Adrian Robert <Adrian.B.Robert@gmail.com> | ||
| 2 | |||
| 3 | * macos.texi: Add Prev/Next/Top pointers to all nodes. | ||
| 4 | (Mac Basics): Merge in Grabbing Environment Variables from earlier | ||
| 5 | version. | ||
| 6 | (Mac Customization): Rewrite Preferences Panel section and merge in to | ||
| 7 | this node, add Open files by dragging to an Emacs window. | ||
| 8 | |||
| 9 | * emacs.texi: Remove TOC reference to Mac Preferences Panel section. | ||
| 10 | |||
| 1 | 2008-11-26 Chong Yidong <cyd@stupidchicken.com> | 11 | 2008-11-26 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 12 | ||
| 3 | * windows.texi (Split Window): Document integer values of | 13 | * windows.texi (Split Window): Document integer values of |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 725ef53b7f9..6967c13d549 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -984,7 +984,6 @@ Emacs and Mac OS | |||
| 984 | 984 | ||
| 985 | * Mac Basics:: Basic Emacs usage in Mac OS. | 985 | * Mac Basics:: Basic Emacs usage in Mac OS. |
| 986 | * Mac Events:: How window system events are handled. | 986 | * Mac Events:: How window system events are handled. |
| 987 | * Mac Preferences:: Using the Preferences Panel to customize Emacs. | ||
| 988 | * Mac Customization:: Customizations in Mac OS | 987 | * Mac Customization:: Customizations in Mac OS |
| 989 | 988 | ||
| 990 | Emacs and Microsoft Windows/MS-DOS | 989 | Emacs and Microsoft Windows/MS-DOS |
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi index 05a5836e1dc..85f87fdf046 100644 --- a/doc/emacs/macos.texi +++ b/doc/emacs/macos.texi | |||
| @@ -26,12 +26,11 @@ not fully functional, but we hope to improve it in the future. | |||
| 26 | 26 | ||
| 27 | @menu | 27 | @menu |
| 28 | * Mac Basics:: Basic Emacs usage in Mac OS. | 28 | * Mac Basics:: Basic Emacs usage in Mac OS. |
| 29 | * Mac Events:: How window system events are handled. | ||
| 30 | * Mac Preferences:: Using the Preferences Panel to customize Emacs. | ||
| 31 | * Mac Customization:: Customizations in Mac OS | 29 | * Mac Customization:: Customizations in Mac OS |
| 30 | * Mac Events:: How window system events are handled. | ||
| 32 | @end menu | 31 | @end menu |
| 33 | 32 | ||
| 34 | @node Mac Basics | 33 | @node Mac Basics, Mac Customization, , Mac OS |
| 35 | @section Basic Emacs usage in Mac OS | 34 | @section Basic Emacs usage in Mac OS |
| 36 | 35 | ||
| 37 | By default, the @key{alt} and @key{option} keys are the same as | 36 | By default, the @key{alt} and @key{option} keys are the same as |
| @@ -40,7 +39,7 @@ same as @key{Super}, and Emacs provides a set of keybindings using | |||
| 40 | this modifier key that mimic other Mac applications (@pxref{Mac | 39 | this modifier key that mimic other Mac applications (@pxref{Mac |
| 41 | Events}). You can change these bindings in the usual way (@pxref{Key | 40 | Events}). You can change these bindings in the usual way (@pxref{Key |
| 42 | Bindings}), or by using the Mac preferences panel (@pxref{Mac | 41 | Bindings}), or by using the Mac preferences panel (@pxref{Mac |
| 43 | Preferences}). | 42 | Customization}). |
| 44 | 43 | ||
| 45 | The standard Mac font and color panels are accessible via the | 44 | The standard Mac font and color panels are accessible via the |
| 46 | @samp{Windows} menu, or via the standard @key{Cmd-t} and @key{Cmd-C} | 45 | @samp{Windows} menu, or via the standard @key{Cmd-t} and @key{Cmd-C} |
| @@ -64,11 +63,6 @@ dialogs to read file names. However, if you use the regular Emacs key | |||
| 64 | sequences, such as @key{C-x C-f}, Emacs uses the minibuffer to read | 63 | sequences, such as @key{C-x C-f}, Emacs uses the minibuffer to read |
| 65 | file names. | 64 | file names. |
| 66 | 65 | ||
| 67 | When Emacs is called by a name which ends in @file{-nw}, it will | ||
| 68 | always start in terminal mode. For example, if you need a | ||
| 69 | terminal-only Emacs, create a symbolic link from @file{emacs} to | ||
| 70 | @file{emacs-nw} and launch @file{emacs-nw}. | ||
| 71 | |||
| 72 | On GNUstep, in an X-windows environment you need to use @key{Cmd-c} | 66 | On GNUstep, in an X-windows environment you need to use @key{Cmd-c} |
| 73 | instead of one of the @key{C-w} or @key{M-w} commands to transfer text | 67 | instead of one of the @key{C-w} or @key{M-w} commands to transfer text |
| 74 | to the X primary selection; otherwise, Emacs will use the | 68 | to the X primary selection; otherwise, Emacs will use the |
| @@ -76,192 +70,149 @@ to the X primary selection; otherwise, Emacs will use the | |||
| 76 | yanks from the X primary selection instead of the kill-ring or | 70 | yanks from the X primary selection instead of the kill-ring or |
| 77 | clipboard. | 71 | clipboard. |
| 78 | 72 | ||
| 79 | @node Mac Events | ||
| 80 | @section Windowing System Events in Mac OS X | ||
| 81 | 73 | ||
| 82 | Nextstep applications receive a number of special events which have | 74 | @subsection Grabbing environment variables |
| 83 | no X equivalent. These are sent as specially defined ``keys'', which | ||
| 84 | do not correspond to any sequence of keystrokes. Under Emacs, these | ||
| 85 | ``key'' events can be bound to functions just like ordinary | ||
| 86 | keystrokes. Here is a list of these events. | ||
| 87 | 75 | ||
| 88 | @table @key | 76 | Many programs which may run under Emacs like latex or man depend on the |
| 89 | @item ns-open-file | 77 | settings of environment variables. If Emacs is launched from the shell, it |
| 90 | @vindex ns-pop-up-frames | 78 | will automatically inherit these environment variables and its subprocesses |
| 91 | This event occurs when another Nextstep application requests that | 79 | will inherit them from it. But if Emacs.app is launched from the Finder it |
| 92 | Emacs open a file. A typical reason for this would be a user | 80 | is not a descendant of any shell, so its environment variables haven't been |
| 93 | double-clicking a file in the Finder application. By default, Emacs | 81 | set which often causes the subprocesses it launches to behave differently than |
| 94 | responds to this event by opening a new frame and visiting the file in | 82 | they would when launched from the shell. |
| 95 | that frame (@code{ns-find-file}), As an exception, if the selected | ||
| 96 | buffer is the @samp{*scratch*} buffer, Emacs visits the file in the | ||
| 97 | the selected frame. | ||
| 98 | 83 | ||
| 99 | You can change how Emacs responds to @key{ns-open-file} by changing | 84 | To solve this problem for Emacs.app, there are two solutions. First is to |
| 100 | the variable @code{ns-pop-up-frames}. Its default value, | 85 | run, from the command line: |
| 101 | @code{'fresh}, is what we have just described. A value of @code{t} | ||
| 102 | means to always visit the file in a new frame. A value of @code{nil} | ||
| 103 | means to always visit the file in an existing frame. | ||
| 104 | 86 | ||
| 105 | @item ns-open-temp-file | 87 | @example |
| 106 | This event occurs when another application requests that Emacs open a | 88 | .../Emacs.app/Contents/MacOS/bin/mac-fix-env |
| 107 | temporary file. By default, this is handled by just generating a | 89 | @end example |
| 108 | @code{ns-open-file} event, the results of which are described above. | ||
| 109 | 90 | ||
| 110 | You can bind @key{ns-pop-up-frames} and @key{ns-open-temp-file} to | 91 | This will pick up your environment settings and save them into a special file |
| 111 | other Lisp functions. When the event is registered, the name of the | 92 | @file{~/.MacOSX/environment.plist}, which the desktop environment will use to |
| 112 | file to open is stored in the variable @code{ns-input-file}. | 93 | set the environment for all launched applications. The drawback of this |
| 94 | method is it needs to be run again whenever something changes. | ||
| 113 | 95 | ||
| 114 | @item ns-open-file-line | 96 | The other approach is to use the @code{ns-grabenv} command inside Emacs. This |
| 115 | Some applications, such as ProjectBuilder and gdb, request not only a | 97 | function will run a subshell and copy its environment variables into Emacs. |
| 116 | particular file, but also a particular line or sequence of lines in | ||
| 117 | the file. Emacs handles this by visiting that file and highlighting | ||
| 118 | the requested line (@code{ns-open-file-select-line}). | ||
| 119 | 98 | ||
| 120 | @item ns-drag-file | 99 | Adding this line to your @file{~/.emacs} will grab the csh environment |
| 121 | This event occurs when a user drags files from another application | 100 | whenever emacs runs under a window system. |
| 122 | into an Emacs frame. The default behavior is to insert the contents | ||
| 123 | of all the dragged files into the current buffer | ||
| 124 | (@code{ns-insert-files}). The list of dragged files is stored in the | ||
| 125 | variable @code{ns-input-file}. | ||
| 126 | 101 | ||
| 127 | @item ns-drag-color | 102 | @lisp |
| 128 | This event occurs when a user drags a color from the color well (or | 103 | (if window-system (ns-grabenv)) |
| 129 | some other source) into an Emacs frame. The default behavior is to | 104 | @end lisp |
| 130 | alter the foreground color of the area the color was dragged onto | ||
| 131 | (@code{ns-set-foreground-at-mouse}). If this event is issued with a | ||
| 132 | @key{Shift} modifier, Emacs changes the background color instead | ||
| 133 | (@code{ns-set-background-at-mouse}). The name of the dragged color is | ||
| 134 | stored in the variable @code{ns-input-color}. | ||
| 135 | 105 | ||
| 136 | @item ns-change-font | 106 | If you have a different shell you will have to give @code{ns-grabenv} some |
| 137 | This event occurs when the user selects a font in a Nextstep font | 107 | arguments. For zsh you would do this. |
| 138 | panel (which can be opened with @kbd{Cmd-t}). The default behavior is | ||
| 139 | to adjust the font of the selected frame | ||
| 140 | (@code{ns-respond-to-changefont}). The name and size of the selected | ||
| 141 | font are stored in the variables @code{ns-input-font} and | ||
| 142 | @code{ns-input-fontsize} respectively. | ||
| 143 | 108 | ||
| 144 | @item ns-power-off | 109 | @lisp |
| 145 | This event occurs when the user logs out and Emacs is still running. | 110 | (if window-system (ns-grabenv "/usr/bin/zsh" |
| 146 | The default behavior is to save all file-visiting buffers without | 111 | "source /etc/zshenv" |
| 147 | confirmation, and exit. | 112 | "source ~/.zshenv")) |
| 148 | @end table | 113 | @end lisp |
| 149 | 114 | ||
| 150 | Emacs also allows users to make use of Nextstep services, via a set | 115 | The reason that @code{ns-grabenv} is not done by default is that it adds up |
| 151 | of commands whose names begin with @samp{ns-service-} and end with the | 116 | to a second or two to the Emacs startup time. |
| 152 | name of the service. Type @kbd{M-x ns-service-@key{TAB}@key{TAB}} to | ||
| 153 | see a list of these commands. These functions either operate on | ||
| 154 | marked text (replacing it with the result) or take a string argument | ||
| 155 | and return the result as a string. You can also use the Lisp function | ||
| 156 | @code{ns-perform-service} to pass arbitrary strings to arbitrary | ||
| 157 | services and receive the results back. Note that you may need to | ||
| 158 | restart Emacs to access newly-available services. | ||
| 159 | 117 | ||
| 160 | @node Mac Preferences | ||
| 161 | @section Mac Preferences | ||
| 162 | 118 | ||
| 163 | The Preferences panel can be used to set or change some of the | 119 | @node Mac Customization, Mac Events, Mac Basics, Mac OS |
| 164 | settings for Emacs such as the text appearance, cursor settings, and | 120 | @section Mac Customization |
| 165 | key bindings. | ||
| 166 | 121 | ||
| 167 | To save any settings changed through the Preferences panel, click on | 122 | Emacs.app can be customized in several ways in addition to the standard |
| 168 | @samp{OK}; this has the same effect as if you had explicitly chosen | 123 | customization buffers and the Options menu. |
| 169 | @samp{Help / Save Preferences}. | ||
| 170 | 124 | ||
| 171 | To restore Emacs to use its default settings click @samp{Reset to | ||
| 172 | Defaults} from the Preferences Panel. | ||
| 173 | 125 | ||
| 174 | Additional preferences may be set from the command line using the | 126 | @subsection Preferences Panel |
| 175 | @command{defaults} command. @xref{Mac Customization}. | ||
| 176 | 127 | ||
| 177 | Font and color settings can be set using the standard NeXTstep font | 128 | The Preferences panel, much like the Options menu, is designed to allow quick |
| 178 | and color panels. | 129 | and convenient setting of commonly used options. |
| 179 | 130 | ||
| 180 | @itemize @bullet | 131 | The Preferences panel is available for setting commonly used GUI-related |
| 181 | @item | 132 | options for Emacs.app. Access it under the Emacs menu (Mac) or Info menu |
| 182 | To set the default font used by Emacs click the Default Font... button | 133 | (GNUstep), or using @kbd{Cmd-,}. |
| 183 | to launch the Font Panel. Click on a frame before selecting the font | ||
| 184 | family, typeface, and size of the default font from the Font Panel. | ||
| 185 | 134 | ||
| 186 | Note that the default font will not be changed if a frame hasn't been | 135 | Settings made here are saved when @samp{OK} is hit, or @samp{Save Options} is |
| 187 | selected first. | 136 | selected from the Options menu. These settings are stored into the NeXTstep |
| 137 | ``defaults'' system under keys described below. | ||
| 188 | 138 | ||
| 139 | @itemize @bullet | ||
| 189 | @item | 140 | @item |
| 190 | To set the default foreground or background color click the | 141 | To set the default font used by Emacs click the @samp{Default Font...} button |
| 191 | Colors... button to launch the Color Panel. Choose the color you want | 142 | to being up the Font Panel, then click on a frame. The font of this frame |
| 192 | using any of the color models (color wheel, sliders, palette, image, | 143 | will then be changed when you make a selection in the Font Panel, and this |
| 193 | or crayons) available from the Colors toolbar. To apply the color | 144 | will be used as the default for future frames. If you do not select a frame |
| 194 | drag a swatch from the color bar at the top of the panel to text on | 145 | first, the Font Panel will not work. |
| 195 | an Emacs frame. Holding down shift will change the background color | ||
| 196 | instead of the foreground. | ||
| 197 | 146 | ||
| 198 | @item | 147 | @item |
| 199 | To use antialiased text check the Smooth Fonts option. Lighter font | 148 | The Color panel, brought up by the @samp{Colors...} button, allows setting of |
| 200 | smoothing can be achieved by checking the Use Quickdraw (lighter) | 149 | foreground or background of any face. Drag from the color bar to over the |
| 201 | smoothing option. | 150 | emacs face you want to change. This will change the foreground of that face, |
| 151 | or holding shift when dragging will change the background. | ||
| 202 | 152 | ||
| 203 | @item | 153 | @item |
| 204 | To change the line height that text is displayed at drag the Expand | 154 | @samp{Smooth Fonts} and @samp{Use Quickdraw} control text antialiasing. |
| 205 | Line Spacing slider. When the slider is set to 0.0 Emacs will use the | 155 | Quickdraw is an older Mac technology still supported under OS X. |
| 206 | same line height as other Mac OS X applications. To increase the line | ||
| 207 | height (and decrease the number of lines that can be displayed on the | ||
| 208 | screen) drag the slider towards 1.0. To decrease the line height | ||
| 209 | (increases the number of lines that can be displayed) drag the slider | ||
| 210 | towards -1.0. | ||
| 211 | |||
| 212 | After the line spacing setting has been changed Emacs must be restarted | ||
| 213 | to take account of the change. | ||
| 214 | |||
| 215 | @end itemize | ||
| 216 | 156 | ||
| 217 | The Display Preferences can be used to change the appearance of the | 157 | @item |
| 218 | default cursor used by Emacs. | 158 | The @samp{Expand Line Spacing} slider controls vertical spacing of text. The |
| 159 | 0.0 setting corresponds to the same height as other applications. Settings | ||
| 160 | less than 0 compress the spacing, and greater than 0 expand it. Emacs must be | ||
| 161 | restarted for the new setting to take effect. | ||
| 219 | 162 | ||
| 220 | @itemize @bullet | ||
| 221 | @item | 163 | @item |
| 222 | The Cursor Type radio buttons can be used to select the style used for the cursor: | 164 | The @samp{Cursor Type} radio buttons select the cursor shape: |
| 165 | cursor: | ||
| 223 | 166 | ||
| 224 | @itemize | 167 | @itemize |
| 225 | @item | 168 | @item |
| 226 | Box - the cursor is displayed as a box | 169 | Filled Box - the cursor is displayed as a box (default) |
| 227 | @item | 170 | @item |
| 228 | Underscore - the cursor is displayed as a horizontal bar | 171 | Vertical Bar - the cursor is displayed as a vertical line |
| 229 | @item | 172 | @item |
| 230 | Bar - the cursor is displayed as a vertical bar | 173 | Underscore - the cursor is displayed as a horizontal line |
| 231 | @item | 174 | @item |
| 232 | Hollow - the cursor is displayed as a box with an outline but no fill | 175 | Hollow - the cursor is displayed as a box with an outline but no fill |
| 233 | @end itemize | 176 | @end itemize |
| 234 | 177 | ||
| 235 | @item | 178 | @item |
| 236 | Use the Cursor Blink Rate slider to set the frequency at which the cursor blinks. | 179 | The @samp{Cursor Blink Rate} slider to sets the frequency at which the cursor |
| 180 | blinks (CURRENTLY INOPERATIVE -- use @samp{customize group cursor} instead.) | ||
| 237 | 181 | ||
| 238 | @item | 182 | @item |
| 239 | Check the Use System Highlight Color option to use the system default | 183 | The @samp{Use System Highlight Color} option controls whether selected text is |
| 240 | color for highlighted text. | 184 | highlighted with the system default or the local emacs setting. |
| 241 | 185 | ||
| 242 | @end itemize | 186 | @end itemize |
| 243 | 187 | ||
| 244 | The Modifier Preferences can be used to change the behaviour of the | 188 | The behavior of Modifier keys inside emacs can be controlled by the drop-down |
| 245 | Alt/Opt and Command keys. By default the Alt or Opt key is bound to | 189 | menus in the @samp{Modifiers} section. By default the Alt or Opt key is bound |
| 246 | the Emacs 'Meta' key, and the Command key is bound to 'super' which | 190 | to the Emacs 'Meta' key, and the Command key is bound to 'super' which allows |
| 247 | allows the Command key to function in a way similar to other | 191 | the Command key to function in a way similar to other NeXTstep/OS X |
| 248 | NeXTstep/OS X applications. | 192 | applications. |
| 249 | 193 | ||
| 250 | @itemize @bullet | ||
| 251 | @item | ||
| 252 | To re-bind the Alt or Opt key select a keybinding from the Alt/Opt Key | ||
| 253 | combo box. | ||
| 254 | @item | ||
| 255 | To re-bind the Command key select a keybinding from the Command Key | ||
| 256 | combo box. | ||
| 257 | @end itemize | ||
| 258 | 194 | ||
| 259 | @node Mac Customization | 195 | @subsection Font and Color Panels |
| 260 | @section Mac Customization | 196 | |
| 197 | The Font Panel may be accessed from the Windows menu or by @kbd{Cmd-t}. It | ||
| 198 | will set the default font in the frame most recently used or clicked on. To | ||
| 199 | make the setting permanent, use @samp{Save Options} in the Options menu, or | ||
| 200 | run @code{ns-save-preferences}. | ||
| 201 | |||
| 202 | You can bring up a color panel (with @key{Cmd-C} or from the Windows menu) and | ||
| 203 | drag the color you want over the emacs face you want to change. Normal | ||
| 204 | dragging will alter the foreground color. Shift dragging will alter the | ||
| 205 | background color. To make the changes permanent select the "Save Options" | ||
| 206 | item in the "Options" menu, or run @code{ns-save-preferences}. Useful in this | ||
| 207 | context is the listing of all faces obtained by @key{M-x} | ||
| 208 | @code{list-faces-display}. | ||
| 209 | |||
| 210 | |||
| 211 | @subsection Defaults | ||
| 261 | 212 | ||
| 262 | Under X, resources are used to customize the behavior of Emacs to the | 213 | Under X, resources are used to customize the behavior of Emacs to the |
| 263 | needs of the user. Nexstep defaults fulfill a similar function. From | 214 | needs of the user. Nextstep defaults fulfill a similar function. From |
| 264 | the command line, the command @samp{defaults read org.gnu.Emacs} show | 215 | the command line, the command @samp{defaults read org.gnu.Emacs} shows |
| 265 | these resources as of the last Emacs exited, and individual resources | 216 | these resources as of the last Emacs exited, and individual resources |
| 266 | can be read or written by commands like @samp{defaults read Emacs Foo} | 217 | can be read or written by commands like @samp{defaults read Emacs Foo} |
| 267 | and @samp{defaults write Emacs Foo barvalue}. | 218 | and @samp{defaults write Emacs Foo barvalue}. |
| @@ -273,11 +224,11 @@ writes out the defaults corresponding to the selected window. | |||
| 273 | In addition, you can set many of the following customizations by | 224 | In addition, you can set many of the following customizations by |
| 274 | setting @code{default-frame-alist} in your initialization file. | 225 | setting @code{default-frame-alist} in your initialization file. |
| 275 | 226 | ||
| 276 | Many of the preferences relating specifically to the Nextstep | 227 | Many of the preferences relating specifically to the Nextstep windowing |
| 277 | windowing system (such as font rendering and the cursor type) can be | 228 | system (such as font rendering and the cursor type) can be set using the |
| 278 | set using the Preferences panel (@pxref{Mac Preferences}). It is | 229 | Preferences panel. It is important to note that when you hit @samp{OK} on |
| 279 | important to note that when you hit @samp{OK} on this panel, | 230 | this panel, @emph{all} Nextstep settings are saved (including font and |
| 280 | @emph{all} Nextstep settings are saved (including font and colors). | 231 | colors). |
| 281 | 232 | ||
| 282 | This is a listing of some of the more useful defaults (and their | 233 | This is a listing of some of the more useful defaults (and their |
| 283 | default values). Several of these defaults accept the names of colors | 234 | default values). Several of these defaults accept the names of colors |
| @@ -355,14 +306,6 @@ Name of the default cursor type for Emacs. Allowed values are | |||
| 355 | defaults write Emacs CursorType box | 306 | defaults write Emacs CursorType box |
| 356 | @end example | 307 | @end example |
| 357 | 308 | ||
| 358 | @item CursorBlinkRate | ||
| 359 | Users who want their cursor to blink can set the rate (in seconds) with | ||
| 360 | this defaults write. Setting it to @samp{NO} disables cursor blinking. | ||
| 361 | |||
| 362 | @example | ||
| 363 | defaults write Emacs CursorBlinkRate NO | ||
| 364 | @end example | ||
| 365 | |||
| 366 | @item CursorColor | 309 | @item CursorColor |
| 367 | Name of the default cursor color for Emacs. Of a particular use for | 310 | Name of the default cursor color for Emacs. Of a particular use for |
| 368 | this setting is the @samp{Highlight} color. When it is the cursor | 311 | this setting is the @samp{Highlight} color. When it is the cursor |
| @@ -370,7 +313,7 @@ color, Emacs will draw the cursor using the standard Nextstep | |||
| 370 | highlighting operator. | 313 | highlighting operator. |
| 371 | 314 | ||
| 372 | @example | 315 | @example |
| 373 | defaults write Emacs CursorColor Highlight | 316 | defaults write Emacs CursorColor blue |
| 374 | @end example | 317 | @end example |
| 375 | 318 | ||
| 376 | @item Top | 319 | @item Top |
| @@ -487,6 +430,99 @@ way to do this under OS X please contact the authors. | |||
| 487 | 430 | ||
| 488 | @end table | 431 | @end table |
| 489 | 432 | ||
| 433 | @subsection Open files by dragging to an Emacs window | ||
| 434 | |||
| 435 | The default behaviour when a user drags files from another application | ||
| 436 | into an Emacs frame is to insert the contents of all the dragged files | ||
| 437 | into the current buffer. To remap the @code{ns-drag-file} event to | ||
| 438 | open the dragged files in the current frame use the following line: | ||
| 439 | |||
| 440 | @lisp | ||
| 441 | (define-key global-map [ns-drag-file] 'ns-find-file) | ||
| 442 | @end lisp | ||
| 443 | |||
| 444 | |||
| 445 | @node Mac Events, , Mac Customization, Mac OS | ||
| 446 | @section Windowing System Events in Mac OS X | ||
| 447 | |||
| 448 | Nextstep applications receive a number of special events which have | ||
| 449 | no X equivalent. These are sent as specially defined ``keys'', which | ||
| 450 | do not correspond to any sequence of keystrokes. Under Emacs, these | ||
| 451 | ``key'' events can be bound to functions just like ordinary | ||
| 452 | keystrokes. Here is a list of these events. | ||
| 453 | |||
| 454 | @table @key | ||
| 455 | @item ns-open-file | ||
| 456 | @vindex ns-pop-up-frames | ||
| 457 | This event occurs when another Nextstep application requests that | ||
| 458 | Emacs open a file. A typical reason for this would be a user | ||
| 459 | double-clicking a file in the Finder application. By default, Emacs | ||
| 460 | responds to this event by opening a new frame and visiting the file in | ||
| 461 | that frame (@code{ns-find-file}), As an exception, if the selected | ||
| 462 | buffer is the @samp{*scratch*} buffer, Emacs visits the file in the | ||
| 463 | the selected frame. | ||
| 464 | |||
| 465 | You can change how Emacs responds to @key{ns-open-file} by changing | ||
| 466 | the variable @code{ns-pop-up-frames}. Its default value, | ||
| 467 | @code{'fresh}, is what we have just described. A value of @code{t} | ||
| 468 | means to always visit the file in a new frame. A value of @code{nil} | ||
| 469 | means to always visit the file in an existing frame. | ||
| 470 | |||
| 471 | @item ns-open-temp-file | ||
| 472 | This event occurs when another application requests that Emacs open a | ||
| 473 | temporary file. By default, this is handled by just generating a | ||
| 474 | @code{ns-open-file} event, the results of which are described above. | ||
| 475 | |||
| 476 | You can bind @key{ns-pop-up-frames} and @key{ns-open-temp-file} to | ||
| 477 | other Lisp functions. When the event is registered, the name of the | ||
| 478 | file to open is stored in the variable @code{ns-input-file}. | ||
| 479 | |||
| 480 | @item ns-open-file-line | ||
| 481 | Some applications, such as ProjectBuilder and gdb, request not only a | ||
| 482 | particular file, but also a particular line or sequence of lines in | ||
| 483 | the file. Emacs handles this by visiting that file and highlighting | ||
| 484 | the requested line (@code{ns-open-file-select-line}). | ||
| 485 | |||
| 486 | @item ns-drag-file | ||
| 487 | This event occurs when a user drags files from another application | ||
| 488 | into an Emacs frame. The default behavior is to insert the contents | ||
| 489 | of all the dragged files into the current buffer | ||
| 490 | (@code{ns-insert-files}). The list of dragged files is stored in the | ||
| 491 | variable @code{ns-input-file}. | ||
| 492 | |||
| 493 | @item ns-drag-color | ||
| 494 | This event occurs when a user drags a color from the color well (or | ||
| 495 | some other source) into an Emacs frame. The default behavior is to | ||
| 496 | alter the foreground color of the area the color was dragged onto | ||
| 497 | (@code{ns-set-foreground-at-mouse}). If this event is issued with a | ||
| 498 | @key{Shift} modifier, Emacs changes the background color instead | ||
| 499 | (@code{ns-set-background-at-mouse}). The name of the dragged color is | ||
| 500 | stored in the variable @code{ns-input-color}. | ||
| 501 | |||
| 502 | @item ns-change-font | ||
| 503 | This event occurs when the user selects a font in a Nextstep font | ||
| 504 | panel (which can be opened with @kbd{Cmd-t}). The default behavior is | ||
| 505 | to adjust the font of the selected frame | ||
| 506 | (@code{ns-respond-to-changefont}). The name and size of the selected | ||
| 507 | font are stored in the variables @code{ns-input-font} and | ||
| 508 | @code{ns-input-fontsize} respectively. | ||
| 509 | |||
| 510 | @item ns-power-off | ||
| 511 | This event occurs when the user logs out and Emacs is still running. | ||
| 512 | The default behavior is to save all file-visiting buffers without | ||
| 513 | confirmation, and exit. | ||
| 514 | @end table | ||
| 515 | |||
| 516 | Emacs also allows users to make use of Nextstep services, via a set | ||
| 517 | of commands whose names begin with @samp{ns-service-} and end with the | ||
| 518 | name of the service. Type @kbd{M-x ns-service-@key{TAB}@key{TAB}} to | ||
| 519 | see a list of these commands. These functions either operate on | ||
| 520 | marked text (replacing it with the result) or take a string argument | ||
| 521 | and return the result as a string. You can also use the Lisp function | ||
| 522 | @code{ns-perform-service} to pass arbitrary strings to arbitrary | ||
| 523 | services and receive the results back. Note that you may need to | ||
| 524 | restart Emacs to access newly-available services. | ||
| 525 | |||
| 490 | @ignore | 526 | @ignore |
| 491 | arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6 | 527 | arch-tag: a822c2ab-4273-4997-927e-c153bb71dcf6 |
| 492 | @end ignore | 528 | @end ignore |