]> git.eshelyaron.com Git - emacs.git/commit
Fix 'dictionary-tooltip-mode'
authorEli Zaretskii <eliz@gnu.org>
Fri, 10 May 2024 12:56:30 +0000 (15:56 +0300)
committerEshel Yaron <me@eshelyaron.com>
Fri, 10 May 2024 14:06:56 +0000 (16:06 +0200)
commitcb724683f0038e6bcf6d086196e6739f7dc97987
treea87311b45abf8d252240f62e9fd141dcf0ad2ed1
parentfde6c1fce7940df6b0664fe3f4d99a33b6f1337f
Fix 'dictionary-tooltip-mode'

* lisp/tooltip.el (tooltip-event-buffer): Make sure 'posn-window'
returns a window before calling 'window-buffer'.

* lisp/net/dictionary.el (dictionary-default-dictionary)
(dictionary-tooltip-dictionary): Doc fixes.
(dictionary-tooltip-dictionary): Change default value to t, which
means the same dictionary as 'dictionary-default-dictionary'.
(dictionary-do-search): If NOMATCHING is non-nil, do not insert
anything into the current buffer, as that is unexpected when
showing definitions in tooltips.
(dictionary-word-at-mouse-event): Be defensive about the values
returned by 'tooltip-event-buffer' and 'posn-point': they can be
unexpected when the mouse pointer is on the tool bar or mode line
etc.
(dictionary-display-tooltip): Ignore errors in this function.
(dictionary-tooltip-mode): Ignore mouse-movement events on tool
bar and tab-bar.
(dictionary-dictionaries): Decode the server response to present
dictionaries in human-readable form.  Document in the doc string
the format of the return value.

(cherry picked from commit 3129fed4bec1137b7bb377594766b61ee76cd268)
lisp/net/dictionary.el
lisp/tooltip.el