diff options
-rw-r--r-- | lisp/net/dictionary.el | 8 |
1 files changed, 5 insertions, 3 deletions
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 |