diff options
Diffstat (limited to 'devdocs/elisp/tooltips.html')
| -rw-r--r-- | devdocs/elisp/tooltips.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/devdocs/elisp/tooltips.html b/devdocs/elisp/tooltips.html new file mode 100644 index 00000000..ca72ef5d --- /dev/null +++ b/devdocs/elisp/tooltips.html @@ -0,0 +1,14 @@ + <h3 class="section">Tooltips</h3> <p><em>Tooltips</em> are special frames (see <a href="frames">Frames</a>) that are used to display helpful hints (a.k.a. “tips”) related to the current position of the mouse pointer. Emacs uses tooltips to display help strings about active portions of text (see <a href="special-properties">Special Properties</a>) and about various UI elements, such as menu items (see <a href="extended-menu-items">Extended Menu Items</a>) and tool-bar buttons (see <a href="tool-bar">Tool Bar</a>). </p> <dl> <dt id="tooltip-mode">Function: <strong>tooltip-mode</strong> +</dt> <dd><p>Tooltip Mode is a minor mode that enables display of tooltips. Turning off this mode causes the tooltips be displayed in the echo area. On text-mode (a.k.a. “TTY”) frames, tooltips are always displayed in the echo area. </p></dd> +</dl> <p>When Emacs is built with GTK+ support, it by default displays tooltips using GTK+ functions, and the appearance of the tooltips is then controlled by GTK+ settings. GTK+ tooltips can be disabled by changing the value of the variable <code>x-gtk-use-system-tooltips</code> to <code>nil</code>. The rest of this subsection describes how to control non-GTK+ tooltips, which are presented by Emacs itself. </p> <p>Tooltips are displayed in special frames called tooltip frames, which have their own frame parameters (see <a href="frame-parameters">Frame Parameters</a>). Unlike other frames, the default parameters for tooltip frames are stored in a special variable. </p> <dl> <dt id="tooltip-frame-parameters">User Option: <strong>tooltip-frame-parameters</strong> +</dt> <dd><p>This customizable option holds the default frame parameters used for displaying tooltips. Any font and color parameters are ignored, and the corresponding attributes of the <code>tooltip</code> face are used instead. If <code>left</code> or <code>top</code> parameters are included, they are used as absolute frame-relative coordinates where the tooltip should be shown. (Mouse-relative position of the tooltip can be customized using the variables described in <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Tooltips.html#Tooltips">Tooltips</a> in <cite>The GNU Emacs Manual</cite>.) Note that the <code>left</code> and <code>top</code> parameters, if present, override the values of mouse-relative offsets. </p></dd> +</dl> <p>The <code>tooltip</code> face determines the appearance of text shown in tooltips. It should generally use a variable-pitch font of size that is preferably smaller than the default frame font. </p> <dl> <dt id="tooltip-functions">Variable: <strong>tooltip-functions</strong> +</dt> <dd><p>This abnormal hook is a list of functions to call when Emacs needs to display a tooltip. Each function is called with a single argument <var>event</var> which is a copy of the last mouse movement event. If a function on this list actually displays the tooltip, it should return non-<code>nil</code>, and then the rest of the functions will not be called. The default value of this variable is a single function <code>tooltip-help-tips</code>. </p></dd> +</dl> <p>If you write your own function to be put on the <code>tooltip-functions</code> list, you may need to know the buffer of the mouse event that triggered the tooltip display. The following function provides that information. </p> <dl> <dt id="tooltip-event-buffer">Function: <strong>tooltip-event-buffer</strong> <em>event</em> +</dt> <dd><p>This function returns the buffer over which <var>event</var> occurred. Call it with the argument of the function from <code>tooltip-functions</code> to obtain the buffer whose text triggered the tooltip. Note that the event might occur not over a buffer (e.g., over the tool bar), in which case this function will return <code>nil</code>. </p></dd> +</dl> <p>Other aspects of tooltip display are controlled by several customizable settings; see <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Tooltips.html#Tooltips">Tooltips</a> in <cite>The GNU Emacs Manual</cite>. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Tooltips.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Tooltips.html</a> + </p> +</div> |
