From 4ab7a22abe9230a6374dbf3d892148ad099a96a8 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 10 Nov 2021 18:13:22 +0800 Subject: [PATCH] Add `xwidget-webkit-isearch-yank-kill' * lisp/xwidget.el: Bind C-y to xwidget-webkit-yank-kill in incremental search. (xwidget-webkit-isearch-mode): Update doc string. (xwidget-webkit-yank-kill): New function. --- lisp/xwidget.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index cad464b5b24..cc149cf1978 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -947,6 +947,7 @@ With argument, add COUNT copies of CHAR." (define-key xwidget-webkit-isearch-mode-map "\C-g" 'xwidget-webkit-isearch-exit) (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 "\C-y" 'xwidget-webkit-isearch-yank-kill) (define-key xwidget-webkit-isearch-mode-map "\t" 'xwidget-webkit-isearch-printing-char) (let ((meta-map (make-keymap))) @@ -968,6 +969,9 @@ To navigate around the search results, type \\\\[xwidget-webkit-isearch-forward] to move forward, and \\\\[xwidget-webkit-isearch-backward] to move backward. +To insert the string at the front of the kill ring into the +search query, type \\\\[xwidget-webkit-isearch-yank-kill]. + Press \\\\[xwidget-webkit-isearch-exit] to exit incremental search." :keymap xwidget-webkit-isearch-mode-map (if xwidget-webkit-isearch-mode @@ -977,6 +981,15 @@ Press \\\\[xwidget-webkit-isearch-exit] to exit (xwidget-webkit-isearch--update)) (xwidget-webkit-finish-search (xwidget-webkit-current-session)))) +(defun xwidget-webkit-isearch-yank-kill () + "Pull string from kill ring and append it to the current query." + (interactive) + (unless xwidget-webkit-isearch-mode + (xwidget-webkit-isearch-mode t)) + (setq xwidget-webkit-isearch--string + (concat xwidget-webkit-isearch--string + (current-kill 0))) + (xwidget-webkit-isearch--update)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar xwidget-view-list) ; xwidget.c