From: Po Lu Date: Sat, 6 Nov 2021 10:27:48 +0000 (+0800) Subject: Add xwidget-webkit-isearch to the menu bar and tool bar X-Git-Tag: emacs-29.0.90~3671^2~125 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1a84537f7938afcd155ee5e9efc104fc8f027e0f;p=emacs.git Add xwidget-webkit-isearch to the menu bar and tool bar * lisp/xwidget.el: Add isearch to tool bar and menu bar. (xwidget-webkit-mode-map) (xwidget-webkit-isearch-mode-map): Reorder key definitions so the equivalent key shows up as `C-s' in the menu bar. --- diff --git a/lisp/xwidget.el b/lisp/xwidget.el index a04da3ea861..bd3c0876f59 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -150,8 +150,8 @@ in `split-window-right' with a new xwidget webkit session." (define-key map "+" 'xwidget-webkit-zoom-in) (define-key map "-" 'xwidget-webkit-zoom-out) (define-key map "e" 'xwidget-webkit-edit-mode) - (define-key map "\C-s" 'xwidget-webkit-isearch-mode) (define-key map "\C-r" 'xwidget-webkit-isearch-mode) + (define-key map "\C-s" 'xwidget-webkit-isearch-mode) ;;similar to image mode bindings (define-key map (kbd "SPC") 'xwidget-webkit-scroll-up) @@ -198,7 +198,10 @@ in `split-window-right' with a new xwidget webkit session." :help "Send self inserting characters to the WebKit widget"] ["Save Selection" xwidget-webkit-copy-selection-as-kill :active t - :help "Save the browser's selection in the kill ring"])) + :help "Save the browser's selection in the kill ring"] + ["Incremental Search" xwidget-webkit-isearch-mode + :active (not xwidget-webkit-isearch-mode) + :help "Perform incremental search inside the WebKit widget"])) (defvar xwidget-webkit-tool-bar-map (let ((map (make-sparse-keymap))) @@ -226,6 +229,10 @@ in `split-window-right' with a new xwidget webkit session." (tool-bar-local-item-from-menu 'xwidget-webkit-browse-url "connect-to-url" map + xwidget-webkit-mode-map) + (tool-bar-local-item-from-menu 'xwidget-webkit-isearch-mode + "search" + map xwidget-webkit-mode-map)))) (defun xwidget-webkit-zoom-in () @@ -873,8 +880,8 @@ With argument, add COUNT copies of CHAR." (define-key xwidget-webkit-isearch-mode-map [return] 'xwidget-webkit-isearch-exit) (define-key xwidget-webkit-isearch-mode-map "\r" 'xwidget-webkit-isearch-exit) (define-key xwidget-webkit-isearch-mode-map "\C-g" 'xwidget-webkit-isearch-exit) -(define-key xwidget-webkit-isearch-mode-map "\C-s" 'xwidget-webkit-isearch-forward) (define-key xwidget-webkit-isearch-mode-map "\C-r" 'xwidget-webkit-isearch-backward) +(define-key xwidget-webkit-isearch-mode-map "\C-s" 'xwidget-webkit-isearch-forward) (define-key xwidget-webkit-isearch-mode-map "\t" 'xwidget-webkit-isearch-printing-char) (let ((meta-map (make-keymap)))