Many thanks, Vinh. That was exactly what I was looking for. (I adapted it to
automatically use a new buffer, and bound them to M-y / M-Y instead.)



On 3 January 2011 20:29, Vinh Nguyen <[email protected]> wrote:

> Benjamin,
>
> This has already been discussed (watch out my email create line breaks):
>
> // http://www.mozdev.org/pipermail/conkeror/2009-February/001334.html
> // select text and google it.  See also "**c" for selecting text
> interactive("search-clipboard-contents", "Search in Google the content
> of the X clipboard (the selected text)",
>               "find-url",
>               $browser_object=
>               function(I) {
>                   return "g "+ read_from_x_primary_selection();
>               }
> );
> interactive("search-clipboard-contents-doublequoted", "Search in
> Google the content of the X clipboard (the selected text) as a fixed
> string",
>               "find-url",
>               $browser_object=
>               function(I) {
>                   return "g \""+ read_from_x_primary_selection()+"\"";
>               }
>
> );
> define_key(content_buffer_normal_keymap, "l", "search-clipboard-contents");
> define_key(content_buffer_normal_keymap, "L",
> "search-clipboard-contents-doublequoted");
>
>
> Now try "l" and "C-u l" with your copied text.
>
> -- Vinh
>
>
>
> On Mon, Jan 3, 2011 at 6:23 PM, Benjamin Slade <[email protected]> wrote:
> > I'm trying to write a command similar to the 'paste-url' command (open
> > clipboard/selection in new buffer), but which searches for the text in
> the
> > selection/clipboard instead.
> >
> > I tried two things:
> >
> > (1) // use M-y to google current selection in new buffer
> > interactive("search-for-selection", "search for selection in new buffer",
> >                      $browser_object = 'google '+browser_object_paste_url
> >        );
> > define_key(default_global_keymap, "M-y", "search-for-selection");
> >
> > (2) // use M-y to google current selection in new buffer
> > interactive("search-for-selection", "search for selection in new buffer",
> >             function (I) {
> >                  let searchsel = "google ";
> >                  searchsel.append = browser_object_paste_url;
> >                  $browser_object = searchsel;
> >         });
> > define_key(default_global_keymap, "M-y", "search-for-selection");
> >
> > But neither seems to work. Any suggestions?
> >
> >
> -----------------------------------------------------------------------------------------------------
> > Benjamin Slade
> > Dept. of Linguistics
> > University of Illinois at Urbana-Champaign
> > [ http://www.jnanam.net/slade/ ]
> >
> > Stæfcræft & Vyākaraṇa (lingblog) - http://staefcraeft.blogspot.com
> > The Babbage Files (techblog) - http://babbagefiles.blogspot.com
> >
> >
> -----------------------------------------------------------------------------------------------------
> >   परो ऽक्ष॑कामा हि देवाः
> >     'The gods love the obscure.' (Śatapathabrāmaṇa 6.1.1.2)
> >
> > _______________________________________________
> > Conkeror mailing list
> > [email protected]
> > https://www.mozdev.org/mailman/listinfo/conkeror
> >
> >
>



-- 
-----------------------------------------------------------------------------------------------------
Benjamin Slade
Dept. of Linguistics
University of Illinois at Urbana-Champaign
[ http://www.jnanam.net/slade/ ]

Stæfcræft & Vyākaraṇa (lingblog) - http://staefcraeft.blogspot.com
The Babbage Files (techblog) - http://babbagefiles.blogspot.com

-----------------------------------------------------------------------------------------------------
  *प*रो ऽक्ष॑का*मा* हि *दे*वाः
    'The gods love the obscure.' (Śatapathabrāmaṇa 6.1.1.2)
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to