aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/xwidget.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index d7ef44d389f..dc31b850552 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -504,15 +504,17 @@ DEFAULT is the default return value."
504 title)) 504 title))
505 505
506;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 506;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
507(defun xwidget-webkit-get-selection () 507(defun xwidget-webkit-get-selection (proc)
508 "Get the webkit selection." 508 "Get the webkit selection and pass it to PROC."
509 (xwidget-webkit-execute-script-rv (xwidget-webkit-current-session) 509 (xwidget-webkit-execute-script
510 "window.getSelection().toString();")) 510 (xwidget-webkit-current-session)
511 "window.getSelection().toString();"
512 proc))
511 513
512(defun xwidget-webkit-copy-selection-as-kill () 514(defun xwidget-webkit-copy-selection-as-kill ()
513 "Get the webkit selection and put it on the kill-ring." 515 "Get the webkit selection and put it on the kill-ring."
514 (interactive) 516 (interactive)
515 (kill-new (xwidget-webkit-get-selection))) 517 (xwidget-webkit-get-selection (lambda (selection) (kill-new selection))))
516 518
517 519
518;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 520;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;