]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve dictionary-switch-tooltip-mode docstring
authorStefan Kangas <stefankangas@gmail.com>
Wed, 25 Dec 2024 03:35:50 +0000 (04:35 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 27 Dec 2024 15:33:07 +0000 (16:33 +0100)
* lisp/net/dictionary.el (dictionary-switch-tooltip-mode): Fix
docstring and argument name.

(cherry picked from commit 1e40be0ab830852ff5e2330c50f8b047d9ebe338)

lisp/net/dictionary.el

index 6fa0bab2c2b8eb409fe9cfc975cb19d7ebe69b8f..e66665a260fea7f09ce030b5b0156eb7af27d85c 100644 (file)
@@ -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)))