aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorAndreas Schwab2008-07-19 08:54:28 +0000
committerAndreas Schwab2008-07-19 08:54:28 +0000
commit568beaa25328d4045fa4aaef5c773f2f741d1f59 (patch)
tree09249c9ea07ba91d23d9fa14a23542c9aa2ba452 /doc/misc
parenta5e1066d8363c6642952a3a4ac0a84e7c4deb7ed (diff)
downloademacs-568beaa25328d4045fa4aaef5c773f2f741d1f59.tar.gz
emacs-568beaa25328d4045fa4aaef5c773f2f741d1f59.zip
* ns-emacs.texi: Moved from ../emacs. Add @direntry.
* Makefile.in (INFO_TARGETS, DVI_TARGETS): Add ns-emacs. (ns-emacs, $(infodir)/ns-emacs, ns-emacs.dvi): New rules. * ns-emacs.texi: Move to ../misc.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/ChangeLog7
-rw-r--r--doc/misc/Makefile.in8
-rw-r--r--doc/misc/ns-emacs.texi1028
3 files changed, 1043 insertions, 0 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 6df3f5b19a6..9385d494392 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,10 @@
12008-07-19 Andreas Schwab <schwab@suse.de>
2
3 * ns-emacs.texi: Moved from ../emacs. Add @direntry.
4
5 * Makefile.in (INFO_TARGETS, DVI_TARGETS): Add ns-emacs.
6 (ns-emacs, $(infodir)/ns-emacs, ns-emacs.dvi): New rules.
7
12008-07-18 Michael Albinus <michael.albinus@gmx.de> 82008-07-18 Michael Albinus <michael.albinus@gmx.de>
2 9
3 * dbus.texi (Inspection): Rework, introduce submenus. 10 * dbus.texi (Inspection): Rework, introduce submenus.
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 24deea88f32..ab357fc31dc 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -60,6 +60,7 @@ INFO_TARGETS = \
60 $(infodir)/message \ 60 $(infodir)/message \
61 $(infodir)/mh-e \ 61 $(infodir)/mh-e \
62 $(infodir)/newsticker \ 62 $(infodir)/newsticker \
63 $(infodir)/ns-emacs \
63 $(infodir)/nxml-mode \ 64 $(infodir)/nxml-mode \
64 $(infodir)/org \ 65 $(infodir)/org \
65 $(infodir)/pcl-cvs \ 66 $(infodir)/pcl-cvs \
@@ -104,6 +105,7 @@ DVI_TARGETS = \
104 message.dvi \ 105 message.dvi \
105 mh-e.dvi \ 106 mh-e.dvi \
106 newsticker.dvi \ 107 newsticker.dvi \
108 ns-emacs.dvi \
107 nxml-mode.dvi \ 109 nxml-mode.dvi \
108 org.dvi \ 110 org.dvi \
109 pcl-cvs.dvi \ 111 pcl-cvs.dvi \
@@ -296,6 +298,12 @@ $(infodir)/newsticker: newsticker.texi
296newsticker.dvi: newsticker.texi 298newsticker.dvi: newsticker.texi
297 $(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi 299 $(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi
298 300
301ns-emacs : $(infodir)/ns-emacs
302$(infodir)/ns-emacs: ns-emacs.texi
303 cd $(srcdir); $(MAKEINFO) ns-emacs.texi
304ns-emacs.dvi: ns-emacs.texi
305 $(ENVADD) $(TEXI2DVI) ${srcdir}/ns-emacs.texi
306
299nxml-mode : $(infodir)/nxml-mode 307nxml-mode : $(infodir)/nxml-mode
300$(infodir)/nxml-mode: nxml-mode.texi 308$(infodir)/nxml-mode: nxml-mode.texi
301 cd $(srcdir); $(MAKEINFO) nxml-mode.texi 309 cd $(srcdir); $(MAKEINFO) nxml-mode.texi
diff --git a/doc/misc/ns-emacs.texi b/doc/misc/ns-emacs.texi
new file mode 100644
index 00000000000..e4d0f9951d6
--- /dev/null
+++ b/doc/misc/ns-emacs.texi
@@ -0,0 +1,1028 @@
1\input texinfo @c -*-texinfo-*-
2
3@setfilename ../../info/ns-emacs
4@settitle Emacs.app
5
6@dircategory Emacs
7@direntry
8* NS-Emacs: (ns-emacs). Emacs.app for GNUstep and MacOS X.
9@end direntry
10
11@iftex
12@finalout
13@end iftex
14
15@titlepage
16@sp 10
17@center @titlefont{Emacs.app}
18
19@center (Version 9.0-rc1, April, 2006)
20
21@sp 2
22@center Carl Edman
23@sp 2
24@center Christian Limpach
25@sp 2
26@center Scott Bender
27@sp 2
28@center Christophe de Dinechin
29@sp 2
30@center Adrian Robert
31@sp 2
32
33@end titlepage
34
35@unnumbered Distribution
36@*
37Copyright @copyright{} 1994 Carl Edman.@*
38Copyright @copyright{} 1997 Christian Limpach.
39Copyright @copyright{} 1997 Scott Bender.
40Copyright @copyright{} 2001 Christophe de Dinechin.
41Copyright @copyright{} 2005-07 Adrian Robert.
42
43Permission is granted to make and distribute verbatim copies of
44this manual provided the copyright notice and this permission notice
45are preserved on all copies.
46
47@ignore
48Permission is granted to process this file through Tex and print the
49results, provided the printed document carries copying permission
50notice identical to this one except for the removal of this paragraph
51(this paragraph not being relevant to the printed manual).
52
53@end ignore
54Permission is granted to copy and distribute modified versions of this
55manual under the conditions for verbatim copying, provided that the entire
56resulting derived work is distributed under the terms of a permission
57notice identical to this one.
58
59Permission is granted to copy and distribute translations of this manual
60into another language, under the same conditions as for modified versions.
61
62@ignore
63@menu
64* Introduction::
65* Events::
66* Preferences Panel::
67* Preferences::
68* Tips and Tricks::
69* Thanks::
70@end menu
71@end ignore
72
73@node Top, Introduction, (dir), (dir)
74@top Emacs.app
75
76Emacs.app for GNUstep and MacOS X (http://emacs-app.sf.net) is a version of
77GNU Emacs CVS unicode-2 branch (currently planned to be released as Emacs 23)
78which adds support for the GNUstep and MacOS X systems via the OpenStep APIs
79(referred to as "Cocoa" under OS X). Support for NeXTstep, OpenStep, and
80Rhapsody systems has been dropped. For those systems, use "Emacs-on-Aqua",
81available at http://emacs-on-aqua.sf.net.
82
83This port leaves most of the core functions of Emacs unchanged and is
84fully-compatible with all Emacs Lisp packages, however it has a number of
85step-ish features which do not have any equivalent in Emacs's X11 interface.
86The design aim was to make it look as similar as possible to an X application
87to Emacs Lisp programs and to make it look like a normal GNUstep or MacOS X
88application to users.
89
90(From here on out we refer to this port as "Emacs.app", and the systems
91supported by this port as "NeXTstep", "NS", or "OpenStep", because saying
92GNUstep / MacOS X is too clumsy. Both systems were derived from the NeXTstep
93libraries developed by NeXT, Inc. for its NeXT computer and operating system,
94whose APIs were later published as the OpenStep specification. All classes
95and functions in these APIs start with the letters 'NS' for this historical
96reason.)
97
98Comments and bug reports relating to the window system interface are welcome.
99To report a bug please use the @samp{Help/Report Emacs.app bug...} menu item.
100This sends messages to the maintainer. (Note, please include your email
101address if you don't usually send email from this machine.)
102
103Problems and bugs which do not relate to the NS support (i.e. which can be
104reproduced even in a dumb terminal or under the Carbon port or X11) should be
105reported through the normal Emacs channels.
106
107Also, please inspect the ``Known Issues'' contained in the README file you may
108have received with this distribution or listed at the web site
109http://emacs-app.sf.net .
110
111There is also a developer mailing list for Emacs.app,
112<emacs-app-dev-@@lists.sourceforge.net>. Sign up through the project page at
113http://emacs-app.sf.net. A user mailing list will be added in time and if
114warranted.
115
116
117@menu
118* Introduction:: What you need to know to use and program.
119* Events:: How NS window system events are handled.
120* Preferences Panel:: Using the Preferences Panel to customize Emacs.
121* Customization:: Customization for Emacs.app.
122* Tips and Tricks:: Collected hints from Emacs users
123* Thanks:: The people who helped create Emacs.app
124@end menu
125
126@node Introduction, Events, Top, Top
127@section Introduction
128
129Despite the size and complexity of GNU Emacs, NeXTstep and the NeXTstep
130support code, this manual can be kept mercifully short by saying that
131everything written in the Emacs and the Emacs Lisp manuals about GNU Emacs
132applies equally to this Emacs except as noted here.
133
134@itemize @bullet
135@item
136The ``right-click'' button (usually the right-hand button on a two-button
137mouse) is mapped to Mouse-3, instead of Mouse-2 as earlier versions of
138Emacs.app. This is for compatibility with X versions of emacs. To get some
139of the old behavior back, you can put in your .emacs:
140
141@lisp
142(global-set-key [mouse-3] 'mouse-yank-at-click)
143@end lisp
144
145The other functionality of mouse-3 in a buffer of extending a selection is
146available via shift-click as in other NS applications. To pop up a context
147menu,
148
149@item
150The Alt or Opt key is bound to the traditional emacs "meta" by default, while
151the NS "command" key is bound to 'super', for which a set of keybindings are
152set to mimic other NeXTstep applications. (See @ref{Events}.) You can change
153either of these bindings using the preferences panel (see @ref{Preferences
154Panel}).
155
156@item
157The standard NeXTstep font and color panels are accessible through the Windows
158menu, or through the standard Cmd-t and Cmd-C. These are easier to use than
159Emacs's own methods for setting these items. To use the color panel, drag
160from it to an emacs frame. The foreground (or background, if shift is held
161down) of the face at that point will be changed. To finalize settings for
162either color or font, choose 'Save Preferences' from under the Help menu. To
163discard these settings, create a new frame and close the altered one.
164
165@item
166Opening files / directories and 'Save Buffer As' operated from the menus use
167the standard NS file panels. Likewise if you use Cmd-o or Cmd-S. However,
168if you use the regular Emacs key combinations Ctrl-x,Ctrl-f and Ctrl-x,w for
169these functions, the normal Emacs mode of typing filenames into the minibuffer
170is used.
171
172@item
173On GNUstep, in an X-windows environment you need to use Cmd-c instead of one
174of the Ctrl-w or Meta-w commands to transfer text to the X primary selection.
175(Ordinarily the "clipboard" selection is used, for compatibility with more
176modern Gnome and KDE programs.) Likewise, Cmd-y (instead of Ctrl-y) will
177yank/paste in the X primary selection instead of the kill-ring / clipboard.
178
179@item
180The @code{window-system} variable can now have the value @code{ns} in addition
181to, e.g., @code{x} or @code{nil}. You can use this in your .emacs file:
182
183If you just want to distinguish between cases in which there is a
184window system and in which there isn't, this construct is useful.
185@lisp
186(if window-system
187 ... ;;; evaluate if any window system is running
188 ...) ;;; evaluate only when running on a dumb terminal
189@end lisp
190
191For more detailed control, use this.
192@lisp
193(cond
194 ((eq window-system 'ns) ;;; NS specific instructions
195 ...)
196 ((eq window-system 'x) ;;; X specific instructions
197 ...)
198 (t ;;; Instructions for dumb terminal or other window systems
199 ...))
200@end lisp
201
202@item
203Likewise, you can detect whether you are running in emacs-23 or an earlier
204version with:
205
206@lisp
207 (if (eq emacs-major-version '23) <emacs-23 code> <emacs-22- code>)
208@end lisp
209
210@item
211Most NS specific functions begin with 'ns-'. Do "C-h f ns-[TAB]" to list
212these. Many of these replace equivalent 'x-' functions, while others perform
213uniquely NS things, such as Service invocation.
214
215@item
216There are also NS variables beginning with 'ns-', however in most cases users
217need not pay attention to them since the customizability they provide is also
218available through the defaults system and preferences panel (see
219@ref{Preferences Panel} and @ref{Customization}).
220
221@item
222When Emacs is called by a name which ends in @file{-nw} it will always
223start in terminal mode. For example, a user who needs a terminal only
224emacs would create a symbolic link from @file{emacs} to @file{emacs-nw}.
225When he launches @file{emacs-nw} from the command line, the window
226system will never be involved. (Note, as of rc2, terminal mode is still not
227working under OS X.)
228@end itemize
229
230@node Events, Preferences Panel, Introduction, Top
231@section Events
232
233Under Emacs.app the NeXTstep command key works as the @dfn{super} modifier
234key. In principle users can bind their command keys to whatever function they
235want, but to make the transition for NS users easier the default NS startup
236files bind the most commonly used NS command keys to work just like they do in
237most other NS applications. Some are shown in the menus. Choose "List
238Keybindings" from the Help menu and scroll down to the keys labeled starting
239with 's-' to see all of them.
240
241NS applications receive a number of special events which have no X equivalent.
242These are sent as specially defined ``keys'' (which don't correspond to any
243keyboard stroke combination). Under Emacs these ``key'' events can be bound
244to functions just like ordinary keystrokes. Here is a list of these events.
245
246@table @code
247@item ns-open-file
248This event occurs when another NeXTstep application requests that Emacs
249open a file. A typical reason for this would be a user double-clicking
250a file in the Finder. When this event is registered the
251name of the file to open is found in the variable @code{ns-input-file}.
252
253The behaviour of the default binding is controlled by the variable
254@code{ns-pop-up-frames}. It's default value @code{'fresh} causes Emacs
255to open the new file in the selected frame if the selected buffer is a
256scratch buffer. Otherwise Emacs opens a new frame and displays the file
257in that.
258
259To always get a new frame one would change @code{ns-pop-up-frames} to
260@code{t}. To get the opposite behaviour (i.e. always putting the file into
261the selected frame), change @code{ns-pop-up-frames} to @code{nil}.
262
263@item ns-open-temp-file
264This event occurs when another application requests that Emacs open a
265temporary file. The file name is again in @code{ns-input-file}. By
266default this is handled by just generating a @code{ns-open-file} event
267(which then causes the @code{ns-open-file} function to be called
268whatever that may be).
269
270@lisp
271(define-key global-map [ns-open-temp-file] [ns-open-file])
272@end lisp
273
274@item ns-open-file-line
275Some applications (like e.g. ProjectBuilder or gdb) request not only a
276particular file, but also a particular line or sequence of lines in the
277file. The file name is in @code{ns-input-file}, and
278@code{ns-input-line} is either the line or a cons cell the car of which
279contains the beginning line and the cdr of which the ending line.
280
281@lisp
282(define-key global-map [ns-open-file-line] 'ns-open-file-select-line)
283@end lisp
284
285@item ns-drag-file
286When a user drags files from another application into an Emacs frame
287this event is triggered. Here @code{ns-input-file} is a list of all
288dragged files. The default binding inserts all the dragged files into
289the current buffer.
290
291@lisp
292(define-key global-map [ns-drag-file] 'ns-insert-files)
293@end lisp
294
295@item ns-drag-color
296When a user drags a color from the color well (or some other source)
297Emacs sees this event and @code{ns-input-color} contains the name of the
298dragged color. The default bindings alter the foreground color of the
299area the color was dragged onto (or background color if the color was
300shift dragged).
301
302@lisp
303(define-key global-map [ns-drag-color]
304 'ns-set-foreground-at-mouse)
305(define-key global-map [S-ns-drag-color]
306 'ns-set-background-at-mouse)
307@end lisp
308
309@item ns-change-font
310Emacs.app allows the user to open a standard NS font panel (by default that
311function is bound to @kbd{Cmd-t}). When the user selects a font in that
312panel this event occurs. @code{ns-input-font} will contain the name of
313the selected font and @code{ns-input-fontsize} is its size. The
314default binding causes Emacs to adjust the font of the selected frame.
315
316@lisp
317(define-key global-map [ns-change-font] 'ns-respond-to-changefont)
318@end lisp
319
320@item ns-power-off
321Finally when the user logs out and Emacs is still running it receives
322this event so that it has a chance to save its files before it dies.
323
324@lisp
325(define-key global-map [ns-power-off]
326 '(lambda () (interactive) (save-buffers-kill-emacs t)))
327@end lisp
328
329@end table
330
331Emacs.app also allows users to make use of NeXTstep services programatically,
332in addition to via the Services menu. On the most basic level programmers can
333use the @code{ns-perform-service} to pass arbitrary strings to arbitrary
334services and receive the results back. However convenience functions are
335automatically provided for all services so there should be no need to use
336this. These function names begin with 'ns-service-', and they will either
337operate on marked text (replacing it with the result) or take a string
338argument and return the result as a string. Type "M-x ns-service-[TAB][TAB]"
339to see those currently defined. Note that Emacs may require a restart to
340access newly available services.
341
342
343@node Preferences Panel, Customization, Events, Top
344@section Preferences Panel
345
346The Preferences Panel can be used to set or change some of the settings for
347Emacs such as the text appearance, cursor settings, and key bindings.
348
349To save any settings changed through the Preferences Panel, hit OK;
350this has the same effect as if you had explicitly chosen Help > Save
351Preferences.
352
353To restore Emacs to use its default settings click Reset to Defaults from
354the Preferences Panel.
355
356Additional GNUstep/OS X preferences may be set from the command line using
357the @command{defaults} command. (See @ref{Customization}.)
358
359
360@section Text Rendering Preferences
361
362Font and color settings can be set using the standard NeXTstep font
363and color panels.
364
365@itemize @bullet
366@item
367To set the default font used by Emacs click the Default Font... button
368to launch the Font Panel. Click on a frame before selecting the font
369family, typeface, and size of the default font from the Font Panel.
370
371Note that the default font will not be changed if a frame hasn't been
372selected first.
373
374@item
375To set the default foreground or background color click the
376Colors... button to launch the Color Panel. Choose the color you want
377using any of the color models (color wheel, sliders, palette, image,
378or crayons) available from the Colors toolbar. To apply the color
379drag a swatch from the color bar at the top of the panel to text on
380an Emacs frame. Holding down shift will change the background color
381instead of the foreground.
382
383@item
384To use antialiased text check the Smooth Fonts option. Lighter font
385smoothing can be achieved by checking the Use Quickdraw (lighter)
386smoothing option.
387
388@item
389To change the line height that text is displayed at drag the Expand
390Line Spacing slider. When the slider is set to 0.0 Emacs will use the
391same line height as other Mac OS X applications. To increase the line
392height (and decrease the number of lines that can be displayed on the
393screen) drag the slider towards 1.0. To decrease the line height
394(increases the number of lines that can be displayed) drag the slider
395towards -1.0.
396
397After the line spacing setting has been changed Emacs must be restarted
398to take account of the change.
399
400@end itemize
401
402@section Display Preferences
403
404The Display Preferences can be used to change the appearance of the
405default cursor used by Emacs.
406
407@itemize @bullet
408@item
409The Cursor Type radio buttons can be used to select the style used for the cursor:
410
411@itemize
412@item
413Box - the cursor is displayed as a box
414@item
415Underscore - the cursor is displayed as a horizontal bar
416@item
417Bar - the cursor is displayed as a vertical bar
418@item
419Hollow - the cursor is displayed as a box with an outline but no fill
420@end itemize
421
422@item
423Use the Cursor Blink Rate slider to set the frequency at which the cursor blinks.
424
425@item
426Check the Use System Highlight Color option to use the system default
427color for highlighted text.
428
429@end itemize
430
431@section Modifier Interpretation Preferences
432
433The Modifier Preferences can be used to change the behaviour of the
434Alt/Opt and Command keys. By default the Alt or Opt key is bound to
435the Emacs 'Meta' key, and the Command key is bound to 'super' which
436allows the Command key to function in a way similar to other
437NeXTstep/OS X applications.
438
439@itemize @bullet
440@item
441To re-bind the Alt or Opt key select a keybinding from the Alt/Opt Key
442combo box.
443@item
444To re-bind the Command key select a keybinding from the Command Key
445combo box.
446@end itemize
447
448
449@node Customization, Tips and Tricks, Preferences Panel, Top
450@section Customization
451
452Under X, resources are used to customize the behavior of Emacs to the needs of
453the user. These resources are queried programmatically with the
454@code{x-get-resource} function. Under NS defaults fulfill a similar function.
455They can be read using the @code{ns-get-resource} function. Calls to
456@code{x-get-resource} are automatically mapped to @code{ns-get-resource}.
457From the command line, the command `@code{defaults read Emacs}' will show
458these resources as of last Emacs quit, and individual resources can be
459read/written by commands like `@code{defaults read Emacs Foo}' and
460`@code{defaults write Emacs Foo barvalue}'.
461
462Calling the function @code{ns-save-preferences} in lisp, or selecting ``Save
463Options'' from the 'Options' menu will automatically write out the defaults
464corresponding to the selected window.
465
466In addition, it is also possible to set many of the following customizations
467by setting the @code{default-frame-alist} in the @file{~/.emacs} file.
468
469Many of the preferences relating specifically to the NS windowing system (font
470rendering, cursor type, etc.) can be set using a @ref{Preferences Panel}
471accessed in the standard fashion from the menubar or Cmd-,. It is important
472to note that when you hit 'OK' on this panel, @emph{all} NS settings are saved
473(including font and colors) just as if you had called
474@code{ns-save-preferences}.
475
476Note that if you use the 'Default Font' button on the Preferences panel, you
477must click on a frame before selecting a font, otherwise nothing will happen.
478If you pop up the color panel, you must drag colors to a frame for them to
479have an effect. (Remember to hold down 'shift' to change background instead
480of foreground.)
481
482This is a listing of some of the more useful defaults (and their default
483values). Several of these defaults accept the names of colors as values. For
484a list of all available colors pull up the color panel and look at the color
485list called ``Emacs''. Emacs also accepts color specifications of the form
486@samp{ARGBaarrggbb} where @var{aa}, @var{rr}, @var{gg}, and @var{bb} are two
487hexadecimal digits describing the alpha, red, green, and blue content of the
488color respectively. @samp{HSBhhssbbaa}, @samp{CMYKccmmyykkaa} and
489@samp{GRAYggaa} are the equivalents in @samp{HSB}, @samp{CMYK} and gray
490scales.
491
492@table @samp
493@item InternalBorderWidth
494Width in pixels of the internal border of the NS frame. This acts to separate
495the text area of the window from the fringes, scrollbars, and/or edges.
496
497@example
498defaults write Emacs InternalBorderWidth 2
499@end example
500
501@item VerticalScrollBars
502@samp{YES} or @samp{NO} to enable or disable scroll bars, @samp{left} or
503@samp{right} to explicitly set the side.
504
505@example
506defaults write Emacs VerticalScrollBars YES
507@end example
508
509@item Font
510Name of the default font to be used for new frames (which can be overriden by
511various faces). If this font is not set, Emacs.app will use the system
512wide fixed pitch font. For most users the system fixed pitch font will be
513@samp{Monaco} which doesn't have any bold or italic versions. (Italic will be
514synthesized.)
515
516@item FontSize
517Size of the font to be used for new frames. If not set Emacs for NS will use
518the default size of the system wide fixed pitch font.
519
520@item Foreground
521The default foreground (text) color for new frames.
522
523@example
524defaults write Emacs Foreground "Black"
525@end example
526
527@item Background
528The default background color for new frames.
529
530@example
531defaults write Emacs Background "White"
532@end example
533
534@item Height
535Height in rows of the default window.
536
537@example
538defaults write Emacs Height 48
539@end example
540
541@item Width
542Width in columns of the default window.
543
544@example
545defaults write Emacs Width 80
546@end example
547
548@item CursorType
549Name of the default cursor type for Emacs. Allowed values are
550@samp{box}, @samp{hollow}, @samp{underscore}, @samp{bar}, @samp{line} and @samp{no}.
551
552@example
553defaults write Emacs CursorType box
554@end example
555
556@item CursorBlinkRate
557Users who want their cursor to blink can set the rate (in seconds) with
558this defaults write. Setting it to @samp{NO} disables cursor blinking.
559
560@example
561defaults write Emacs CursorBlinkRate NO
562@end example
563
564@item CursorColor
565Name of the default cursor color for Emacs. Of a particular use for this
566setting is the @samp{Highlight} "color". When it is the cursor color,
567Emacs will draw the cursor using the standard NS highlighting operator.
568
569@example
570defaults write Emacs CursorColor Highlight
571@end example
572
573@item Top
574Distance in pixels from the top of the screen of the upper left corner
575of the default window.
576
577@example
578defaults write Emacs Top 100
579@end example
580
581@item Left
582Distance in pixels from the left edge of the screen to the upper left
583corner of the default window.
584
585@example
586defaults write Emacs Left 100
587@end example
588
589@item HideOnAutoLaunch
590@samp{YES} or @samp{NO} to determine whether Emacs will hide itself when
591autolaunched from the dock.
592
593@example
594defaults write Emacs HideOnAutoLaunch NO
595@end example
596
597@item ExpandSpace
598This lets you expand or shrink the line height used for displaying text. When
599this is set to 0.0, display should look like other NS apps. If you set it
600higher than 0, Emacs will spread the text lines apart, less than 0, compress
601them together. (With settings below zero parts of characters may be chopped
602off in certain fonts.) When using the @ref{Preferences Panel}, this is
603controlled by a slider. You must OK the panel and then restart Emacs.app for
604this default to take effect.
605
606When setting this using @code{"defaults write"}, you can either set a floating
607point value, or @samp{YES}, which is equivalent 0.5, or @samp{NO}, which is
608equivalent to 0.0.
609
610@example
611defaults write Emacs ExpandSpace -0.125
612@end example
613
614@item GSFontAntiAlias
615This turns antialiasing on and off on. Note that, on OS X, even if
616antialiasing is on, Emacs will not antialias text of a size below the system
617preference setting.
618
619@example
620defaults write Emacs GSFontAntiAlias NO
621@end example
622
623@item UseQuickdrawSmoothing
624On OS X 10.3 and higher, this will render fonts using Quickdraw antialiasing,
625which is less heavy than the Quartz antialiasing used by default. Whether
626this is on or off, the system font size threshold for antialiasing (see above)
627is respected.
628
629@example
630defaults write Emacs UseQuickdrawSmoothing YES
631@end example
632
633@item AlternateModifier
634This allows you to set the effect of the Alt or Opt key. The default is
635@samp{meta}, meaning to use as the Emacs 'meta' key. You can also set this to
636@samp{command}, @samp{hyper}, @samp{alt}, or @samp{none}. The last is useful
637for Continental users who normally use this key to enter accented and other
638special characters.
639
640@example
641defaults write Emacs AlternateModifier "none"
642@end example
643
644@item CommandModifier
645This allows you to set the effect of the Command key. The default is
646@samp{super}, which is used in a set of keybindings such as @code{s-o} for
647``open file'' and @code{s-z} for ``undo'' that are similar to other NeXTstep
648applications. On the other hand, some people who use the Alt/Opt key for
649accent entry like to set this to @samp{meta} so they still have easy access to
650Emacs functionality bound to meta keys. You can also set this, like Alt/Opt,
651to @samp{hyper} or @samp{alt}, though there are no bindings to combinations
652using these keys by default. The @samp{none} option is not available for the
653Command key.
654
655@example
656defaults write Emacs CommandModifier "meta"
657@end example
658
659@item fooFrame
660Position and size to use for the frame named @var{foo} when it is
661created. The position and size have to be specified as a space
662separated list: @samp{top}, @samp{left}, @samp{height} and
663@samp{width}. @samp{top} and @samp{left} are expressed in pixels,
664@samp{height} is given in rows and @samp{width} is given in columns.
665Named frames can be created by e.g. @code{(make-frame '((name
666. "FOO")))}.
667
668@example
669defaults write Emacs TestFrame "100 200 30 70"
670@end example
671
672Another default previouly used by many Emacs users is this.
673
674@example
675defaults write Workspace DefaultOpenApp Emacs
676@end example
677
678It caused the NeXTstep Workspace to open files without a registered extension
679in Emacs instead of as usual Edit. For this default to work, Emacs needed to
680be in the application search path of the Workspace (which usually includes
681@file{~/Applications} and @file{~/Applications}). If anyone knows the current
682way to do this under OS X please contact the authors.
683
684@end table
685
686@node Tips and Tricks, Thanks, Customization, Top
687@section Tips and Tricks
688
689Emacs is an extremely customizable editor. You can make it conform to
690virtually any conceivable user idiosyncrasy (and some which are not) by adding
691a few well-chosen lines of emacs lisp to your @file{~/.emacs}. Unfortunately
692even many experienced C developers are unfamiliar with Emacs Lisp. For that
693reason many Emacs.app defaults have been chosen to make it behave as similar
694to TextEdit as possible. But there are some customizations which a majority
695of users probably would hate as much as a minority would love them. This
696section contains a cookbook of such customizations. New contributions by
697Emacs users are very welcome.
698
699@menu
700* Grabbing environment variables::
701* Miscellaneous useful variables::
702* Color adjustments::
703* Evaling in the minibuffer::
704* Highlighting matching parentheses::
705* Dealing with X specific packages::
706* Rebinding the numeric keypad::
707* Improving C mode::
708* Custom menu items::
709* Single line scrolling::
710* Open files by dragging to an Emacs window::
711@ignore
712* Extended font customization::
713@end ignore
714@end menu
715
716@node Grabbing environment variables, Miscellaneous useful variables, Tips and Tricks, Tips and Tricks
717@subsection Grabbing environment variables
718
719Many programs which may run under Emacs like latex or man depend on the
720settings of environment variables. If Emacs is launched from the shell, it
721will automatically inherit these environment variables and its subprocesses
722will inherit them from it. But if Emacs.app is launched from the Finder it
723is not a descendant of any shell, so its environment variables haven't been
724set which often causes the subprocesses it launches to behave differently than
725they would when launched from the shell.
726
727To solve this problem for Emacs.app, there are two solutions. First is to
728run, from the command line:
729
730@example
731.../Emacs.app/Contents/MacOS/bin/mac-fix-env
732@end example
733
734This will pick up your environment settings and save them into a special file
735@file{~/.MacOSX/environment.plist}, which the desktop environment will use to
736set the environment for all launched applications. The drawback of this
737method is it needs to be run again whenever something changes.
738
739The other approach is to use the @code{ns-grabenv} command inside Emacs. This
740function will run a subshell and copy its environment variables into Emacs.
741
742Adding this line to your @file{~/.emacs} will grab the csh environment
743whenever emacs runs under a window system.
744
745@lisp
746(if window-system (ns-grabenv))
747@end lisp
748
749If you have a different shell you will have to give @code{ns-grabenv} some
750arguments. For zsh you would do this.
751
752@lisp
753(if window-system (ns-grabenv "/usr/bin/zsh"
754 "source /etc/zshenv"
755 "source ~/.zshenv"))
756@end lisp
757
758The reason that @code{ns-grabenv} is not done by default is that it adds up
759to a second or two to the Emacs startup time.
760
761@node Miscellaneous useful variables, Color adjustments, Grabbing environment variables, Tips and Tricks
762@subsection Miscellaneous useful variables
763
764This section describes a few variables you might want to set in your
765@file{~/.emacs} each of which doesn't warrant its own section.
766
767There is a conflict between the way the region behaved in emacs in the
768pre-GUI days and the way GUI users expect the selection to work. By
769default that conflict is resolved by having the former adopt the
770behaviour of the latter which most people prefer. However if you are a
771die-hard emacs user you may prefer things the other way around and add
772this line to your @file{~/.emacs}. Experiment with both settings.
773
774@lisp
775(setq transient-mark-mode nil)
776@end lisp
777
778When you try to move beyond the end of a file Emacs used to add newlines as
779needed, however from Emacs-21 on, this was no longer done. If you prefer the
780old behavior, this line in your @file{~/.emacs} will restore it.
781
782@lisp
783(setq next-line-add-newlines t)
784@end lisp
785
786By default when you kill a line with text on it, only the text is
787removed while the line itself remains. You have to kill twice to really
788get rid of the whole line. When this variable is set and you kill a
789line while at the beginning of the line it will go at once.
790
791@lisp
792(setq kill-whole-line t)
793@end lisp
794
795Annoyed by the Emacs startup message ? Add this and you start with a
796tabula rasa.
797
798@lisp
799(setq inhibit-startup-message t)
800@end lisp
801
802@node Color adjustments, Evaling in the minibuffer, Miscellaneous useful variables, Tips and Tricks
803@subsection Color adjustments
804
805A non-elisp hint: The easiest way to adjust your emacs color scheme is to
806bring up a color panel (with @key{Cmd-C}) and drag the color you want over the
807emacs face you want to change. Normal dragging will alter the foreground
808color. Shift dragging will alter the background color. To make the changes
809permanent select the "Save Options" item in the "Options" menu, or run
810@code{ns-save-preferences}. Useful in this context is the listing of all
811faces obtained by @key{M-x} @code{list-faces-display}.
812
813@node Evaling in the minibuffer, Highlighting matching parentheses, Color adjustments, Tips and Tricks
814@subsection Evaling in the minibuffer
815
816Often you (at least if you are an elisp hacker) want to quickly evaluate
817an elisp expression. To accomodate this desire Emacs provides the
818@code{eval-expression} command bound to @key{M-:}. By default it is
819disabled to protect novice users from themselves. These commands
820re-enable it and turn on an extremely powerful completion facility.
821
822@lisp
823(put 'eval-expression 'disabled nil)
824
825(define-key read-expression-map "\t" 'lisp-complete-symbol)
826@end lisp
827
828@node Highlighting matching parentheses, Dealing with X specific packages, Evaling in the minibuffer, Tips and Tricks
829@subsection Highlighting matching parentheses
830
831I doubt that there is anybody who doesn't use this already, but just in
832case:
833
834@lisp
835(show-paren-mode 't)
836@end lisp
837
838In Emacs.app this is currently enhanced by use of the @code{mic-paren} package
839from http://www.docs.uu.se/~mic/emacs.html.
840
841@node Dealing with X specific packages, Rebinding the numeric keypad, Highlighting matching parentheses, Tips and Tricks
842@subsection Dealing with X specific packages
843
844Some emacs lisp packages explicitly call X specific functions instead of
845calling generic functions which call the NS or X versions as appropriate.
846Typically such packages will result in error messages like @samp{Symbol's
847function definition is void: x-foo-bar}. The proper way of dealing with this
848is to have the author fix the code to call the generic functions. Generally
849all that requires is removing the @samp{x-} prefix from all function calls.
850
851However, sometimes that is not possible, or it may be a package internal to
852emacs itself. In this case please report a bug to the Emacs.app maintainers
853(not the main GNU emacs maintainers).
854
855A related problem is font names. For historical reasons, Emacs assumes all
856font names are given ``X style'', as in ``-adobe-courier-....-iso8859-1''.
857Emacs.app tries to work around this as well as possible, and the best thing to
858do is never rely on functions to set font names yourself but to always use the
859font panel.
860
861@node Rebinding the numeric keypad, Improving C mode, Dealing with X specific packages, Tips and Tricks
862@subsection Rebinding the numeric keypad
863
864By default in Emacs the numeric keypad keys are bound to the same
865characters they are in all other NS applications. But it is easy to
866change these bindings to commands many will find more useful. As an
867example here is the code which rebinds the numeric keypad for me.
868
869@lisp
870(global-set-key [kp-0] 'other-window)
871(global-set-key [kp-1] 'end-of-buffer)
872(global-set-key [kp-2] [down])
873(global-set-key [kp-3] 'scroll-up)
874(global-set-key [kp-4] [left])
875(global-set-key [kp-5] 'set-mark-command)
876(global-set-key [kp-6] [right])
877(global-set-key [kp-7] 'beginning-of-buffer)
878(global-set-key [kp-8] [up])
879(global-set-key [kp-9] 'scroll-down)
880(global-set-key [kp-decimal] 'yank)
881(global-set-key [kp-enter] 'set-mark-command)
882(global-set-key [kp-add] 'copy-region-as-kill)
883(global-set-key [kp-subtract] 'kill-region)
884@end lisp
885
886On machines with function keys they can be bound as well. This for example
887would bind @key{F12} to run gnus.
888
889@lisp
890(global-set-key [f12] 'gnus)
891@end lisp
892
893@node Improving C mode, Custom menu items, Rebinding the numeric keypad, Tips and Tricks
894@subsection Improving C mode
895
896That underscores are considered to break words in C mode has been driving me
897insane for a long time. This line fixes the problem.
898
899@lisp
900(modify-syntax-entry ?_ "w" c-mode-syntax-table)
901@end lisp
902
903@node Custom menu items, Single line scrolling, Improving C mode, Tips and Tricks
904@subsection Custom menu items
905
906The tools menu is intended for customization. Adding items to it is
907relatively painless as this example illustrates.
908
909@lisp
910(define-key global-map [menu-bar tools www] '("WWW" . w3-use-hotlist))
911@end lisp
912
913@node Single line scrolling, Open files by dragging to an Emacs window, Custom menu items, Tips and Tricks
914@subsection Single line scrolling
915
916The meta-arrow keys will perform single-line scrolling in Emacs
917just like they did in the old NeXT/OpenStep Stuart.app.
918
919@node Open files by dragging to an Emacs window, , Single line scrolling, Tips and Tricks
920@subsection Open files by dragging to an Emacs window
921
922The default behaviour when a user drags files from another application
923into an Emacs frame is to insert the contents of all the dragged files
924into the current buffer. To remap the @code{ns-drag-file} event to
925open the dragged files in the current frame use the following line:
926
927@lisp
928(define-key global-map [ns-drag-file] 'ns-find-file)
929@end lisp
930
931@ignore
932@node Extended font customization, , Single line scrolling, Tips and Tricks
933@subsection Extended font customization
934
935By default Emacs tries to guess the right font when you ask for a bold,
936italic or bold-italic face. Unfortunately this fails sometimes, for
937example Emacs won't guess that it should use @samp{Courier-Bold} as the
938font for the bold face of @samp{Ohlfs}. As an example here is the code
939which sets up @samp{Courier-Bold}, @samp{Courier-Oblique} and
940@samp{Courier-BoldOblique} as the fonts to be used with @samp{Ohlfs}.
941
942@lisp
943(setq ns-convert-font-trait-alist
944 '(("Ohlfs" "Courier-Bold" "Courier-Oblique"
945 "Courier-BoldOblique")))
946@end lisp
947
948You will still have to set the @samp{DefaultFont}, @samp{BoldFont},
949@samp{ItalicFont} and @samp{Bold-ItalicFont} defaults as Emacs
950initializes the default faces before it reads your @file{~/.emacs}.
951Also Emacs initializes @code{ns-convert-font-trait-alist} from these
952defaults so that normally it's sufficient to set these defaults to get
953correct faces.
954
955@example
956defaults write Emacs DefaultFont Ohlfs
957defaults write Emacs BoldFont Courier-Bold
958defaults write Emacs ItalicFont Courier-Oblique
959defaults write Emacs Bold-ItalicFont Courier-BoldOblique
960@end example
961@end ignore
962
963
964@node Thanks, , Tips and Tricks, Top
965@section Thanks
966A signficant number of people have been involved in the creation of Emacs.app.
967Carl Edman <cedman@@lynx.ps.uci.edu> created and maintained Emacs up to
968version 4.1 and it's reasonable to say that without his work, Emacs.app
969wouldn't exist. Michael Brouwer <michael@@thi.nl> wrote the original version
970(up to and including version 3.x) and was a constant contributor to Emacs.app
971version 4 and above. Christian Limpach <chris@@nice.ch> took over maintenance
972and updating at version 4.2, and made substantial contributions in a number of
973areas. Scott Bender <sbender@@harmony-ds.com> ported the code to OpenStep and
974Rhapsody for version 6.0. Christophe de Dinechin <ddd@@cup.hp.com> ported the
975code to MacOS X for version 7.0 and moved the code base to SourceForge. Leigh
976Smith <leigh@@leighsmith.com> maintained the SourceForge project for a period.
977Adrian Robert <arobert@@cogsci.ucsd.edu> ported the code to GNUstep
978(http://gnustep.org), updated it for post-emacs-20, and maintains it for the
979present.
980
981Also a number of others have contributed code. Steve Nygard
982<nygard@@telusplanet.net> got emacs to dump under OpenStep. The font panel
983code was Andrew Athan's <athan@@object.com> work. Joe Reiss
984<jreiss@@magnus.acs.ohio-state.edu> both created the beautiful icons you see
985and wrote the popup menu and dialog box code as well as much else. (Actually,
986Joe's icon became the one used for the Mac Carbon port..)
987
988Finally, suggestions from Darcy Brockbank, Timothy Bissell, Scott Byer, David
989Griffiths, Scott Hess, Eberhard Mandler, John C. Randolph, and Bradley Taylor
990all helped things along at one point or another. Axel Seibert
991<seiberta@@informatik.tu-muenchen.de> and Paul J. Sanchez
992<paul@@whimsy.umsl.edu> offered their time and machines to make a binary
993release possible.
994
995The GNUstep port was made possible through the assistance of Adam Fedor, Fred
996Kiefer, M. Uli Klusterer, Alexander Malmberg, and Jonas Matton. Gürkan Sengün
997made it accessible to a wider community.
998
999Riccardo Mottola helped with compatibility with MacOS versions 10.1 and 10.2,
1000and GNUstep on platforms other than Linux.
1001
1002Peter Dyballa kept things honest with multilingual support. Rahul Abrol, Adam
1003Ratcliffe, David M. Cooke, and Carsten Bormann provided various small patches.
1004
1005Then there were a number of people who kept up the constant supply of bug
1006reports, suggested features and praise (which is the main fuel which the
1007development of a project like this runs) and so helped ensure that this
1008program is as bug free (hah !) and feature rich as you see it today. First
1009among them were Hardy Mayer <hardy@@golem.ps.uci.edu>, Gisli Ottarsson
1010<gisli@@timoshenko.eecs.umich.edu>, Anthony Heading <ajrh@@signal.dra.hmg.gb>,
1011David Bau <bau@@cs.cornell.edu>, Jamie Zawinski <jwz@@lucid.com>, Martin
1012Moncrieffe <moncrief@@mayo.edu>, Simson L. Garfinkel
1013<simsong@@next.cambridge.ma.us>, Richard Stallman <rms@@gnu.ai.mit.edu>,
1014Stephen Anderson <anderson@@sapir.cog.jhu.edu>, Ivo Welch
1015<ivo@@next.agsm.ucla.edu>, Magnus Nordborg <magnus@@fisher.Stanford.EDU>, Tom
1016Epperly <epperly@@valeron.che.wisc.edu>, Andreas Koenig
1017<k@@franz.ww.tu-berlin.de>, Yves Arrouye <Yves.Arrouye@@imag.fr>, Anil
1018Somayaji <soma@@hotspur.mit.edu>, Gregor Hoffleit
1019<flight@@mathi.uni-heidelberg.DE> and doubtlessly many more.
1020
1021Finally, let us also thank those few hundred other people on the mailing list
1022from whom we didn't hear much, but the presence of which assured us that maybe
1023this project was actually worth doing.
1024@bye
1025
1026@ignore
1027 arch-tag: 286bdf18-ccfb-48b2-b730-994771de6bdd
1028@end ignore