From: "Robert D. Crawford" <robdcraw@gmail.com>
To: ding@gnus.org
Subject: Re: Survey: how do you view links in a external browser?
Date: Mon, 25 Oct 2010 11:55:03 -0500 [thread overview]
Message-ID: <87wrp6xleg.fsf@gmail.com> (raw)
In-Reply-To: <8uhbgbut7a.fsf@news.eternal-september.org>
Richard Riley <rileyrg@googlemail.com> writes:
> "Robert D. Crawford" <robdcraw@gmail.com> 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
next prev parent reply other threads:[~2010-10-25 16:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-24 13:51 jidanni
2010-10-24 14:02 ` Adam Sjøgren
2010-10-24 14:57 ` Richard Riley
2010-10-24 15:15 ` jidanni
2010-10-24 15:49 ` Richard Riley
2010-10-24 16:00 ` jidanni
2010-10-24 17:38 ` Richard Riley
2010-10-24 18:18 ` jidanni
2010-10-24 19:29 ` Richard Riley
2010-10-24 16:10 ` Lars Magne Ingebrigtsen
2010-10-24 17:03 ` [emacs-w3m:11398] " jidanni
2010-10-24 17:11 ` Charles Philip Chan
2010-11-29 4:09 ` jidanni
2010-11-29 9:05 ` Rupert Swarbrick
2010-10-24 15:42 ` Robert D. Crawford
2010-10-24 22:22 ` Richard Riley
2010-10-25 16:55 ` Robert D. Crawford [this message]
2010-10-25 18:01 ` Richard Riley
2010-10-24 17:03 ` Charles Philip Chan
2010-10-25 0:54 ` Daniel Pittman
2010-10-25 17:54 ` Łukasz Stelmach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wrp6xleg.fsf@gmail.com \
--to=robdcraw@gmail.com \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).