Allow emacsclient to set parameters of new graphical frames (bug#5864)
[bpt/emacs.git] / doc / emacs / misc.texi
index 3399642..f83ac38 100644 (file)
@@ -1,6 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
-@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
 @c   Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @iftex
@@ -27,28 +26,39 @@ other editors, and various diversions and amusements.
 @cindex PDF file
 @cindex PS file
 @cindex Postscript file
+@cindex OpenDocument file
+@cindex Microsoft Office file
 @cindex DocView mode
 @cindex mode, DocView
 @cindex document viewer (DocView)
 @findex doc-view-mode
 
 DocView mode (@code{doc-view-mode}) is a viewer for DVI, Postscript
-(PS), and PDF documents.  It provides features such as slicing,
-zooming, and searching inside documents.  It works by converting the
-document to a set of images using the @command{gs} (GhostScript)
-command, and displaying those images.
+(PS), PDF, OpenDocument, and Microsoft Office documents.  It provides
+features such as slicing, zooming, and searching inside documents.  It
+works by converting the document to a set of images using the
+@command{gs} (GhostScript) command and other external tools
+@footnote{@code{gs} is a hard requirement.  For DVI files,
+@code{dvipdf} or @code{dvipdfm} is needed.  For OpenDocument and
+Microsoft Office documents, the @code{unoconv} tool is needed.}, and
+displaying those images.
 
 @findex doc-view-toggle-display
 @findex doc-view-toggle-display
 @cindex doc-view-minor-mode
-  When you visit a PDF or DVI file, Emacs automatically switches to
-DocView mode.  When you visit a Postscript file, Emacs switches to PS
-mode, a major mode for editing Postscript files as text; however, it
-also enables DocView minor mode, so you can type @kbd{C-c C-c} to view
-the document with DocView.  (PDF and DVI files, unlike Postscript
-files, are not usually human-editable.)  In either case, repeating
-@kbd{C-c C-c} (@code{doc-view-toggle-display}) toggles between DocView
-and the file text.
+  When you visit a document file with the exception of Postscript
+files, Emacs automatically switches to DocView mode if possible
+@footnote{The needed external tools for this document type have to be
+available, emacs needs to run in a graphical frame, and PNG image
+support has to be compiled into emacs.  If any of these requirements
+is not fulfilled, DocView falls back to an appropriate mode.}.  When
+you visit a Postscript file, Emacs switches to PS mode, a major mode
+for editing Postscript files as text; however, it also enables DocView
+minor mode, so you can type @kbd{C-c C-c} to view the document with
+DocView.  (PDF and DVI files, unlike Postscript files, are not usually
+human-editable.)  In either case, repeating @kbd{C-c C-c}
+(@code{doc-view-toggle-display}) toggles between DocView and the file
+text.
 
   You can explicitly toggle DocView mode with the command @code{M-x
 doc-view-mode}, and DocView minor mode with the command @code{M-x
@@ -71,10 +81,10 @@ set or customize the variable @code{doc-view-resolution}.
 (@code{quit-window}).
 
 @menu
-* Navigation:: Navigation inside DocView buffers.
-* Searching::  Searching inside documents.
-* Slicing::    Specifying which part of pages should be displayed.
-* Conversion:: Influencing and triggering conversion.
+* Navigation::  Navigation inside DocView buffers.
+* Searching::   Searching inside documents.
+* Slicing::     Specifying which part of pages should be displayed.
+* Conversion::  Influencing and triggering conversion.
 @end menu
 
 @node Navigation
@@ -84,11 +94,20 @@ When in DocView mode, you can scroll the current page using the usual
 Emacs movement keys: @kbd{C-p}, @kbd{C-n}, @kbd{C-b}, @kbd{C-f}, and
 the arrow keys.
 
+@vindex doc-view-continuous
+  By default, the line-motion keys @kbd{C-p} and @kbd{C-n} stop
+scrolling at the beginning and end of the current page, respectively.
+However, if you change the variable @code{doc-view-continuous} to a
+non-@code{nil} value, then @kbd{C-p} displays the previous page if you
+are already at the beginning of the current page, and @kbd{C-n}
+displays the next page if you are at the end of the current page.
+
 @findex doc-view-next-page
 @findex doc-view-previous-page
-  To display the next page, type @kbd{n}, @key{next} or @kbd{C-x ]}
-(@code{doc-view-next-page}).  To display the previous page, type
-@kbd{p}, @key{prior} or @kbd{C-x [} (@code{doc-view-previous-page}).
+  You can also display the next page by typing @kbd{n}, @key{next} or
+@kbd{C-x ]} (@code{doc-view-next-page}).  To display the previous
+page, type @kbd{p}, @key{prior} or @kbd{C-x [}
+(@code{doc-view-previous-page}).
 
 @findex doc-view-scroll-up-or-next-page
 @findex doc-view-scroll-down-or-previous-page
@@ -194,7 +213,7 @@ Here we introduce Gnus and describe several basic features.
 For full details, see @ref{Top, Gnus,, gnus, The Gnus Manual}.
 @end ifnottex
 @iftex
-For full details on Gnus, type @kbd{M-x info} and then select the Gnus
+For full details on Gnus, type @kbd{C-h i} and then select the Gnus
 manual.
 @end iftex
 
@@ -202,9 +221,9 @@ manual.
 To start Gnus, type @kbd{M-x gnus @key{RET}}.
 
 @menu
-* Buffers of Gnus::    The group, summary, and article buffers.
-* Gnus Startup::       What you should know about starting Gnus.
-* Summary of Gnus::    A short description of the basic Gnus commands.
+* Buffers of Gnus::     The group, summary, and article buffers.
+* Gnus Startup::        What you should know about starting Gnus.
+* Summary of Gnus::     A short description of the basic Gnus commands.
 @end menu
 
 @node Buffers of Gnus
@@ -485,6 +504,9 @@ Run the shell command line @var{cmd} and display the output
 Run the shell command line @var{cmd} with region contents as input;
 optionally replace the region with the output
 (@code{shell-command-on-region}).
+@item M-& @var{cmd} @key{RET}
+Run the shell command line @var{cmd} asynchronously, and display the
+output (@code{async-shell-command}).
 @item M-x shell
 Run a subshell with input and output through an Emacs buffer.
 You can then give commands interactively.
@@ -542,6 +564,11 @@ command's exit status (0 means success), when it is called from a Lisp
 program.  You do not get any status information for an asynchronous
 command, since it hasn't finished yet when @code{shell-command} returns.
 
+  You can also type @kbd{M-&} (@code{async-shell-command}) to execute
+a shell command asynchronously.  This behaves exactly like calling
+@code{shell-command} with @samp{&}, except that you do not need to add
+the @samp{&} to the shell command line.
+
 @kindex M-|
 @findex shell-command-on-region
   @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!} but
@@ -769,8 +796,7 @@ pending in the shell buffer and not yet sent.
 @findex comint-delete-output
 Delete the last batch of output from a shell command
 (@code{comint-delete-output}).  This is useful if a shell command spews
-out lots of output that just gets in the way.  This command used to be
-called @code{comint-kill-output}.
+out lots of output that just gets in the way.
 
 @item C-c C-s
 @kindex C-c C-s @r{(Shell mode)}
@@ -949,12 +975,9 @@ Fetch the next earlier old shell command.
 Fetch the next later old shell command.
 
 @kindex M-r @r{(Shell mode)}
-@kindex M-s @r{(Shell mode)}
-@findex comint-previous-matching-input
-@findex comint-next-matching-input
-@item M-r @var{regexp} @key{RET}
-@itemx M-s @var{regexp} @key{RET}
-Search backwards or forwards for old shell commands that match @var{regexp}.
+@findex comint-history-isearch-backward-regexp
+@item M-r
+Begin an incremental regexp search of old shell commands.
 
 @item C-c C-x
 @kindex C-c C-x @r{(Shell mode)}
@@ -987,15 +1010,15 @@ successively more recent shell commands from the buffer.
 @kbd{C-@key{UP}} works like @kbd{M-p}, and @kbd{C-@key{DOWN}} like
 @kbd{M-n}.
 
-  The history search commands @kbd{M-r} and @kbd{M-s} read a regular
-expression and search through the history for a matching command.  Aside
-from the choice of which command to fetch, they work just like @kbd{M-p}
-and @kbd{M-n}.  If you enter an empty regexp, these commands reuse the
-same regexp used last time.
-
-  When you find the previous input you want, you can resubmit it by
-typing @key{RET}, or you can edit it first and then resubmit it if you
-wish.  Any partial input you were composing before navigating the
+  The history search command @kbd{M-r} begins an incremental regular
+expression search of previous shell commands.  After typing @kbd{M-r},
+start typing the desired string or regular expression; the last
+matching shell command will be displayed in the current line.
+Incremental search commands have their usual effects---for instance,
+@kbd{C-s} and @kbd{C-r} search forward and backward for the next match
+(@pxref{Incremental Search}).  When you find the desired input, type
+@key{RET} to terminate the search.  This puts the input in the command
+line.  Any partial input you were composing before navigating the
 history list is restored when you go to the beginning or end of the
 history ring.
 
@@ -1203,13 +1226,6 @@ directory stack if they are not already on it
 (@code{shell-pushd-dunique}).  The values you choose should match the
 underlying shell, of course.
 
-  If you want Shell mode to handle color output from shell commands,
-you can enable ANSI Color mode.  Here is how to do this:
-
-@example
-(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
-@end example
-
 @node Terminal emulator
 @subsection Emacs Terminal Emulator
 @findex term
@@ -1479,6 +1495,15 @@ server-name @key{RET} foo @key{RET}} sets the server name to
 @samp{foo}.  The @code{emacsclient} program can specify a server by
 name, using the @samp{-s} option (@pxref{emacsclient Options}).
 
+@findex server-eval-at
+  If you have defined a server by a unique server name, you can
+connect to this server from other Emacs instances and evaluate forms
+on it by using the @code{server-eval-at} function.
+
+@code{(server-eval-at "foo" '(+ 1 2))} gives the result @code{3}, if
+there's a server with that name that is listening.  If not, an error
+will be signaled.
+
 @menu
 * Invoking emacsclient:: Connecting to the Emacs server.
 * emacsclient Options::  Emacs client startup options.
@@ -1521,7 +1546,7 @@ still use Emacs to edit the file.
 @kbd{C-x #} (@code{server-edit}) in its buffer.  This saves the file
 and sends a message back to the @command{emacsclient} program, telling
 it to exit.  Programs that use @env{EDITOR} usually wait for the
-``editor''---in the case @command{emacsclient}---to exit before doing
+``editor''---in this case @command{emacsclient}---to exit before doing
 something else.
 
   You can also call @command{emacsclient} with multiple file name
@@ -1578,16 +1603,8 @@ listed below:
 @item -a @var{command}
 @itemx --alternate-editor=@var{command}
 Specify a command to run if @code{emacsclient} fails to contact Emacs.
-This is useful when running @code{emacsclient} in a script.  For
-example, the following setting for the @env{EDITOR} environment
-variable will always give you an editor, even if no Emacs server is
-running:
-
-@example
-EDITOR="emacsclient --alternate-editor emacs +%d %s"
-@end example
+This is useful when running @code{emacsclient} in a script.
 
-@noindent
 As a special exception, if @var{command} is the empty string, then
 @code{emacsclient} starts Emacs in daemon mode and then tries
 connecting again.
@@ -1606,6 +1623,11 @@ text-only terminal frame (@pxref{Frames}).  If you omit a filename
 argument while supplying the @samp{-c} option, the new frame displays
 the @samp{*scratch*} buffer (@pxref{Buffers}).
 
+@item -F
+@itemx --frame-parameters=@var{alist}
+Set the parameters for a newly-created graphical frame
+(@pxref{Frame Parameters}).
+
 @item -d @var{display}
 @itemx --display=@var{display}
 Tell Emacs to open the given files on the X display @var{display}
@@ -1656,6 +1678,11 @@ all server buffers are finished.  You can take as long as you like to
 edit the server buffers within Emacs, and they are @emph{not} killed
 when you type @kbd{C-x #} in them.
 
+@item -q
+@itemx --quiet
+Do not let @command{emacsclient} display messages about waiting for
+Emacs or connecting to remote server sockets.
+
 @item -s @var{server-name}
 @itemx --socket-name=@var{server-name}
 Connect to the Emacs server named @var{server-name}.  The server name
@@ -1694,8 +1721,14 @@ process, type @kbd{M-x kill-emacs}.
   Emacs provides commands for printing hard copies of either an entire
 buffer or just part of one, with or without page headers.  You can
 invoke the printing commands directly, as detailed in the following
-section, or using the @samp{File} menu on the menu bar.  See also the
-hardcopy commands of Dired (@pxref{Misc File Ops}) and the diary
+section, or using the @samp{File} menu on the menu bar.
+
+@findex htmlfontify-buffer
+  Aside from the commands described in this section, you can also
+``print'' an Emacs buffer to HTML with @kbd{M-x htmlfontify-buffer}.
+This command converts the current buffer to a HTML file, replacing
+Emacs faces with CSS-based markup.  In addition, see the hardcopy
+commands of Dired (@pxref{Misc File Ops}) and the diary
 (@pxref{Displaying the Diary}).
 
 @table @kbd
@@ -1744,7 +1777,7 @@ whether to supply @samp{-T} and @samp{-J} options (suitable for
 not compatible with @code{lpr}.
 
 @menu
-* PostScript::          Printing buffers or regions as PostScript.
+* PostScript::           Printing buffers or regions as PostScript.
 * PostScript Variables:: Customizing the PostScript printing commands.
 * Printing Package::     An optional advanced printing interface.
 @end menu
@@ -2336,8 +2369,11 @@ sessions, or add this line in your init file (@pxref{Init File}):
 
 @findex desktop-change-dir
 @findex desktop-revert
+@vindex desktop-path
   If you turn on @code{desktop-save-mode} in your init file, then when
 Emacs starts, it looks for a saved desktop in the current directory.
+(More precisely, it looks in the directories specified by
+@var{desktop-path}, and uses the first desktop it finds.)
 Thus, you can have separate saved desktops in different directories,
 and the starting directory determines which one Emacs reloads.  You
 can save the current desktop and reload one saved in another directory
@@ -2474,9 +2510,8 @@ also use the command @kbd{M-x scroll-all-mode} or set the variable
 @item EDT (DEC VMS editor)
 @findex edt-emulation-on
 @findex edt-emulation-off
-Turn on EDT emulation with the command @kbd{M-x edt-emulation-on},
-while @kbd{M-x edt-emulation-off} restores normal Emacs command
-bindings.
+Turn on EDT emulation @kbd{M-x edt-emulation-on}; use @kbd{M-x
+edt-emulation-off} to restore normal Emacs command bindings.
 
 Most of the EDT emulation commands are keypad keys, and most standard
 Emacs key bindings are still available.  The EDT emulation rebindings
@@ -2771,6 +2806,10 @@ bored, try an argument of 9.  Sit back and watch.
   If you want a little more personal involvement, try @kbd{M-x gomoku},
 which plays the game Go Moku with you.
 
+@findex bubbles
+  @kbd{M-x bubbles} is a game in which the object is to remove as many
+bubbles as you can in the smallest number of moves.
+
 @findex blackbox
 @findex mpuz
 @findex 5x5
@@ -2819,6 +2858,11 @@ bats.
 @kbd{M-x solitaire} plays a game of solitaire in which you jump pegs
 across other pegs.
 
+@findex animate-birthday-present
+@cindex animate
+The @code{animate} package makes text dance.  For an example, try
+@kbd{M-x animate-birthday-present}.
+
 @findex studlify-region
 @cindex StudlyCaps
 @kbd{M-x studlify-region} studlify-cases the region, producing
@@ -2848,7 +2892,3 @@ idle.
 @ifnottex
 @lowersections
 @end ifnottex
-
-@ignore
-   arch-tag: 8f094220-c0d5-4e9e-af7d-3e0da8187474
-@end ignore