diff options
author | Alan Mackenzie <acm@muc.de> | 2022-01-22 11:02:50 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2022-01-22 11:02:50 +0000 |
commit | 14d64a8adcc866deecd758b898e8ef2d836b354a (patch) | |
tree | 83cff9669e266f8e283ccb8cd7518e909240f1e1 /lisp/mouse.el | |
parent | bdd9b5b8a0d37dd09ee530c1dab3a44bee09e0f8 (diff) | |
parent | ebe334cdc234de2897263aed4c05ac7088c11857 (diff) | |
download | emacs-scratch/correct-warning-pos.tar.gz |
Merge branch 'master' into scratch/correct-warning-posscratch/correct-warning-pos
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 46dd0397d7f..502683d3d1e 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -298,9 +298,10 @@ and should return the same menu with changes such as added new menu items." (function-item context-menu-buffers) (function-item context-menu-vc) (function-item context-menu-ffap) - (function-item Man-context-menu) (function-item hi-lock-context-menu) - (function-item context-menu-online-search) + (function-item occur-context-menu) + (function-item Man-context-menu) + (function-item dictionary-context-menu) (function :tag "Custom function"))) :version "28.1") @@ -323,6 +324,8 @@ the function `context-menu-filter-function'." (fun (mouse-posn-property (event-start click) 'context-menu-function))) + (select-window (posn-window (event-start click))) + (if (functionp fun) (setq menu (funcall fun menu click)) (run-hook-wrapped 'context-menu-functions @@ -534,16 +537,6 @@ Some context functions add menu items below the separator." :help "Find file or URL from text around mouse click")))) menu) -(defun context-menu-online-search (menu click) - "Populate MENU with command to search online." - (save-excursion - (mouse-set-point click) - (define-key-after menu [online-search-separator] menu-bar-separator) - (define-key-after menu [online-search-at-mouse] - '(menu-item "Online search" mouse-online-search-at-point - :help "Search for region or word online"))) - menu) - (defvar context-menu-entry `(menu-item ,(purecopy "Context Menu") ,(make-sparse-keymap) :filter ,(lambda (_) (context-menu-map))) @@ -3230,26 +3223,6 @@ is copied instead of being cut." (with-current-buffer (window-buffer window) (setq cursor-type (nth 3 state))))))) -(defvar eww-search-prefix) -(defun mouse-online-search-at-point (event) - "Query an online search engine at EVENT. -If a region is active, the entire region will be sent, otherwise -the symbol at point will be used. This command uses EWW's -default search engine, as configured by `eww-search-prefix'." - (interactive "e") - (require 'eww) - (let ((query (if (use-region-p) - (buffer-substring (region-beginning) - (region-end)) - (save-excursion - (mouse-set-point event) - (thing-at-point 'symbol))))) - (unless query - (user-error "Nothing to search for")) - (browse-url (concat - eww-search-prefix - (mapconcat #'url-hexify-string (split-string query) "+"))))) - ;;; Bindings for mouse commands. |