From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: browse select text, text at point Date: Wed, 06 Jul 2011 19:35:00 +0200 Message-ID: <4E149CC4.5070604@easy-emacs.de> References: <86mxgrlhys.fsf@S0106001636ac5854.gv.shawcable.net> <4E146686.2010103@dogan.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1309979342 10797 80.91.229.12 (6 Jul 2011 19:09:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jul 2011 19:09:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 06 21:08:58 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QeXSy-0002IH-Fq for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jul 2011 21:08:56 +0200 Original-Received: from localhost ([::1]:39456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeXSx-00040D-4y for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jul 2011 15:08:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeW0N-00043U-QA for help-gnu-emacs@gnu.org; Wed, 06 Jul 2011 13:35:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QeW0L-0001Mv-Lw for help-gnu-emacs@gnu.org; Wed, 06 Jul 2011 13:35:19 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:56670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeW0L-0001Mh-4k for help-gnu-emacs@gnu.org; Wed, 06 Jul 2011 13:35:17 -0400 Original-Received: from [192.168.178.27] (brln-4d0c17ac.pool.mediaWays.net [77.12.23.172]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MDF52-1Qk1Fs3ypA-00HJtv; Wed, 06 Jul 2011 19:35:13 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11 In-Reply-To: <4E146686.2010103@dogan.se> X-Provags-ID: V02:K0:dMiOKHTzFfpfJaFTTxdYpU3ynQsvsZaXHzt1XJ4pBwt afmJcMZedRzAIkl/q8Vq/hLpz7qJ/Qzdi6A30fyKxezj5PrGkM y9Hi/fg7/eilkoGiQ7M2qJgzVH5RZffyGvoIZwnyO9CkW94AYi HmVikXzSrhoQYcUID0EIyLT6Uj/o4U/mFSU8gkzk2TAbQIsB6x 2AUXLQ4jTkoPX1XdUSFBRvFlY6ZawHdQNhG10zZvHI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.187 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81510 Archived-At: Am 06.07.2011 15:43, schrieb Deniz Dogan: > On 2011-07-06 14:19, smclean0640@gmail.com wrote: >> Hello, >> >> I am wondering whether anyone in the group knows a package that will >> accomplish the following: >> - I am on a word, say "limousine", by pressing a keystroke I can browse >> this word in google (or a chosen search engine) with my default browser, >> - I have selected a region of text and I want to search that text in my >> default browser. >> >> Any ideas as to how to most effectively accomplish this? Downloading a >> packaged would be ideal, but I am willing to try my hand at elisp. >> >> Stuart >> >> > > Something like this should google the word at point. > > > (defun google-word-at-point () > (interactive) > (let ((word (thing-at-point 'word))) > (if word > (funcall browse-url-browser-function > (concat "http://google.com/" word)) > (error "No word at point!")))) > > You can either call this using M-x google-word-at-point RET or bind it > to a suitable key: > > (global-set-key (kbd "C-c g") 'google-word-at-point) > > You could extend the function `google-word-at-point' further to check if > `use-region-p' returns non-nil and if so use the region as the "word". > > Hope that helps, > Deniz > > Interesting, but get an 404 error. BTW would build something from w3m-browse-url