From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: shortest amount of keystrokes to see URL in an external browser Date: Sun, 19 Jun 2011 11:24:41 -0700 Message-ID: <87wrghisra.fsf@ericabrahamsen.net> References: <87wrgigjm6.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1308507984 18295 80.91.229.12 (19 Jun 2011 18:26:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Jun 2011 18:26:24 +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 19 20:26:18 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 1QYMhO-0002XD-4o for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Jun 2011 20:26:18 +0200 Original-Received: from localhost ([::1]:56510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYMhN-0001cD-6s for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Jun 2011 14:26:17 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYMg7-0001c1-Ji for help-gnu-emacs@gnu.org; Sun, 19 Jun 2011 14:25:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYMg6-0001Ex-49 for help-gnu-emacs@gnu.org; Sun, 19 Jun 2011 14:24:59 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:42225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYMg5-0001Eq-U2 for help-gnu-emacs@gnu.org; Sun, 19 Jun 2011 14:24:58 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QYMg3-0001xy-Rp for help-gnu-emacs@gnu.org; Sun, 19 Jun 2011 20:24:55 +0200 Original-Received: from c-71-227-187-115.hsd1.wa.comcast.net ([71.227.187.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jun 2011 20:24:55 +0200 Original-Received: from eric by c-71-227-187-115.hsd1.wa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jun 2011 20:24:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-227-187-115.hsd1.wa.comcast.net User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:OPd8zl4RvLgEK3VJGrJGRdEOnm0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:81367 Archived-At: On Sun, Jun 19 2011, jidanni@jidanni.org wrote: > Let's say you are viewing or editing file.txt and there is a URL > http://example.org/ that you would like to visit in an external browser. > Well with FFAP installed, C-x C-f upon it would get you there in an > internal browser, but if one wants to see it in an external browser, a > lot more work will be involved. C-u C-x C-f of course does something > different. Note I am talking about .txt files, and not mail messages > like these, where one could use M runs the command browse-url-firefox > etc. At least with my http://jidanni.org/comp/configuration/ . You've got browse-url-browser-function set to 'w3m-browse-url, and while that's the case you'll have to do something special to use firefox. If you only want to use an external browser for .txt files, I suppose you could use a mode-hook to make browse-url-browser-function buffer local and set it to browse-url-firefox. I prefer to set browse-url-browser-function to a list of regexps/functions. Then the top regexp does this: "https?:" -> (browse-url-generic) -> browse-url-generic-program -> "google-chrome". If you were able to dispatch to an external browser on regexps, that would make the whole thing simpler. Otherwise, making browse-url-generic-program buffer local and setting it through hooks might be less disruptive than re-setting browse-url-browser-function to a completely new function. Perhaps you knew all this already… Eric