From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: w3m browser in Emacs Date: Sun, 21 Jun 2009 20:27:46 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: <8c839f13-1b7b-4f69-b0b2-8749591166e7@y33g2000prg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245609634 11657 80.91.229.12 (21 Jun 2009 18:40:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jun 2009 18:40:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 21 20:40:32 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MIRxv-0004FP-6V for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2009 20:40:31 +0200 Original-Received: from localhost ([127.0.0.1]:36139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIRxu-0004ZE-F8 for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2009 14:40:30 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!feeder.motzarella.org!news.motzarella.org!eternal-september.org!news.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: news.eternal-september.org U2FsdGVkX1/m3N0lYu4R5m+DN4bjQTfr7R4RKgj+xYmTPReRpiQ5IABsdaQSjCE30UdVY5wZ2i/NsbwBH//JCIiud38zLGvN6IZufj6UFgMQZfo7CobKDs9pxnJe4Kne6UNLpbehK4U= Original-X-Complaints-To: abuse@motzarella.org Original-NNTP-Posting-Date: Sun, 21 Jun 2009 18:27:46 +0000 (UTC) X-Auth-Sender: U2FsdGVkX19D0+Mt50CiGV4PNIs5vr4no+2SEMY6Lqlvze5qITieqQ== Cancel-Lock: sha1:d+nMaEanRr6w58v4M/pckpIzZAg= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:170201 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65422 Archived-At: Joe Fineman writes: > Sean Sieger writes: > >> Joe Fineman writes: >> >> I have an Emacs command that, when I type C-c g, prompts for a >> word or phrase & looks it up in Google. >> >> May I have it? > > (defun google (what) > "Use google to search for WHAT." > (interactive "sSearch: ") > (save-window-excursion > (delete-other-windows) > (let ((dir default-directory)) > (w3m-browse-url (concat "http://www.google.com/search?q=" > (w3m-url-encode-string what))) > (cd dir) > (recursive-edit)))) > > (global-set-key "\C-Cg" 'google) Also see here for using a command to launch a url in the default desktop browser or in w3m depending on whether you use the prefix (C-u) - also checks if its an encoded anchor/link in w3m/gnus. http://richardriley.net/projects/emacs/dotemacs#sec-5