From: Juri Linkov Date: Wed, 29 Sep 2021 07:19:22 +0000 (+0300) Subject: * lisp/net/dictionary.el (context-menu-dictionary): Add autoload cookie. X-Git-Tag: emacs-28.0.90~532 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=afee49fa0842f21ac008995a288be3f71c55800e;p=emacs.git * lisp/net/dictionary.el (context-menu-dictionary): Add autoload cookie. (context-menu-functions): Remove context-menu-dictionary from hook (bug#50552) --- diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 09d250fd7bf..86447c2c351 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1375,8 +1375,12 @@ any buffer where (dictionary-tooltip-mode 1) has been called." (current-word))))) (dictionary-search word))) +;;;###autoload (defun context-menu-dictionary (menu click) - "Populate MENU with dictionary commands at CLICK." + "Populate MENU with dictionary commands at CLICK. +When you add this function to `context-menu-functions', +the context menu will contain an item that searches +the word at mouse click." (when (thing-at-mouse click 'word) (define-key menu [dictionary-separator] menu-bar-separator) (define-key menu [dictionary-search-word-at-mouse] @@ -1384,7 +1388,5 @@ any buffer where (dictionary-tooltip-mode 1) has been called." :help "Search the word at mouse click in dictionary"))) menu) -(add-hook 'context-menu-functions 'context-menu-dictionary 15) - (provide 'dictionary) ;;; dictionary.el ends here