Gnus development mailing list
 help / color / mirror / Atom feed
From: "Robert D. Crawford" <robdcraw@gmail.com>
To: ding@gnus.org
Subject: Re: Survey: how do you view links in a external browser?
Date: Sun, 24 Oct 2010 10:42:54 -0500	[thread overview]
Message-ID: <87ocaj38ch.fsf@gmail.com> (raw)
In-Reply-To: <87eibfya00.fsf@jidanni.org>

jidanni@jidanni.org writes:

> How do fellows usually view links in a external browser when reading a
> message in gnus?

Well, I use emacs/w3 for almost all of my browsing.  I am only partially
sighted and emacs/w3 gives me the best experience.  Some pages don't
cooperate with w3 and I open them in w3m.  Other times I use firefox
under orca.  Below is what you will want to do.  I've commented within
the defun.

(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))))

This is what I use for rss feed links and should give you a starting
point to adapt it to opening regular urls.  I just tested it under w3m
and it fails.  Sorry, but I don't have the time to figure out how to do
it properly.  The problem is w3m-print-this-url.  You need a function
that returns the url, not sends it to the kill-ring.  Not sure what I
was thinking when I wrote it.

> But to view them externally, the best we can do is copy/kill the region
> containing the link, then change to our Firefox etc. browser window, and
> paste it into the URL bar, and hit RET.

You have to think outside the box.  Almost anything is possible within
emacs, you just have to have the motivation to figure out how to do it.
All of emacs was created by people who had an itch to scratch.

I just sent myself an email containing a text link.  While point was on
the link I called browse-url-firefox via M-x.  It asked me what url with
the default being the link at point.  Assign a key to call this function
and Bob's your uncle.

> Rather cavewomanish in this day and age.

The tools are there you just have to put in the effort to learn how to
use them.

> Or one can click them, and then in emacs-w3m hit M. Browsing the same
> link twice.
>
> It's all because gnus-version "Gnus v5.13" lacks right click menus.

Seems a bit rude for someone who is both asking for help and unwilling
to search out the tools to help themselves.

rdc
-- 
Robert D. Crawford                                     robdcraw@gmail.com





  parent reply	other threads:[~2010-10-24 15:42 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 [this message]
2010-10-24 22:22   ` Richard Riley
2010-10-25 16:55     ` Robert D. Crawford
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=87ocaj38ch.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).