aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2016-04-09 12:30:59 +0300
committerEli Zaretskii2016-04-09 12:30:59 +0300
commite87fbc07801a4ac291d335f0af957ca32cd26381 (patch)
treeee860dec60f8b944ae6be93ab71c5e74df166131
parent9f1786e4165aba30ddb16116c5557a0531233008 (diff)
downloademacs-e87fbc07801a4ac291d335f0af957ca32cd26381.tar.gz
emacs-e87fbc07801a4ac291d335f0af957ca32cd26381.zip
Improve Lisp-level documentation of tooltips
* doc/lispref/display.texi (Tooltips): New section. (Bug#23246) (Display): Update the chapter menu. * doc/lispref/text.texi (Special Properties): Make the "tooltip" index entry more concrete. Change the cross-reference to point to "Tooltips" in the ELisp manual. * doc/lispref/elisp.texi (Top): Update the master menu. * doc/emacs/frames.texi (Tooltips): Include more customization variables. Add a cross-reference to the ELisp manual.
-rw-r--r--doc/emacs/frames.texi50
-rw-r--r--doc/lispref/display.texi76
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/text.texi5
4 files changed, 119 insertions, 13 deletions
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 35b3f83ab33..383ae7fd6ee 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1152,11 +1152,11 @@ change the variable @code{x-gtk-file-dialog-help-text} to @code{nil}.
1152@section Tooltips 1152@section Tooltips
1153@cindex tooltips 1153@cindex tooltips
1154 1154
1155 @dfn{Tooltips} are small windows that display text information at 1155 @dfn{Tooltips} are small special frames that display text
1156the current mouse position. They activate when there is a pause in 1156information at the current mouse position. They activate when there
1157mouse movement over some significant piece of text in a window, or the 1157is a pause in mouse movement over some significant piece of text in a
1158mode line, or some other part of the Emacs frame such as a tool bar 1158window, or the mode line, or some other part of the Emacs frame such
1159button or menu item. 1159as a tool bar button or menu item.
1160 1160
1161@findex tooltip-mode 1161@findex tooltip-mode
1162 You can toggle the use of tooltips with the command @kbd{M-x 1162 You can toggle the use of tooltips with the command @kbd{M-x
@@ -1164,11 +1164,41 @@ tooltip-mode}. When Tooltip mode is disabled, the help text is
1164displayed in the echo area instead. To control the use of tooltips at 1164displayed in the echo area instead. To control the use of tooltips at
1165startup, customize the variable @code{tooltip-mode}. 1165startup, customize the variable @code{tooltip-mode}.
1166 1166
1167@vindex tooltip-delay 1167The following variables provide customization options for tooltip
1168 The variables @code{tooltip-delay} specifies how long Emacs should 1168display:
1169wait before displaying a tooltip. For additional customization 1169
1170options for displaying tooltips, use @kbd{M-x customize-group 1170@vtable @code
1171@key{RET} tooltip @key{RET}}. 1171@item tooltip-delay
1172This variable specifies how long Emacs should wait before displaying
1173the first tooltip. The value is in seconds.
1174
1175@item tooltip-short-delay
1176This variable specifies how long Emacs should wait before displaying
1177subsequent tooltips on different items, having already displayed the
1178first tooltip. The value is in seconds.
1179
1180@item tooltip-hide-delay
1181The number of seconds since displaying a tooltip to hide it, if the
1182mouse doesn't move.
1183
1184@item tooltip-x-offset
1185@itemx tooltip-y-offset
1186The X and Y offsets, in pixels, of the left top corner of the tooltip
1187from the mouse pointer position. Note that these are ignored if
1188@code{tooltip-frame-parameters} was customized to include,
1189respectively, the @code{left} and @code{top} parameters. The values
1190of the offsets should be chosen so that the tooltip doesn't cover the
1191mouse pointer's hot spot, or it might interfere with clicking the
1192mouse.
1193
1194@item tooltip-frame-parameters
1195The frame parameters used for displaying tooltips. @xref{Frame
1196Parameters,,, elisp, The Emacs Lisp Reference Manual}, and also
1197@ref{Tooltips,,, elisp, The Emacs Lisp Reference Manual}.
1198@end vtable
1199
1200For additional customization options for displaying tooltips, use
1201@kbd{M-x customize-group @key{RET} tooltip @key{RET}}.
1172 1202
1173@vindex x-gtk-use-system-tooltips 1203@vindex x-gtk-use-system-tooltips
1174 If Emacs is built with GTK+ support, it displays tooltips via GTK+, 1204 If Emacs is built with GTK+ support, it displays tooltips via GTK+,
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 9ea9548582f..010dcb2fd1f 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -34,6 +34,7 @@ that Emacs presents to the user.
34* Character Display:: How Emacs displays individual characters. 34* Character Display:: How Emacs displays individual characters.
35* Beeping:: Audible signal to the user. 35* Beeping:: Audible signal to the user.
36* Window Systems:: Which window system is being used. 36* Window Systems:: Which window system is being used.
37* Tooltips:: Tooltip display in Emacs.
37* Bidirectional Display:: Display of bidirectional scripts, such as 38* Bidirectional Display:: Display of bidirectional scripts, such as
38 Arabic and Farsi. 39 Arabic and Farsi.
39@end menu 40@end menu
@@ -6968,6 +6969,81 @@ indicator of Emacs capabilities on a given display type. Instead, use
6968@code{display-graphic-p} or any of the other @code{display-*-p} 6969@code{display-graphic-p} or any of the other @code{display-*-p}
6969predicates described in @ref{Display Feature Testing}. 6970predicates described in @ref{Display Feature Testing}.
6970 6971
6972@node Tooltips
6973@section Tooltips
6974@cindex tooltips
6975@dfn{Tooltips} are special frames (@pxref{Frames}) that are used to
6976display helpful hints (a.k.a.@: ``tips'') related to the current
6977position of the mouse pointer. Emacs uses tooltips to display help
6978strings about active portions of text (@pxref{Special Properties}) and
6979about various UI elements, such as menu items (@pxref{Extended Menu
6980Items}) and tool-bar buttons (@pxref{Tool Bar}).
6981
6982@defun tooltip-mode
6983Tooltip Mode is a minor mode that enables display of tooltips.
6984Turning off this mode causes the tooltips be displayed in the echo
6985area. On text-mode (a.k.a.@: ``TTY'') frames, tooltips are always
6986displayed in the echo area.
6987@end defun
6988
6989@vindex x-gtk-use-system-tooltips
6990When Emacs is built with GTK+ support, it by default displays tooltips
6991using GTK+ functions, and the appearance of the tooltips is then
6992controlled by GTK+ settings. GTK+ tooltips can be disabled by
6993changing the value of the variable @code{x-gtk-use-system-tooltips} to
6994@code{nil}. The rest of this subsection describes how to control
6995non-GTK+ tooltips, which are presented by Emacs itself.
6996
6997Since tooltips are special frames, they have their frame parameters
6998(@pxref{Frame Parameters}). Unlike other frames, the frame parameters
6999for tooltips are stored in a special variable.
7000
7001@defvar tooltip-frame-parameters
7002This customizable option holds the frame parameters used for
7003displaying tooltips. Any font and color parameters are ignored, and
7004the corresponding attributes of the @code{tooltip} face are used
7005instead. If @code{left} or @code{top} parameters are included, they
7006are used as absolute frame-relative coordinates where the tooltip
7007should be shown. (Mouse-relative position of the tooltip can be
7008customized using the variables described in @ref{Tooltips,,, emacs,
7009The GNU Emacs Manual}.) Note that the @code{left} and @code{top}
7010parameters, if present, override the values of mouse-relative offsets.
7011@end defvar
7012
7013@vindex tooltip@r{ face}
7014The @code{tooltip} face determines the appearance of text shown in
7015tooltips. It should generally use a variable-pitch font of size that
7016is preferably smaller than the default frame font.
7017
7018@findex tooltip-help-tips
7019@defvar tooltip-functions
7020This abnormal hook is a list of functions to call when Emacs needs to
7021display a tooltip. Each function is called with a single argument
7022@var{event} which is a copy of the last mouse movement event. If a
7023function on this list actually displays the tooltip, it should return
7024non-@code{nil}, and then the rest of the functions will not be
7025called. The default value of this variable is a single function
7026@code{tooltip-help-tips}.
7027@end defvar
7028
7029If you write your own function to be put on the
7030@code{tooltip-functions} list, you may need to know the buffer of the
7031mouse event that triggered the tooltip display. The following
7032function provides that information.
7033
7034@defun tooltip-event-buffer event
7035This function returns the buffer over which @var{event} occurred.
7036Call it with the argument of the function from
7037@code{tooltip-functions} to obtain the buffer whose text triggered the
7038tooltip. Note that the event might occur not over a buffer (e.g.,
7039over the tool bar), in which case this function will return
7040@code{nil}.
7041@end defun
7042
7043Other aspects of tooltip display are controlled by several
7044customizable settings; see @ref{Tooltips,,, emacs, The GNU Emacs
7045Manual}.
7046
6971@node Bidirectional Display 7047@node Bidirectional Display
6972@section Bidirectional Display 7048@section Bidirectional Display
6973@cindex bidirectional display 7049@cindex bidirectional display
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 4c1541e98c6..a3bff0b07ac 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1380,6 +1380,7 @@ Emacs Display
1380* Character Display:: How Emacs displays individual characters. 1380* Character Display:: How Emacs displays individual characters.
1381* Beeping:: Audible signal to the user. 1381* Beeping:: Audible signal to the user.
1382* Window Systems:: Which window system is being used. 1382* Window Systems:: Which window system is being used.
1383* Tooltips:: Tooltip display in Emacs.
1383* Bidirectional Display:: Display of bidirectional scripts, such as 1384* Bidirectional Display:: Display of bidirectional scripts, such as
1384 Arabic and Farsi. 1385 Arabic and Farsi.
1385 1386
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 37492929e74..1ad665f0e5b 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3202,12 +3202,11 @@ or shorter, higher or lower, wider or narrow, or replaced with an image.
3202 3202
3203@item help-echo 3203@item help-echo
3204@kindex help-echo @r{(text property)} 3204@kindex help-echo @r{(text property)}
3205@cindex tooltip 3205@cindex tooltip for help strings
3206@anchor{Text help-echo} 3206@anchor{Text help-echo}
3207If text has a string as its @code{help-echo} property, then when you 3207If text has a string as its @code{help-echo} property, then when you
3208move the mouse onto that text, Emacs displays that string in the echo 3208move the mouse onto that text, Emacs displays that string in the echo
3209area, or in the tooltip window (@pxref{Tooltips,,, emacs, The GNU Emacs 3209area, or in the tooltip window (@pxref{Tooltips}).
3210Manual}).
3211 3210
3212If the value of the @code{help-echo} property is a function, that 3211If the value of the @code{help-echo} property is a function, that
3213function is called with three arguments, @var{window}, @var{object} and 3212function is called with three arguments, @var{window}, @var{object} and