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