Rename system tooltip variables to `use-system-tooltips'

* doc/emacs/frames.texi (Tooltips):
* doc/emacs/haiku.texi (Haiku Basics):
* doc/lispref/display.texi (Tooltips): Document
`use-system-tooltips' instead.

* etc/NEWS: Announce new option.
* lisp/cus-start.el (standard): Add new option.

* lisp/term/haiku-win.el (haiku-use-system-tooltips):
* lisp/term/pgtk-win.el (x-gtk-use-system-tooltips):
* lisp/term/x-win.el (x-gtk-use-system-tooltips): Add aliases
for old options.

* src/frame.c (syms_of_frame): New variable
`use-system-tooltips'.

* src/haikufns.c (Fx_show_tip):
(syms_of_haikufns):
* src/pgtkfns.c (x_hide_tip):
(Fx_show_tip):
(syms_of_pgtkfns):
* src/xfns.c (x_hide_tip):
(Fx_show_tip):
(syms_of_xfns): Use `use-system-tooltips' instead of the old
platform dependent options.
This commit is contained in:
Po Lu 2022-01-19 13:12:18 +08:00
parent 90dda33108
commit 95084cec09
12 changed files with 55 additions and 53 deletions

View file

@ -1633,13 +1633,14 @@ Parameters,,, elisp, The Emacs Lisp Reference Manual}, and also
For additional customization options for displaying tooltips, use
@kbd{M-x customize-group @key{RET} tooltip @key{RET}}.
@vindex x-gtk-use-system-tooltips
If Emacs is built with GTK+ support, it displays tooltips via GTK+,
using the default appearance of GTK+ tooltips. To disable this,
change the variable @code{x-gtk-use-system-tooltips} to @code{nil}.
If you do this, or if Emacs is built without GTK+ support, most
attributes of the tooltip text are specified by the @code{tooltip}
face, and by X resources (@pxref{X Resources}).
@vindex use-system-tooltips
If Emacs is built with the GTK+ toolkit or Haiku windowing support,
it displays tooltips via the toolkit, using the default appearance of
the toolkit's tooltips. To disable this, change the variable
@code{use-system-tooltips} to @code{nil}. If you do this, or if Emacs
is built without GTK+ or Haiku windowing support, most attributes of
the tooltip text are specified by the @code{tooltip} face, and by X
resources (@pxref{X Resources}).
@dfn{GUD tooltips} are special tooltips that show the values of
variables when debugging a program with GUD@. @xref{Debugger

View file

@ -85,15 +85,15 @@ instead.
@cindex tooltips (haiku)
@cindex haiku tooltips
@vindex haiku-use-system-tooltips
On Haiku, Emacs defaults to using the system tooltip mechanism.
This usually leads to more responsive tooltips, but the tooltips will
not be able to display text properties or faces. If you need those
features, customize the variable @code{haiku-use-system-tooltips} to
the nil value, and Emacs will use its own implementation of tooltips.
features, customize the variable @code{use-system-tooltips} to the
@code{nil} value, and Emacs will use its own implementation of
tooltips.
System tooltips cannot display above the menu bar, so help text
in the menu bar will display in the echo area instead when they are
System tooltips cannot display above the menu bar, so help text in
the menu bar will display in the echo area instead when they are
enabled.
@cindex X resources on Haiku

View file

@ -8438,13 +8438,14 @@ displayed in the echo area.
@end defun
@cindex system tooltips
@vindex x-gtk-use-system-tooltips
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} to
@code{nil}. The rest of this subsection describes how to control
non-GTK+ tooltips, which are presented by Emacs itself.
@vindex use-system-tooltips
When Emacs is built with the GTK+ toolkit or Haiku windowing support,
it by default displays tooltips using toolkit functions, and the
appearance of the tooltips is then controlled by by the toolkit's
settings. Toolkit-provided tooltips can be disabled by changing the
value of the variable @code{use-system-tooltips} to @code{nil}. The
rest of this subsection describes how to control non-toolkit tooltips,
which are presented by Emacs itself.
@cindex tooltip frames
Tooltips are displayed in special frames called tooltip frames, which

View file

@ -154,6 +154,11 @@ methods.
This controls whether or not GTK input methods are used by Emacs,
instead of XIM input methods.
+++
** New user option 'use-system-tooltips'.
This controls whether or not to use the toolkit Emacs was built with
to display tooltips, if supported.
---
** New minor mode 'pixel-scroll-precision-mode'.
When enabled, and if your mouse supports it, you can scroll the

View file

@ -356,6 +356,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(const :tag "Iconify" t))
"26.1")
(tooltip-reuse-hidden-frame tooltip boolean "26.1")
(use-system-tooltips tooltip boolean "29.1")
;; fringe.c
(overflow-newline-into-fringe fringe boolean)
;; image.c

View file

@ -136,6 +136,8 @@ If TYPE is nil, return \"text/plain\"."
(define-key special-event-map [drag-n-drop]
'haiku-dnd-handle-drag-n-drop-event)
(defvaralias 'haiku-use-system-tooltips 'use-system-tooltips)
(provide 'haiku-win)
(provide 'term/haiku-win)

View file

@ -510,6 +510,8 @@ This uses `icon-map-list' to map icon file names to stock icon names."
(t
(popup-menu (mouse-menu-bar-map) last-nonmenu-event))))
(defvaralias 'x-gtk-use-system-tooltips 'use-system-tooltips)
(provide 'pgtk-win)
(provide 'term/pgtk-win)

View file

@ -1561,6 +1561,8 @@ EVENT is a preedit-text event."
(define-key special-event-map [preedit-text] 'x-preedit-text)
(defvaralias 'x-gtk-use-system-tooltips 'use-system-tooltips)
(provide 'x-win)
(provide 'term/x-win)

View file

@ -6472,6 +6472,14 @@ This variable is effective only with the X toolkit (and there only when
Gtk+ tooltips are not used) and on Windows. */);
tooltip_reuse_hidden_frame = false;
DEFVAR_BOOL ("use-system-tooltips", use_system_tooltips,
doc: /* Use the toolkit to display tooltips.
This option is only meaningful when Emacs is built with GTK+ or Haiku
windowing support, and results in tooltips that look like those
displayed by other GTK+ or Haiku programs, but will not be able to
display text properties inside tooltip text. */);
use_system_tooltips = true;
DEFVAR_LISP ("iconify-child-frame", iconify_child_frame,
doc: /* How to handle iconification of child frames.
This variable tells Emacs how to proceed when it is asked to iconify a

View file

@ -1946,7 +1946,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
else
CHECK_FIXNUM (dy);
if (haiku_use_system_tooltips)
if (use_system_tooltips)
{
int root_x, root_y;
CHECK_STRING (string);
@ -2672,14 +2672,6 @@ syms_of_haikufns (void)
doc: /* SKIP: real doc in xfns.c. */);
Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40));
DEFVAR_BOOL ("haiku-use-system-tooltips", haiku_use_system_tooltips,
doc: /* When non-nil, Emacs will display tooltips using the App Kit.
This can avoid a great deal of consing that does not play
well with the Haiku memory allocator, but comes with the
disadvantage of not being able to use special display properties
within tooltips. */);
haiku_use_system_tooltips = 1;
#ifdef USE_BE_CAIRO
DEFVAR_LISP ("cairo-version-string", Vcairo_version_string,
doc: /* Version info for cairo. */);

View file

@ -3128,7 +3128,7 @@ x_hide_tip (bool delete)
value of x_gtk_use_system_tooltips might not be the same as used
for the tooltip we have to hide, see Bug#30399. */
if ((NILP (tip_last_frame) && NILP (tip_frame))
|| (!x_gtk_use_system_tooltips
|| (!use_system_tooltips
&& !delete
&& FRAMEP (tip_frame)
&& FRAME_LIVE_P (XFRAME (tip_frame))
@ -3161,7 +3161,7 @@ x_hide_tip (bool delete)
/* When using GTK+ system tooltips (compare Bug#41200) reset
tip_last_frame. It will be reassigned when showing the next
GTK+ system tooltip. */
if (x_gtk_use_system_tooltips)
if (use_system_tooltips)
tip_last_frame = Qnil;
/* Now look whether there's an Emacs tip around. */
@ -3171,7 +3171,7 @@ x_hide_tip (bool delete)
if (FRAME_LIVE_P (f))
{
if (delete || x_gtk_use_system_tooltips)
if (delete || use_system_tooltips)
{
/* Delete the Emacs tooltip frame when DELETE is true
or we change the tooltip type from an Emacs one to
@ -3267,7 +3267,7 @@ Text larger than the specified size is clipped. */)
else
CHECK_FIXNUM (dy);
if (x_gtk_use_system_tooltips)
if (use_system_tooltips)
{
bool ok;
@ -4068,12 +4068,6 @@ If more space for files in the file chooser dialog is wanted, set this to nil
to turn the additional text off. */);
x_gtk_file_dialog_help_text = true;
DEFVAR_BOOL ("x-gtk-use-system-tooltips", x_gtk_use_system_tooltips,
doc: /* If non-nil with a Gtk+ built Emacs, the Gtk+ tooltip is used.
Otherwise use Emacs own tooltip implementation.
When using Gtk+ tooltips, the tooltip face is not used. */);
x_gtk_use_system_tooltips = true;
DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size,
doc: /* Maximum size for tooltips.
Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */);

View file

@ -7357,13 +7357,13 @@ x_hide_tip (bool delete)
}
#ifdef USE_GTK
/* Any GTK+ system tooltip can be found via the x_output structure of
tip_last_frame, provided that frame is still live. Any Emacs
tooltip is found via the tip_frame variable. Note that the current
value of x_gtk_use_system_tooltips might not be the same as used
for the tooltip we have to hide, see Bug#30399. */
/* Any GTK+ system tooltip can be found via the x_output structure
of tip_last_frame, provided that frame is still live. Any Emacs
tooltip is found via the tip_frame variable. Note that the
current value of use_system_tooltips might not be the same as
used for the tooltip we have to hide, see Bug#30399. */
if ((NILP (tip_last_frame) && NILP (tip_frame))
|| (!x_gtk_use_system_tooltips
|| (!use_system_tooltips
&& !delete
&& !NILP (tip_frame)
&& FRAME_LIVE_P (XFRAME (tip_frame))
@ -7396,7 +7396,7 @@ x_hide_tip (bool delete)
/* When using GTK+ system tooltips (compare Bug#41200) reset
tip_last_frame. It will be reassigned when showing the next
GTK+ system tooltip. */
if (x_gtk_use_system_tooltips)
if (use_system_tooltips)
tip_last_frame = Qnil;
/* Now look whether there's an Emacs tip around. */
@ -7406,7 +7406,7 @@ x_hide_tip (bool delete)
if (FRAME_LIVE_P (f))
{
if (delete || x_gtk_use_system_tooltips)
if (delete || use_system_tooltips)
{
/* Delete the Emacs tooltip frame when DELETE is true
or we change the tooltip type from an Emacs one to
@ -7565,7 +7565,7 @@ Text larger than the specified size is clipped. */)
CHECK_FIXNUM (dy);
#ifdef USE_GTK
if (x_gtk_use_system_tooltips)
if (use_system_tooltips)
{
bool ok;
@ -8647,12 +8647,6 @@ If more space for files in the file chooser dialog is wanted, set this to nil
to turn the additional text off. */);
x_gtk_file_dialog_help_text = true;
DEFVAR_BOOL ("x-gtk-use-system-tooltips", x_gtk_use_system_tooltips,
doc: /* If non-nil with a Gtk+ built Emacs, the Gtk+ tooltip is used.
Otherwise use Emacs own tooltip implementation.
When using Gtk+ tooltips, the tooltip face is not used. */);
x_gtk_use_system_tooltips = true;
DEFVAR_LISP ("x-gtk-resize-child-frames", x_gtk_resize_child_frames,
doc: /* If non-nil, resize child frames specially with GTK builds.
If this is nil, resize child frames like any other frames. This is the