From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/73578 Path: news.gmane.org!not-for-mail From: "Robert D. Crawford" Newsgroups: gmane.emacs.gnus.general Subject: Re: Survey: how do you view links in a external browser? Date: Mon, 25 Oct 2010 11:55:03 -0500 Message-ID: <87wrp6xleg.fsf@gmail.com> References: <87eibfya00.fsf@jidanni.org> <87ocaj38ch.fsf@gmail.com> <8uhbgbut7a.fsf@news.eternal-september.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1288025783 2432 80.91.229.12 (25 Oct 2010 16:56:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Oct 2010 16:56:23 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M21947@lists.math.uh.edu Mon Oct 25 18:56:22 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PAQLM-0005Jy-9j for ding-account@gmane.org; Mon, 25 Oct 2010 18:56:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PAQKM-00070t-SQ; Mon, 25 Oct 2010 11:55:18 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PAQKJ-00070a-LT for ding@lists.math.uh.edu; Mon, 25 Oct 2010 11:55:15 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PAQKI-0005mR-4M for ding@lists.math.uh.edu; Mon, 25 Oct 2010 11:55:14 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PAQKH-0004zH-00 for ; Mon, 25 Oct 2010 18:55:13 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PAQKG-0004kD-VR for ding@gnus.org; Mon, 25 Oct 2010 18:55:12 +0200 Original-Received: from 99-3-91-133.lightspeed.nsvltn.sbcglobal.net ([99.3.91.133]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Oct 2010 18:55:12 +0200 Original-Received: from robdcraw by 99-3-91-133.lightspeed.nsvltn.sbcglobal.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Oct 2010 18:55:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 59 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 99-3-91-133.lightspeed.nsvltn.sbcglobal.net Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:bxIeidg+jqGxMYp6mArBZDdi0DQ= X-Spam-Score: -1.0 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:73578 Archived-At: Richard Riley writes: > "Robert D. Crawford" writes: > >> (defun rdc-gnus-open-in-browser (&optional arg) >> "opens the link under point in browser >> numeric argument calls alternate browser" >> (interactive "p") >> ;; the next few lines are not useful to you >> ;; (dtk-speak "Opening URL in GUI browser") >> ;; (let ((emacspeak-speak-messages nil)) >> (goto-char (point-min)) >> (search-forward-regexp "link") >> ;; the next line moves into the word "link" >> (backward-char 2) >> (if (= arg 4) >> (setq browser-command-string "chrome ") >> (setq browser-command-string "firefox ")) >> (shell-command (concat browser-command-string >> "\"" >> (if (eq browse-url-browser-function >> 'browse-url-w3) >> (w3-view-this-url) >> (w3m-print-this-url) >> "\"" >> nil nil)))) >> > What wrong with something as simple as > > (setq browse-url-browser-function (quote browse-url-generic)) > (setq browse-url-generic-program "iceweasel") > > for the default return key/left click on a link > > and then something like > > (define-key mode-specific-map [?u] 'w3m-browse-url) > > for internal using w3m? There might be a simpler way than what I've done here but I'm not sure. I do know that using w3 to render in gnus, calling both browse-url-firefox and w3m-browse-url both give something like this response in the minibuffer: URL: http://link I could have written the defun above using these functions I'm sure but still would have had to resort to getting the link somehow and then figuring out if I was using w3m or w3 as the renderer. At the time it was written I was attempting, in an admittedly limited way, to work on emacspeak and it was not uncommon to switch renderers several times over the course of a single session. Take care, rdc -- Robert D. Crawford robdcraw@gmail.com