diff options
| author | Eli Zaretskii | 2016-04-09 12:30:59 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-04-09 12:30:59 +0300 |
| commit | e87fbc07801a4ac291d335f0af957ca32cd26381 (patch) | |
| tree | ee860dec60f8b944ae6be93ab71c5e74df166131 /doc/lispref | |
| parent | 9f1786e4165aba30ddb16116c5557a0531233008 (diff) | |
| download | emacs-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.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/display.texi | 76 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 5 |
3 files changed, 79 insertions, 3 deletions
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} |
| 6969 | predicates described in @ref{Display Feature Testing}. | 6970 | predicates 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 | ||
| 6976 | display helpful hints (a.k.a.@: ``tips'') related to the current | ||
| 6977 | position of the mouse pointer. Emacs uses tooltips to display help | ||
| 6978 | strings about active portions of text (@pxref{Special Properties}) and | ||
| 6979 | about various UI elements, such as menu items (@pxref{Extended Menu | ||
| 6980 | Items}) and tool-bar buttons (@pxref{Tool Bar}). | ||
| 6981 | |||
| 6982 | @defun tooltip-mode | ||
| 6983 | Tooltip Mode is a minor mode that enables display of tooltips. | ||
| 6984 | Turning off this mode causes the tooltips be displayed in the echo | ||
| 6985 | area. On text-mode (a.k.a.@: ``TTY'') frames, tooltips are always | ||
| 6986 | displayed in the echo area. | ||
| 6987 | @end defun | ||
| 6988 | |||
| 6989 | @vindex x-gtk-use-system-tooltips | ||
| 6990 | When Emacs is built with GTK+ support, it by default displays tooltips | ||
| 6991 | using GTK+ functions, and the appearance of the tooltips is then | ||
| 6992 | controlled by GTK+ settings. GTK+ tooltips can be disabled by | ||
| 6993 | changing the value of the variable @code{x-gtk-use-system-tooltips} to | ||
| 6994 | @code{nil}. The rest of this subsection describes how to control | ||
| 6995 | non-GTK+ tooltips, which are presented by Emacs itself. | ||
| 6996 | |||
| 6997 | Since tooltips are special frames, they have their frame parameters | ||
| 6998 | (@pxref{Frame Parameters}). Unlike other frames, the frame parameters | ||
| 6999 | for tooltips are stored in a special variable. | ||
| 7000 | |||
| 7001 | @defvar tooltip-frame-parameters | ||
| 7002 | This customizable option holds the frame parameters used for | ||
| 7003 | displaying tooltips. Any font and color parameters are ignored, and | ||
| 7004 | the corresponding attributes of the @code{tooltip} face are used | ||
| 7005 | instead. If @code{left} or @code{top} parameters are included, they | ||
| 7006 | are used as absolute frame-relative coordinates where the tooltip | ||
| 7007 | should be shown. (Mouse-relative position of the tooltip can be | ||
| 7008 | customized using the variables described in @ref{Tooltips,,, emacs, | ||
| 7009 | The GNU Emacs Manual}.) Note that the @code{left} and @code{top} | ||
| 7010 | parameters, if present, override the values of mouse-relative offsets. | ||
| 7011 | @end defvar | ||
| 7012 | |||
| 7013 | @vindex tooltip@r{ face} | ||
| 7014 | The @code{tooltip} face determines the appearance of text shown in | ||
| 7015 | tooltips. It should generally use a variable-pitch font of size that | ||
| 7016 | is preferably smaller than the default frame font. | ||
| 7017 | |||
| 7018 | @findex tooltip-help-tips | ||
| 7019 | @defvar tooltip-functions | ||
| 7020 | This abnormal hook is a list of functions to call when Emacs needs to | ||
| 7021 | display 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 | ||
| 7023 | function on this list actually displays the tooltip, it should return | ||
| 7024 | non-@code{nil}, and then the rest of the functions will not be | ||
| 7025 | called. The default value of this variable is a single function | ||
| 7026 | @code{tooltip-help-tips}. | ||
| 7027 | @end defvar | ||
| 7028 | |||
| 7029 | If you write your own function to be put on the | ||
| 7030 | @code{tooltip-functions} list, you may need to know the buffer of the | ||
| 7031 | mouse event that triggered the tooltip display. The following | ||
| 7032 | function provides that information. | ||
| 7033 | |||
| 7034 | @defun tooltip-event-buffer event | ||
| 7035 | This function returns the buffer over which @var{event} occurred. | ||
| 7036 | Call it with the argument of the function from | ||
| 7037 | @code{tooltip-functions} to obtain the buffer whose text triggered the | ||
| 7038 | tooltip. Note that the event might occur not over a buffer (e.g., | ||
| 7039 | over the tool bar), in which case this function will return | ||
| 7040 | @code{nil}. | ||
| 7041 | @end defun | ||
| 7042 | |||
| 7043 | Other aspects of tooltip display are controlled by several | ||
| 7044 | customizable settings; see @ref{Tooltips,,, emacs, The GNU Emacs | ||
| 7045 | Manual}. | ||
| 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} |
| 3207 | If text has a string as its @code{help-echo} property, then when you | 3207 | If text has a string as its @code{help-echo} property, then when you |
| 3208 | move the mouse onto that text, Emacs displays that string in the echo | 3208 | move the mouse onto that text, Emacs displays that string in the echo |
| 3209 | area, or in the tooltip window (@pxref{Tooltips,,, emacs, The GNU Emacs | 3209 | area, or in the tooltip window (@pxref{Tooltips}). |
| 3210 | Manual}). | ||
| 3211 | 3210 | ||
| 3212 | If the value of the @code{help-echo} property is a function, that | 3211 | If the value of the @code{help-echo} property is a function, that |
| 3213 | function is called with three arguments, @var{window}, @var{object} and | 3212 | function is called with three arguments, @var{window}, @var{object} and |