Commit 48de8b12 authored by Chong Yidong's avatar Chong Yidong

Update docs for a bunch of 24.3 changes.

* doc/emacs/killing.texi (Rectangles): Document copy-rectangle-as-kill.

* doc/emacs/search.texi (Special Isearch): Document the lax space search
feature and M-s SPC.
(Regexp Search): Move main search-whitespace-regexp description to
Special Isearch.
(Replace): Document replace-lax-whitespace.

* doc/emacs/basic.texi (Position Info): Document C-u M-=.
(Moving Point): Document move-to-column.

* doc/emacs/display.texi (Useless Whitespace): Add delete-trailing-lines.

* doc/emacs/misc.texi (emacsclient Options): Document the effect of
initial-buffer-choice on client frames.  Document server-auth-dir.
Do not document server-host, which is bad security practice.

* doc/emacs/building.texi (Lisp Libraries): Docstring lookups can trigger
autoloading.  Document help-enable-auto-load.

* doc/emacs/mini.texi (Yes or No Prompts): New node.

* doc/emacs/ack.texi (Acknowledgments): Remove obsolete packages.

* doc/lispref/commands.texi (Click Events): Define "mouse position list".
Remove mention of unimplemented horizontal scroll bars.
(Drag Events, Motion Events): Refer to "mouse position list".
(Accessing Mouse): Document posnp.

* doc/lispref/errors.texi (Standard Errors): Tweak arith-error description.
Tweak markup.  Remove domain-error and friends, which seem to be
unused after the floating-point code revamp.

* doc/lispref/functions.texi (Obsolete Functions): Obsolescence also affects
documentation commands.  Various clarifications.
(Declare Form): New node.

* doc/lispref/loading.texi (Autoload):
* doc/lispref/help.texi (Documentation Basics): The special sequences can
trigger autoloading.

* doc/lispref/macros.texi (Defining Macros): Move description of `declare' to
Declare Form node.

* doc/lispref/numbers.texi (Integer Basics): Copyedits.
(Float Basics): Consider IEEE floating point always available.
(Random Numbers): Document actual limits.
(Arithmetic Operations): Clarify division by zero.  Don't mention
the machine-independence of negative division since it does not
happen in practice.

* doc/lispref/os.texi (Idle Timers): Minor clarifications.
(User Identification): Add system-users and system-groups.

* doc/lispref/strings.texi (String Basics): Copyedits.

* lisp/minibuffer.el (minibuffer-local-filename-syntax): Doc fix.

* lisp/server.el (server-host): Document the security implications.
(server-auth-key): Doc fix.

* lisp/startup.el (initial-buffer-choice): Doc fix.

* src/fns.c (Frandom): Doc fix.
parent 5938d519
2012-09-30 Chong Yidong <cyd@gnu.org>
* killing.texi (Rectangles): Document copy-rectangle-as-kill.
* search.texi (Special Isearch): Document the lax space search
feature and M-s SPC.
(Regexp Search): Move main search-whitespace-regexp description to
Special Isearch.
(Replace): Document replace-lax-whitespace.
* basic.texi (Position Info): Document C-u M-=.
(Moving Point): Document move-to-column.
* display.texi (Useless Whitespace): Add delete-trailing-lines.
* misc.texi (emacsclient Options): Document the effect of
initial-buffer-choice on client frames. Document server-auth-dir.
Do not document server-host, which is bad security practice.
* building.texi (Lisp Libraries): Docstring lookups can trigger
autoloading. Document help-enable-auto-load.
* mini.texi (Yes or No Prompts): New node.
* ack.texi (Acknowledgments): Remove obsolete packages.
2012-09-27 Glenn Morris <rgm@gnu.org>
* cal-xtra.texi (Advanced Calendar/Diary Usage):
......
......@@ -644,10 +644,9 @@ statically scoped Emacs lisp.
@item
Daniel LaLiberte wrote @file{edebug.el}, a source-level debugger for
Emacs Lisp; @file{cl-specs.el}, specifications to help @code{edebug}
debug code written using David Gillespie's Common Lisp support;
@file{cust-print.el}, a customizable package for printing lisp
objects; and @file{isearch.el}, Emacs's incremental search minor mode.
He also co-wrote @file{hideif.el} (q.v.@:).
debug code written using David Gillespie's Common Lisp support; and
@file{isearch.el}, Emacs's incremental search minor mode. He also
co-wrote @file{hideif.el} (q.v.@:).
@item
Karl Landstrom and Daniel Colascione wrote @file{js.el}, a mode for
......@@ -1301,15 +1300,14 @@ providing electric accent keys.
Colin Walters wrote Ibuffer, an enhanced buffer menu.
@item
Barry Warsaw wrote @file{assoc.el}, a set of utility functions for
working with association lists; @file{cc-mode.el}, a mode for editing
C, C@t{++}, and Java code, based on earlier work by Dave Detlefs,
Stewart Clamen, and Richard Stallman; @file{elp.el}, a profiler for
Emacs Lisp programs; @file{man.el}, a mode for reading Unix manual
pages; @file{regi.el}, providing an AWK-like functionality for use in
lisp programs; @file{reporter.el}, providing customizable bug
reporting for lisp packages; and @file{supercite.el}, a minor mode for
quoting sections of mail messages and news articles.
Barry Warsaw wrote @file{cc-mode.el}, a mode for editing C, C@t{++},
and Java code, based on earlier work by Dave Detlefs, Stewart Clamen,
and Richard Stallman; @file{elp.el}, a profiler for Emacs Lisp
programs; @file{man.el}, a mode for reading Unix manual pages;
@file{regi.el}, providing an AWK-like functionality for use in lisp
programs; @file{reporter.el}, providing customizable bug reporting for
lisp packages; and @file{supercite.el}, a minor mode for quoting
sections of mail messages and news articles.
@item
Christoph Wedler wrote @file{antlr-mode.el}, a major mode for ANTLR
......@@ -1351,9 +1349,8 @@ Directory Client; and @code{eshell}, a command shell implemented
entirely in Emacs Lisp. He also contributed to Org mode (q.v.@:).
@item
Mike Williams wrote @file{mouse-sel.el}, providing enhanced mouse
selection; and @file{thingatpt.el}, a library of functions for finding
the ``thing'' (word, line, s-expression) containing point.
Mike Williams wrote @file{thingatpt.el}, a library of functions for
finding the ``thing'' (word, line, s-expression) at point.
@item
Roland Winkler wrote @file{proced.el}, a system process editor.
......
......@@ -267,7 +267,8 @@ necessary (@code{scroll-up-command}). @xref{Scrolling}.
Scroll one screen backward, and move point onscreen if necessary
(@code{scroll-down-command}). @xref{Scrolling}.
@item M-x goto-char
@item M-g c
@kindex M-g c
@findex goto-char
Read a number @var{n} and move point to buffer position @var{n}.
Position 1 is the beginning of the buffer.
......@@ -285,6 +286,13 @@ also specify @var{n} by giving @kbd{M-g M-g} a numeric prefix argument.
@xref{Select Buffer}, for the behavior of @kbd{M-g M-g} when you give it
a plain prefix argument.
@item M-g @key{TAB}
@kindex M-g TAB
@findex move-to-column
Read a number @var{n} and move to column @var{n} in the current line.
Column 0 is the leftmost column. If called with a prefix argument,
move to the column number specified by the argument's numeric value.
@item C-x C-n
@kindex C-x C-n
@findex set-goal-column
......@@ -619,12 +627,16 @@ narrowed region and the line number relative to the whole buffer.
@kindex M-=
@findex count-words-region
@findex count-words
@kbd{M-=} (@code{count-words-region}) displays a message reporting
the number of lines, words, and characters in the region. @kbd{M-x
count-words} displays a similar message for the entire buffer, or for
the region if the region is @dfn{active}. @xref{Mark}, for an
explanation of the region.
the number of lines, words, and characters in the region
(@pxref{Mark}, for an explanation of the region). With a prefix
argument, @kbd{C-u M-=}, the command displays a count for the entire
buffer.
@findex count-words
The command @kbd{M-x count-words} does the same job, but with a
different calling convention. It displays a count for the region if
the region is active, and for the buffer otherwise.
@kindex C-x =
@findex what-cursor-position
......
......@@ -1393,13 +1393,21 @@ putting a line like this in your init file (@pxref{Init File}):
@end example
@cindex autoload
Some commands are @dfn{autoloaded}: when you run them, Emacs
Some commands are @dfn{autoloaded}; when you run them, Emacs
automatically loads the associated library first. For instance, the
@kbd{M-x compile} command (@pxref{Compilation}) is autoloaded; if you
call it, Emacs automatically loads the @code{compile} library first.
In contrast, the command @kbd{M-x recompile} is not autoloaded, so it
is unavailable until you load the @code{compile} library.
@vindex help-enable-auto-load
Automatic loading can also occur when you look up the documentation
of an autoloaded command (@pxref{Name Help}), if the documentation
refers to other functions and variables in its library (loading the
library lets Emacs properly set up the hyperlinks in the @file{*Help*}
buffer). To disable this feature, change the variable
@code{help-enable-auto-load} to @code{nil}.
@vindex load-dangerous-libraries
@cindex Lisp files byte-compiled by XEmacs
By default, Emacs refuses to load compiled Lisp files which were
......
......@@ -1044,9 +1044,9 @@ the left fringe, but no arrow bitmaps, use @code{((top . left)
@cindex whitespace, trailing
@vindex show-trailing-whitespace
It is easy to leave unnecessary spaces at the end of a line, or
empty lines at the end of a file, without realizing it. In most
cases, this @dfn{trailing whitespace} has no effect, but there are
special circumstances where it matters, and it can be a nuisance.
empty lines at the end of a buffer, without realizing it. In most
cases, this @dfn{trailing whitespace} has no effect, but sometimes it
can be a nuisance.
You can make trailing whitespace at the end of a line visible by
setting the buffer-local variable @code{show-trailing-whitespace} to
......@@ -1061,9 +1061,13 @@ the location of point is enough to show you that the spaces are
present.
@findex delete-trailing-whitespace
@vindex delete-trailing-lines
Type @kbd{M-x delete-trailing-whitespace} to delete all trailing
whitespace within the buffer. If the region is active, it deletes all
trailing whitespace in the region instead.
whitespace. This command deletes all extra spaces at the end of each
line in the buffer, and all empty lines at the end of the buffer; to
ignore the latter, change the varaible @code{delete-trailing-lines} to
@code{nil}. If the region is active, the command instead deletes
extra spaces at the end of each line in the region.
@vindex indicate-empty-lines
@cindex unused lines
......
......@@ -267,6 +267,7 @@ The Minibuffer
* Minibuffer History:: Reusing recent minibuffer arguments.
* Repetition:: Re-executing commands that used the minibuffer.
* Passwords:: Entering passwords in the echo area.
* Yes or No Prompts:: Replying yes or no in the echo area.
Completion
......
......@@ -79,11 +79,6 @@ non-@code{nil} value. (In that case, even if you specify one or more
files on the command line, Emacs opens but does not display them.)
The value of @code{initial-buffer-choice} should be the name of
the desired file or directory.
@ignore
@c I do not think this should be mentioned. AFAICS it is just a dodge
@c around inhibit-startup-screen not being settable on a site-wide basis.
or @code{t}, which means to display the @file{*scratch*} buffer.
@end ignore
@node Exiting
@section Exiting Emacs
......
......@@ -243,7 +243,7 @@ by the innermost Lisp expression in the buffer around point,
(That name appears as the default while you enter the argument.) For
example, if point is located following the text @samp{(make-vector
(car x)}, the innermost list containing point is the one that starts
with @samp{(make-vector}, so @kbd{C-h f @key{RET}} will describe the
with @samp{(make-vector}, so @kbd{C-h f @key{RET}} describes the
function @code{make-vector}.
@kbd{C-h f} is also useful just to verify that you spelled a
......
......@@ -709,6 +709,9 @@ rectangle, depending on the command that uses them.
@item C-x r k
Kill the text of the region-rectangle, saving its contents as the
``last killed rectangle'' (@code{kill-rectangle}).
@item C-x r M-w
Save the text of the region-rectangle as the ``last killed rectangle''
(@code{copy-rectangle-as-kill}).
@item C-x r d
Delete the text of the region-rectangle (@code{delete-rectangle}).
@item C-x r y
......@@ -757,6 +760,12 @@ yanking a rectangle is so different from yanking linear text that
different yank commands have to be used. Yank-popping is not defined
for rectangles.
@kindex C-x r M-w
@findex copy-rectangle-as-kill
@kbd{C-x r M-w} (@code{copy-rectangle-as-kill}) is the equivalent of
@kbd{M-w} for rectangles: it records the rectangle as the ``last
killed rectangle'', without deleting the text from the buffer.
@kindex C-x r y
@findex yank-rectangle
To yank the last killed rectangle, type @kbd{C-x r y}
......
......@@ -45,6 +45,7 @@ do not echo.
* Minibuffer History:: Reusing recent minibuffer arguments.
* Repetition:: Re-executing commands that used the minibuffer.
* Passwords:: Entering passwords in the echo area.
* Yes or No Prompts:: Replying yes or no in the echo area.
@end menu
@node Minibuffer File
......@@ -733,3 +734,53 @@ password (@pxref{Killing}). You may type either @key{RET} or
@key{ESC} to submit the password. Any other self-inserting character
key inserts the associated character into the password, and all other
input is ignored.
@node Yes or No Prompts
@section Yes or No Prompts
An Emacs command may require you to answer a ``yes or no'' question
during the course of its execution. Such queries come in two main
varieties.
@cindex y or n prompt
For the first type of ``yes or no'' query, the prompt ends with
@samp{(y or n)}. Such a query does not actually use the minibuffer;
the prompt appears in the echo area, and you answer by typing either
@samp{y} or @samp{n}, which immediately delivers the response. For
example, if you type @kbd{C-x C-w} (@kbd{write-file}) to save a
buffer, and enter the name of an existing file, Emacs issues a prompt
like this:
@smallexample
File `foo.el' exists; overwrite? (y or n)
@end smallexample
@noindent
Because this query does not actually use the minibuffer, the usual
minibuffer editing commands cannot be used. However, you can perform
some window scrolling operations while the query is active: @kbd{C-l}
recenters the selected window; @kbd{M-v} (or @key{PageDown} or
@key{next}) scrolls forward; @kbd{C-v} (or @key{PageUp}, or
@key{prior}) scrolls backward; @kbd{C-M-v} scrolls forward in the next
window; and @kbd{C-M-S-v} scrolls backward in the next window. Typing
@kbd{C-g} dismisses the query, and quits the command that issued it
(@pxref{Quitting}).
@cindex yes or no prompt
The second type of ``yes or no'' query is typically employed if
giving the wrong answer would have serious consequences; it uses the
minibuffer, and features a prompt ending with @samp{(yes or no)}. For
example, if you invoke @kbd{C-x k} (@code{kill-buffer}) on a
file-visiting buffer with unsaved changes, Emacs activates the
minibuffer with a prompt like this:
@smallexample
Buffer foo.el modified; kill anyway? (yes or no)
@end smallexample
@noindent
To answer, you must type @samp{yes} or @samp{no} into the minibuffer,
followed by @key{RET}. The minibuffer behaves as described in the
previous sections; you can switch to another window with @kbd{C-x o},
use the history commands @kbd{M-p} and @kbd{M-f}, etc. Type @kbd{C-g}
to quit the minibuffer and the querying command.
......@@ -1509,15 +1509,11 @@ precedence.
@cindex client frame
@item -c
Create a new graphical @dfn{client frame}, instead of using an
existing Emacs frame. If you omit a filename argument while supplying
the @samp{-c} option, the new frame displays the @file{*scratch*}
buffer (@pxref{Buffers}). See below for the special behavior of
@kbd{C-x C-c} in a client frame.
If Emacs is unable to create a new graphical frame (e.g.@: if it is
unable to connect to the X server), it tries to create a text terminal
client frame, as though you had supplied the @samp{-t} option instead
(see below).
existing Emacs frame. See below for the special behavior of @kbd{C-x
C-c} in a client frame. If Emacs cannot create a new graphical frame
(e.g.@: if it cannot connect to the X server), it tries to create a
text terminal client frame, as though you had supplied the @samp{-t}
option instead.
On MS-Windows, a single Emacs session cannot display frames on both
graphical and text terminals, nor on multiple text terminals. Thus,
......@@ -1525,6 +1521,11 @@ if the Emacs server is running on a text terminal, the @samp{-c}
option, like the @samp{-t} option, creates a new frame in the server's
current text terminal. @xref{Windows Startup}.
If you omit a filename argument while supplying the @samp{-c} option,
the new frame displays the @file{*scratch*} buffer by default. If
@code{initial-buffer-choice} is a string (@pxref{Entering Emacs}), the
new frame displays that file or directory instead.
@item -F @var{alist}
@itemx --frame-parameters=@var{alist}
Set the parameters for a newly-created graphical frame
......@@ -1545,38 +1546,24 @@ evaluate, @emph{not} as a list of files to visit.
@item -f @var{server-file}
@itemx --server-file=@var{server-file}
@cindex @env{EMACS_SERVER_FILE} environment variable
@cindex server file
@vindex server-use-tcp
@vindex server-host
Specify a @dfn{server file} for connecting to an Emacs server via TCP.
An Emacs server usually uses an operating system feature called a
``local socket'' to listen for connections. Some operating systems,
such as Microsoft Windows, do not support local sockets; in that case,
Emacs uses TCP instead. When you start the Emacs server, Emacs
creates a server file containing some TCP information that
@command{emacsclient} needs for making the connection. By default,
the server file is in @file{~/.emacs.d/server/}. On Microsoft
Windows, if @command{emacsclient} does not find the server file there,
it looks in the @file{.emacs.d/server/} subdirectory of the directory
pointed to by the @env{APPDATA} environment variable. You can tell
@command{emacsclient} to use a specific server file with the @samp{-f}
or @samp{--server-file} option, or by setting the
@env{EMACS_SERVER_FILE} environment variable.
Even if local sockets are available, you can tell Emacs to use TCP by
setting the variable @code{server-use-tcp} to @code{t}. One advantage
of TCP is that the server can accept connections from remote machines.
For this to work, you must (i) set the variable @code{server-host} to
the hostname or IP address of the machine on which the Emacs server
runs, and (ii) provide @command{emacsclient} with the server file.
(One convenient way to do the latter is to put the server file on a
networked file system such as NFS.)
the server communicates with @command{emacsclient} via TCP.
@vindex server-auth-dir
@cindex server file
@vindex server-port
When the Emacs server is using TCP, the variable @code{server-port}
determines the port number to listen on; the default value,
@code{nil}, means to choose a random port when the server starts.
When you start a TCP Emacs server, Emacs creates a @dfn{server file}
containing the TCP information to be used by @command{emacsclient} to
connect to the server. The variable @code{server-auth-dir} specifies
the directory containing the server file; by default, this is
@file{~/.emacs.d/server/}. To tell @command{emacsclient} to connect
to the server over TCP with a specific server file, use the @samp{-f}
or @samp{--server-file} option, or set the @env{EMACS_SERVER_FILE}
environment variable.
@item -n
@itemx --no-wait
......@@ -1606,19 +1593,14 @@ server it finds. (This option is not supported on MS-Windows.)
@itemx --tty
@itemx -nw
Create a new client frame on the current text terminal, instead of
using an existing Emacs frame. This is similar to the @samp{-c}
option, above, except that it creates a text terminal frame
(@pxref{Non-Window Terminals}). If you omit a filename argument while
supplying this option, the new frame displays the @file{*scratch*}
buffer (@pxref{Buffers}). See below for the special behavior of
@kbd{C-x C-c} in a client frame.
On MS-Windows, a single Emacs session cannot display frames on both
graphical and text terminals, nor on multiple text terminals. Thus,
if the Emacs server is using the graphical display, @samp{-t} behaves
like @samp{-c} (see above); whereas if the Emacs server is running on
a text terminal, it creates a new frame in its current text terminal.
@xref{Windows Startup}.
using an existing Emacs frame. This behaves just like the @samp{-c}
option, described above, except that it creates a text terminal frame
(@pxref{Non-Window Terminals}).
On MS-Windows, @samp{-t} behaves just like @samp{-c} if the Emacs
server is using the graphical display, but if the Emacs server is
running on a text terminal, it creates a new frame in the current text
terminal.
@end table
The new graphical or text terminal frames created by the @samp{-c}
......
......@@ -17,7 +17,6 @@ thing, but search for patterns instead of fixed strings.
(@pxref{Operating on Files}), or ask the @code{grep} program to do it
(@pxref{Grep Searching}).
@menu
* Incremental Search:: Search happens as you type the string.
* Nonincremental Search:: Specify entire string and then search.
......@@ -218,6 +217,24 @@ search.
Some of the characters you type during incremental search have
special effects.
@cindex lax space matching
@kindex M-s SPC @r{(Incremental search)}
@kindex SPC @r{(Incremental search)}
@findex isearch-toggle-lax-whitespace
@vindex search-whitespace-regexp
By default, incremental search performs @dfn{lax space matching}:
each space, or sequence of spaces, matches any sequence of one or more
spaces in the text. Hence, @samp{foo bar} matches @samp{foo bar},
@samp{foo bar}, @samp{foo bar}, and so on (but not @samp{foobar}).
More precisely, Emacs matches each sequence of space characters in the
search string to a regular expression specified by the variable
@code{search-whitespace-regexp}. For example, set it to
@samp{"[[:space:]\n]+"} to make spaces match sequences of newlines as
well as spaces. To toggle lax space matching, type @kbd{M-s SPC}
(@code{isearch-toggle-lax-whitespace}). To disable this feature
entirely, change @code{search-whitespace-regexp} to @code{nil}; then
each space in the search string matches exactly one space
If the search string you entered contains only lower-case letters,
the search is case-insensitive; as long as an upper-case letter exists
in the search string, the search becomes case-sensitive. If you
......@@ -492,12 +509,12 @@ Incremental regexp and non-regexp searches have independent defaults.
They also have separate search rings, which you can access with
@kbd{M-p} and @kbd{M-n}.
@vindex search-whitespace-regexp
If you type @key{SPC} in incremental regexp search, it matches any
sequence of whitespace characters, including newlines. If you want to
match just a space, type @kbd{C-q @key{SPC}}. You can control what a
bare space matches by setting the variable
@code{search-whitespace-regexp} to the desired regexp.
Just as in ordinary incremental search, any @key{SPC} typed in
incremental regexp search matches any sequence of one or more
whitespace characters. The variable @code{search-whitespace-regexp}
specifies the regexp for the lax space matching, and @kbd{M-s SPC}
(@code{isearch-toggle-lax-whitespace}) toggles the feature.
@xref{Special Isearch}.
In some cases, adding characters to the regexp in an incremental
regexp search can make the cursor move back and start again. For
......@@ -974,6 +991,13 @@ instead (@pxref{Mark}). The basic replace commands replace one
is possible to perform several replacements in parallel, using the
command @code{expand-region-abbrevs} (@pxref{Expanding Abbrevs}).
@vindex replace-lax-whitespace
Unlike incremental search, the replacement commands do not use lax
space matching (@pxref{Special Isearch}) by default. To enable lax
space matching for replacement, change the variable
@code{replace-lax-whitespace} to @code{t}. (This only affects how
Emacs finds the text to replace, not the replacement text.)
@menu
* Unconditional Replace:: Replacing all matches for a string.
* Regexp Replace:: Replacing all matches for a regexp.
......
2012-09-30 Chong Yidong <cyd@gnu.org>
* commands.texi (Click Events): Define "mouse position list".
Remove mention of unimplemented horizontal scroll bars.
(Drag Events, Motion Events): Refer to "mouse position list".
(Accessing Mouse): Document posnp.
* errors.texi (Standard Errors): Tweak arith-error description.
Tweak markup. Remove domain-error and friends, which seem to be
unused after the floating-point code revamp.
* functions.texi (Obsolete Functions): Obsolescence also affects
documentation commands. Various clarifications.
(Declare Form): New node.
* strings.texi (String Basics): Copyedits.
* os.texi (Idle Timers): Minor clarifications.
(User Identification): Add system-users and system-groups.
* macros.texi (Defining Macros): Move description of `declare' to
Declare Form node.
* loading.texi (Autoload):
* help.texi (Documentation Basics): The special sequences can
trigger autoloading.
* numbers.texi (Integer Basics): Copyedits.
(Float Basics): Consider IEEE floating point always available.
(Random Numbers): Document actual limits.
(Arithmetic Operations): Clarify division by zero. Don't mention
the machine-independence of negative division since it does not
happen in practice.
2012-09-28 Chong Yidong <cyd@gnu.org>
* os.texi (Startup Summary): Document leim-list.el change.
2012-09-25 Chong Yidong <cyd@gnu.org>
* functions.texi (Defining Functions): defun is now a macro.
2012-09-28 Leo Liu <sdl.web@gmail.com>
* files.texi (Files): Fix typo.
......
......@@ -1275,12 +1275,21 @@ describe events by their types; thus, if there is a key binding for
@var{event-type} is @code{mouse-1}.
@item @var{position}
This is the position where the mouse click occurred. The actual
format of @var{position} depends on what part of a window was clicked
on.
@cindex mouse position list
This is a @dfn{mouse position list} specifying where the mouse click
occurred; see below for details.
For mouse click events in the text area, mode line, header line, or in
the marginal areas, @var{position} has this form:
@item @var{click-count}
This is the number of rapid repeated presses so far of the same mouse
button. @xref{Repeat Events}.
@end table
To access the contents of a mouse position list in the
@var{position} slot of a click event, you should typically use the
functions documented in @ref{Accessing Mouse}. The explicit format of
the list depends on where the click occurred. For clicks in the text
area, mode line, header line, or in the fringe or marginal areas, the
mouse position list has the form
@example
(@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp}
......@@ -1289,18 +1298,16 @@ the marginal areas, @var{position} has this form:
@end example
@noindent
The meanings of these list elements are documented below.
@xref{Accessing Mouse}, for functions that let you easily access these
elements.
The meanings of these list elements are as follows:
@table @asis
@item @var{window}
This is the window in which the click occurred.
The window in which the click occurred.
@item @var{pos-or-area}
This is the buffer position of the character clicked on in the text
area, or if clicked outside the text area, it is the window area in
which the click occurred. It is one of the symbols @code{mode-line},
The buffer position of the character clicked on in the text area; or,
if the click was outside the text area, the window area where it
occurred. It is one of the symbols @code{mode-line},
@code{header-line}, @code{vertical-line}, @code{left-margin},
@code{right-margin}, @code{left-fringe}, or @code{right-fringe}.
......@@ -1310,22 +1317,23 @@ happens after the imaginary prefix keys for the event are registered
by Emacs. @xref{Key Sequence Input}.
@item @var{x}, @var{y}
These are the relative pixel coordinates of the click. For clicks in
the text area of a window, the coordinate origin @code{(0 . 0)} is
taken to be the top left corner of the text area. @xref{Window
Sizes}. For clicks in a mode line or header line, the coordinate
origin is the top left corner of the window itself. For fringes,
margins, and the vertical border, @var{x} does not have meaningful
data. For fringes and margins, @var{y} is relative to the bottom edge
of the header line. In all cases, the @var{x} and @var{y} coordinates
increase rightward and downward respectively.
The relative pixel coordinates of the click. For clicks in the text
area of a window, the coordinate origin @code{(0 . 0)} is taken to be
the top left corner of the text area. @xref{Window Sizes}. For
clicks in a mode line or header line, the coordinate origin is the top
left corner of the window itself. For fringes, margins, and the
vertical border, @var{x} does not have meaningful data. For fringes
and margins, @var{y} is relative to the bottom edge of the header
line. In all cases, the @var{x} and @var{y} coordinates increase
rightward and downward respectively.
@item @var{timestamp}
This is the time at which the event occurred, in milliseconds.
The time at which the event occurred, as an integer number of
milliseconds since a system-dependent initial time.
@item @var{object}
This is either @code{nil} if there is no string-type text property at
the click position, or a cons cell of the form (@var{string}
Either @code{nil} if there is no string-type text property at the
click position, or a cons cell of the form (@var{string}
. @var{string-pos}) if there is one:
@table @asis
......@@ -1371,8 +1379,7 @@ These are the pixel width and height of @var{object} or, if this is
@code{nil}, those of the character glyph clicked on.
@end table
@sp 1
For mouse clicks on a scroll-bar, @var{position} has this form:
For clicks on a scroll bar, @var{position} has this form:
@example
(@var{window} @var{area} (@var{portion} . @var{whole}) @var{timestamp} @var{part})
......@@ -1380,32 +1387,35 @@ For mouse clicks on a scroll-bar, @var{position} has this form:
@table @asis
@item @var{window}
This is the window whose scroll-bar was clicked on.
The window whose scroll bar was clicked on.
@item @var{area}
This is the scroll bar where the click occurred. It is one of the
symbols @code{vertical-scroll-bar} or @code{horizontal-scroll-bar}.
This is the symbol @code{vertical-scroll-bar}.
@item @var{portion}
This is the distance of the click from the top or left end of
the scroll bar.
The number of pixels from the top of the scroll bar to the click
position. On some toolkits, including GTK+, Emacs cannot extract this
data, so the value is always @code{0}.
@item @var{whole}