From 5a694a50ffebfda715a5e23fe6b03015c4417613 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 25 Dec 2024 04:35:50 +0100 Subject: [PATCH] Improve dictionary-switch-tooltip-mode docstring * lisp/net/dictionary.el (dictionary-switch-tooltip-mode): Fix docstring and argument name. (cherry picked from commit 1e40be0ab830852ff5e2330c50f8b047d9ebe338) --- lisp/net/dictionary.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 6fa0bab2c2b..e66665a260f 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1449,16 +1449,15 @@ via `dictionary-dictionaries'." (setq dictionary-tooltip-mouse-event (copy-sequence event)) (tooltip-start-delayed-tip))) -(defun dictionary-switch-tooltip-mode (on) - "Turn dictionary tooltip mode off or ON. - -It is normally internally called with 1 to enable support for the -tooltip mode. The hook function will check the value of the -variable `dictionary-tooltip-mode' to decide if some action must be -taken. When disabling the tooltip mode the value of this variable -will be set to nil." - (tooltip-mode on) - (if on +(defun dictionary-switch-tooltip-mode (state) + "Turn dictionary tooltip mode on or off depending on STATE. + +It is normally called internally with a non-nil value to enable the +tooltip mode. The hook function uses the value of the variable +`dictionary-tooltip-mode' to decide if some action must be taken. +When disabling the tooltip mode, that variable will be set to nil." + (tooltip-mode state) + (if state (add-hook 'tooltip-functions #'dictionary-display-tooltip) (remove-hook 'tooltip-functions #'dictionary-display-tooltip))) -- 2.39.5