emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 86b6a69f86: Don't hard code the default x-show-tip timeout


From: Lars Ingebrigtsen
Subject: master 86b6a69f86: Don't hard code the default x-show-tip timeout
Date: Sat, 30 Apr 2022 11:11:23 -0400 (EDT)

branch: master
commit 86b6a69f8614663172c64a3f51ffce39526e7ca9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Don't hard code the default x-show-tip timeout
    
    * src/xfns.c (Fx_show_tip): Use it.
    (syms_of_xfns): Add a new x-show-tooltip-timeout variable
    (bug#23341).
---
 etc/NEWS   |  6 ++++++
 src/xfns.c | 11 +++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 1c943bfd64..eebde1b4d0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1529,6 +1529,12 @@ functions.
 
 * Lisp Changes in Emacs 29.1
 
+---
+** 'x-show-tip' no longer hard-codes a timeout default.
+The new 'x-show-tooltip-timeout' variable allows the user to alter
+this for packages that don't use 'tooltip-show', but instead calls the
+lower level function directly.
+
 +++
 ** New function 'window-max-characters-per-line'.
 
diff --git a/src/xfns.c b/src/xfns.c
index c7e2984ce1..24c3c26022 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -8292,7 +8292,7 @@ PARMS is an optional list of frame parameters which can 
be used to
 change the tooltip's appearance.
 
 Automatically hide the tooltip after TIMEOUT seconds.  TIMEOUT nil
-means use the default timeout of 5 seconds.
+means use the default timeout from the `x-show-tooltip-timeout'.
 
 If the list of frame parameters PARMS contains a `left' parameter,
 display the tooltip at that x-position.  If the list of frame parameters
@@ -8338,9 +8338,8 @@ Text larger than the specified size is clipped.  */)
   f = decode_window_system_frame (frame);
 
   if (NILP (timeout))
-    timeout = make_fixnum (5);
-  else
-    CHECK_FIXNAT (timeout);
+    timeout = Vx_show_tooltip_timeout;
+  CHECK_FIXNAT (timeout);
 
   if (NILP (dx))
     dx = make_fixnum (5);
@@ -9727,6 +9726,10 @@ eliminated in future versions of Emacs.  */);
   }
 #endif
 
+  DEFVAR_LISP ("x-show-tooltip-timeout", Vx_show_tooltip_timeout,
+             doc: /* The default timeout (in seconds) for `x-show-tip'.  */);
+  Vx_show_tooltip_timeout = make_fixnum (5);
+
   /* X window properties.  */
   defsubr (&Sx_change_window_property);
   defsubr (&Sx_delete_window_property);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]