aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2004-01-01 14:09:01 +0000
committerMiles Bader2004-01-01 14:09:01 +0000
commita3cb3b2eafb528390459892e580cbf9e601475ea (patch)
tree7397d7de7205e181e2187463637a9c9fd7ad5626
parent02c77ee91c2ba77634313783193bbfd18160ec52 (diff)
downloademacs-a3cb3b2eafb528390459892e580cbf9e601475ea.tar.gz
emacs-a3cb3b2eafb528390459892e580cbf9e601475ea.zip
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-13
Minor tweaks to Buttons section in lispref/display.texi
-rw-r--r--lispref/display.texi60
1 files changed, 35 insertions, 25 deletions
diff --git a/lispref/display.texi b/lispref/display.texi
index 25aea971638..fc1cdb038ef 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -3404,13 +3404,14 @@ are cleared.
3404 3404
3405@node Buttons 3405@node Buttons
3406@section Buttons 3406@section Buttons
3407@cindex buttons
3407@cindex buttons in buffers 3408@cindex buttons in buffers
3408@cindex clickable buttons in buffers 3409@cindex clickable buttons in buffers
3409 3410
3410 The @emph{button} package defines functions for inserting and 3411 The @emph{button} package defines functions for inserting and
3411manipulating clickable (with the mouse, or via keyboard commands) 3412manipulating clickable (with the mouse, or via keyboard commands)
3412buttons in Emacs buffers, such as might be used for help hyperlinks, 3413buttons in Emacs buffers, such as might be used for help hyper-links,
3413etc. Emacs uses buttons for the hyperlinks in help text and the like. 3414etc. Emacs uses buttons for the hyper-links in help text and the like.
3414 3415
3415A button is essentially a set of properties attached (via text 3416A button is essentially a set of properties attached (via text
3416properties or overlays) to a region of text in an emacs buffer, which 3417properties or overlays) to a region of text in an emacs buffer, which
@@ -3434,7 +3435,7 @@ entries).
3434@menu 3435@menu
3435* Button Properties:: Button properties with special meanings. 3436* Button Properties:: Button properties with special meanings.
3436* Button Types:: Defining common properties for classes of buttons. 3437* Button Types:: Defining common properties for classes of buttons.
3437* Making buttons:: Adding buttons to emacs buffers. 3438* Making Buttons:: Adding buttons to emacs buffers.
3438* Manipulating Buttons:: Getting and setting properties of buttons. 3439* Manipulating Buttons:: Getting and setting properties of buttons.
3439* Button Buffer Commands:: Buffer-wide commands and bindings for buttons. 3440* Button Buffer Commands:: Buffer-wide commands and bindings for buttons.
3440* Manipulating Button Types:: 3441* Manipulating Button Types::
@@ -3454,41 +3455,49 @@ include:
3454@table @code 3455@table @code
3455 3456
3456@item action 3457@item action
3458@kindex action @r{(button property)}
3457The function to call when the user invokes the button, which is passed 3459The function to call when the user invokes the button, which is passed
3458the single argument @var{button}. By default this is @code{ignore}, 3460the single argument @var{button}. By default this is @code{ignore},
3459which does nothing. 3461which does nothing.
3460 3462
3461@item mouse-action 3463@item mouse-action
3464@kindex mouse-action @r{(button property)}
3462This is similar to @code{action}, and when present, will be used 3465This is similar to @code{action}, and when present, will be used
3463instead of @code{action} for button invocations resulting from 3466instead of @code{action} for button invocations resulting from
3464mouse-clicks (instead of the user hitting @key{RET}). If not 3467mouse-clicks (instead of the user hitting @key{RET}). If not
3465present, mouse-clicks use @code{action} instead. 3468present, mouse-clicks use @code{action} instead.
3466 3469
3467@item face 3470@item face
3471@kindex face @r{(button property)}
3468This is an emacs face controlling how buttons of this type are 3472This is an emacs face controlling how buttons of this type are
3469displayed; by default this is the @code{button} face. 3473displayed; by default this is the @code{button} face.
3470 3474
3471@item mouse-face 3475@item mouse-face
3476@kindex mouse-face @r{(button property)}
3472This is an additional face which controls appearance during 3477This is an additional face which controls appearance during
3473mouse-overs (merged with the usual button face); by default this is 3478mouse-overs (merged with the usual button face); by default this is
3474the usual emacs @code{highlight} face. 3479the usual emacs @code{highlight} face.
3475 3480
3476@item keymap 3481@item keymap
3482@kindex keymap @r{(button property)}
3477The button's keymap, defining bindings active within the button 3483The button's keymap, defining bindings active within the button
3478region. By default this is the usual button region keymap, stored 3484region. By default this is the usual button region keymap, stored
3479in the variable @code{button-map}, which defines @key{RET} and 3485in the variable @code{button-map}, which defines @key{RET} and
3480@key{down-mouse-1} to invoke the button. 3486@key{down-mouse-1} to invoke the button.
3481 3487
3482@item type 3488@item type
3489@kindex type @r{(button property)}
3483The button-type of the button. When creating a button, this is 3490The button-type of the button. When creating a button, this is
3484usually specified using the @code{:type} keyword argument. 3491usually specified using the @code{:type} keyword argument.
3485@xref{Button Types}. 3492@xref{Button Types}.
3486 3493
3487@item help-echo 3494@item help-echo
3488A string displayed by the emacs tooltip help system; by default, 3495@kindex help-index @r{(button property)}
3496A string displayed by the emacs tool-tip help system; by default,
3489@code{"mouse-2, RET: Push this button"}. 3497@code{"mouse-2, RET: Push this button"}.
3490 3498
3491@item button 3499@item button
3500@kindex button @r{(button property)}
3492All buttons have a non-@code{nil} @code{button} property, which may be useful 3501All buttons have a non-@code{nil} @code{button} property, which may be useful
3493in finding regions of text that comprise buttons (which is what the 3502in finding regions of text that comprise buttons (which is what the
3494standard button functions do). 3503standard button functions do).
@@ -3502,10 +3511,10 @@ button, but these are not generally interesting for typical uses.
3502@cindex button types 3511@cindex button types
3503 3512
3504 Every button has a button @emph{type}, which defines default values 3513 Every button has a button @emph{type}, which defines default values
3505for the button's properties; button types are arranged in a hierarchy, 3514for the button's properties. Button types are arranged in a
3506with specialized types inheriting from more general types, so that 3515hierarchy, with specialized types inheriting from more general types,
3507it's easy to define special-purpose types of buttons for specific 3516so that it's easy to define special-purpose types of buttons for
3508tasks. 3517specific tasks.
3509 3518
3510@defun define-button-type name &rest properties 3519@defun define-button-type name &rest properties
3511@tindex define-button-type 3520@tindex define-button-type
@@ -3523,11 +3532,12 @@ reflected in its subtypes.
3523@end defun 3532@end defun
3524 3533
3525Using @code{define-button-type} to define default properties for 3534Using @code{define-button-type} to define default properties for
3526buttons is not necessary, but it is is encouraged, since doing so 3535buttons is not necessary---buttons without any specified type use the
3527usually makes the resulting code clearer and more efficient. 3536built-in button-type @code{button}---but it is is encouraged, since
3537doing so usually makes the resulting code clearer and more efficient.
3528 3538
3529@node Making buttons 3539@node Making Buttons
3530@subsection Making buttons 3540@subsection Making Buttons
3531@cindex making buttons 3541@cindex making buttons
3532 3542
3533 Buttons are associated with a region of text, using an overlay or 3543 Buttons are associated with a region of text, using an overlay or
@@ -3624,9 +3634,8 @@ Set @var{button}'s @var{prop} property to @var{val}.
3624@tindex button-activate 3634@tindex button-activate
3625Call @var{button}'s @code{action} property (i.e., invoke it). If 3635Call @var{button}'s @code{action} property (i.e., invoke it). If
3626@var{use-mouse-action} is non-@code{nil}, try to invoke the button's 3636@var{use-mouse-action} is non-@code{nil}, try to invoke the button's
3627@code{mouse-action} property instead of @code{action}, but if the 3637@code{mouse-action} property instead of @code{action}; if the button
3628button has no @code{mouse-action} property, use @code{action} as 3638has no @code{mouse-action} property, use @code{action} as normal.
3629normal.
3630@end defun 3639@end defun
3631 3640
3632@defun button-label button 3641@defun button-label button
@@ -3670,12 +3679,13 @@ parent keymap for its keymap.
3670@tindex push-button 3679@tindex push-button
3671Perform the action specified by a button at location @var{pos}. 3680Perform the action specified by a button at location @var{pos}.
3672@var{pos} may be either a buffer position or a mouse-event. If 3681@var{pos} may be either a buffer position or a mouse-event. If
3673@var{use-mouse-action} is non-@code{nil}, try to invoke the button's 3682@var{use-mouse-action} is non-@code{nil}, or @var{pos} is a
3674@code{mouse-action} property instead of @code{action}, but if the 3683mouse-event (@pxref{Mouse Events}), try to invoke the button's
3675button has no @code{mouse-action} property, use @code{action} as 3684@code{mouse-action} property instead of @code{action}; if the button
3676normal. @var{pos} defaults to point, except when `push-button' is 3685has no @code{mouse-action} property, use @code{action} as normal.
3677invoked interactively as the result of a mouse-event, in which case, 3686@var{pos} defaults to point, except when @code{push-button} is invoked
3678the mouse event is used. If there's no button at @var{pos}, do 3687interactively as the result of a mouse-event, in which case, the mouse
3688event's position is used. If there's no button at @var{pos}, do
3679nothing and return @code{nil}, otherwise return @code{t}. 3689nothing and return @code{nil}, otherwise return @code{t}.
3680@end deffn 3690@end deffn
3681 3691
@@ -3686,8 +3696,8 @@ Move to the @var{n}th next button, or @var{n}th previous button if
3686button at point. If @var{wrap} is non-@code{nil}, moving past either 3696button at point. If @var{wrap} is non-@code{nil}, moving past either
3687end of the buffer continues from the other end. If 3697end of the buffer continues from the other end. If
3688@var{display-message} is non-@code{nil}, the button's help-echo string 3698@var{display-message} is non-@code{nil}, the button's help-echo string
3689is displayed. Any button with a non-@code{nil} `skip' property is 3699is displayed. Any button with a non-@code{nil} @code{skip} property
3690skipped over. Returns the button found. 3700is skipped over. Returns the button found.
3691@end deffn 3701@end deffn
3692 3702
3693@deffn Command backward-button n &optional wrap display-message 3703@deffn Command backward-button n &optional wrap display-message
@@ -3697,8 +3707,8 @@ Move to the @var{n}th previous button, or @var{n}th next button if
3697button at point. If @var{wrap} is non-@code{nil}, moving past either 3707button at point. If @var{wrap} is non-@code{nil}, moving past either
3698end of the buffer continues from the other end. If 3708end of the buffer continues from the other end. If
3699@var{display-message} is non-@code{nil}, the button's help-echo string 3709@var{display-message} is non-@code{nil}, the button's help-echo string
3700is displayed. Any button with a non-@code{nil} `skip' property is 3710is displayed. Any button with a non-@code{nil} @code{skip} property
3701skipped over. Returns the button found. 3711is skipped over. Returns the button found.
3702@end deffn 3712@end deffn
3703 3713
3704@defun next-button pos &optional count-current 3714@defun next-button pos &optional count-current