I am a big fan of
query-selection-in-search-engine but am frustrated that it searches in the current buffer, while I usually want to search things before having finished my initial read. Therefore, I want the searches to be opened in new buffers. I am trying to define a custom function but haven’t been successful yet.
Below is the current state of what I tried, and the last line is broken. Any ideas what I am doing wrong?
(in-package #:nyxt-user) (in-package :nyxt) ;;search selected text in new buffer (define-command-global query-selection-in-search-engine-new-buffer () "Search selected text in a new buffer using the queried search engine." (let* ((selection (%copy)) (engine (first (prompt :prompt "Search engine (new buffer):" :sources (make-instance 'search-engine-source))))) (when engine (make-buffer-focus :url (make-instance 'new-url-query :query selection :engine engine)))))