Gnus development mailing list
 help / color / mirror / Atom feed
* Survey: how do you view links in a external browser?
@ 2010-10-24 13:51 jidanni
  2010-10-24 14:02 ` Adam Sjøgren
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: jidanni @ 2010-10-24 13:51 UTC (permalink / raw)
  To: ding

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

Sure, to view them internally we can just hit RET on them and up comes
emacs-w3m, etc.

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.

Rather cavewomanish in this day and age.

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.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 13:51 Survey: how do you view links in a external browser? jidanni
@ 2010-10-24 14:02 ` Adam Sjøgren
  2010-10-24 14:57 ` Richard Riley
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 21+ messages in thread
From: Adam Sjøgren @ 2010-10-24 14:02 UTC (permalink / raw)
  To: ding

On Sun, 24 Oct 2010 21:51:27 +0800, jidanni@jidanni.org wrote:

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

I have customized browse-url-browser-function to 'browse-url-firefox, so
clicking a link opens it in Firefox.

(I never use any of the browsers in Emacs.)


  Best regards,

    Adam

-- 
 "Few things are less comforting than a tiger who's up        Adam Sjøgren
  too late."                                             asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 13:51 Survey: how do you view links in a external browser? 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:42 ` Robert D. Crawford
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 21+ messages in thread
From: Richard Riley @ 2010-10-24 14:57 UTC (permalink / raw)
  To: jidanni; +Cc: ding

jidanni@jidanni.org writes:

> How do fellows usually view links in a external browser when reading a
> message in gnus?
>
> Sure, to view them internally we can just hit RET on them and up comes
> emacs-w3m, etc.
>
> 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.
>
> Rather cavewomanish in this day and age.

Indeed. If that were the case. It isn't.

http://www.emacswiki.org/emacs/BrowseUrl

(setq browse-url-browser-function (quote browse-url-generic))
(setq browse-url-generic-program "iceweasel")


>
> 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.
>

I'm not sure I follow what a right click context menu has to do with
underlying functionality.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 14:57 ` Richard Riley
@ 2010-10-24 15:15   ` jidanni
  2010-10-24 15:49     ` Richard Riley
  2010-10-24 16:10     ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 21+ messages in thread
From: jidanni @ 2010-10-24 15:15 UTC (permalink / raw)
  To: rileyrg; +Cc: ding

>>>>> "RR" == Richard Riley <rileyrg@googlemail.com> writes:
RR> (setq browse-url-browser-function (quote browse-url-generic))
RR> (setq browse-url-generic-program "iceweasel")
So what keys/actions do you use when you want to
1. Browse internally?
2. Browse externally?
Or do you always browse externally, whereas I am "pro-choice" and want
both choices, in a right click menu, just like most other software offers.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 13:51 Survey: how do you view links in a external browser? jidanni
  2010-10-24 14:02 ` Adam Sjøgren
  2010-10-24 14:57 ` Richard Riley
@ 2010-10-24 15:42 ` Robert D. Crawford
  2010-10-24 22:22   ` Richard Riley
  2010-10-24 17:03 ` Charles Philip Chan
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 21+ messages in thread
From: Robert D. Crawford @ 2010-10-24 15:42 UTC (permalink / raw)
  To: ding

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





^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 15:15   ` jidanni
@ 2010-10-24 15:49     ` Richard Riley
  2010-10-24 16:00       ` jidanni
  2010-10-24 16:10     ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 21+ messages in thread
From: Richard Riley @ 2010-10-24 15:49 UTC (permalink / raw)
  To: jidanni; +Cc: rileyrg, ding

jidanni@jidanni.org writes:

>>>>>> "RR" == Richard Riley <rileyrg@googlemail.com> writes:
> RR> (setq browse-url-browser-function (quote browse-url-generic))
> RR> (setq browse-url-generic-program "iceweasel")
> So what keys/actions do you use when you want to
> 1. Browse internally?
> 2. Browse externally?
> Or do you always browse externally, whereas I am "pro-choice" and want

We are all pro choice. And Emacs provides more choice than you can shake
a stick at. Configure it to provide your choice.

> both choices, in a right click menu, just like most other software offers.

Sounds like you dont want emacs then.

If you do, then you need to customise it. I always browse URLS externally
generally by hitting enter on a url using the settings above. Want to do
it internally? Its something as simple as

(define-key mode-specific-map [?u] 'w3m-browse-url)

since I always have firefox (iceweasel) open its faster than using w3m
generally. If I want a web url I generally want to see it was it was
intended. w3m cant do that more often than not.






^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 15:49     ` Richard Riley
@ 2010-10-24 16:00       ` jidanni
  2010-10-24 17:38         ` Richard Riley
  0 siblings, 1 reply; 21+ messages in thread
From: jidanni @ 2010-10-24 16:00 UTC (permalink / raw)
  To: rileyrg; +Cc: ding

>>>>> "RR" == Richard Riley <rileyrg@googlemail.com> writes:

>> in a right click menu, just like most other software offers.

RR> Sounds like you dont want emacs then.

emacs-w3m has such menus, and it is inside emacs.

Why can't there be such menus inside gnus? Better than remembering
what key I've bound things to.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 15:15   ` jidanni
  2010-10-24 15:49     ` Richard Riley
@ 2010-10-24 16:10     ` Lars Magne Ingebrigtsen
  2010-10-24 17:03       ` [emacs-w3m:11398] " jidanni
  2010-11-29  4:09       ` jidanni
  1 sibling, 2 replies; 21+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-24 16:10 UTC (permalink / raw)
  To: ding

jidanni@jidanni.org writes:

> So what keys/actions do you use when you want to
> 1. Browse internally?
> 2. Browse externally?

I think this might be a slightly ill-defined way of looking at this.  If
you're in an Emacs buffer, and you have an URL, then the question is:
What browser do you want to browse the URL with?  "Internal" and
"external" aren't quite clear -- you may want to use emacs-w3m, or you
may want to use w3, shr, firefox, chrome, etc.

Some of these are obviously more "internal" than others.

So if browse-url were to provide the segmentation between internal and
external browsers (I don't think it does?), then the user could
customize this, and other packages (like shr) could provide keystrokes
and menus for this.

But this isn't a Gnus issue per se, so I think you should frame this as
a feature request to the Emacs people instead.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 13:51 Survey: how do you view links in a external browser? jidanni
                   ` (2 preceding siblings ...)
  2010-10-24 15:42 ` Robert D. Crawford
@ 2010-10-24 17:03 ` Charles Philip Chan
  2010-10-25  0:54 ` Daniel Pittman
  2010-10-25 17:54 ` Łukasz Stelmach
  5 siblings, 0 replies; 21+ messages in thread
From: Charles Philip Chan @ 2010-10-24 17:03 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

jidanni@jidanni.org writes:

> 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.

As Lars said, you should request this as an Emacs feature. Two others
ways of doing this, if you are using Linux/Unix (don't know about other
platforms), are:

1. Use the clipboard in KDE or Gnome that can be configured to popup a
   menu that allows you to open the selected URL in a browser.

2. Use a program that can get the current x-selection, write a shell
   script to open it up in a browser and put it in your root menu (and
   optional bind it to a key). I have done this with Window Maker in the
   past.

Charles

-- 
"Oh, I've seen copies [of Linux Journal] around the terminal room at The
Labs."
(By Dennis Ritchie)

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [emacs-w3m:11398] Re: Survey: how do you view links in a external browser?
  2010-10-24 16:10     ` Lars Magne Ingebrigtsen
@ 2010-10-24 17:03       ` jidanni
  2010-10-24 17:11         ` Charles Philip Chan
  2010-11-29  4:09       ` jidanni
  1 sibling, 1 reply; 21+ messages in thread
From: jidanni @ 2010-10-24 17:03 UTC (permalink / raw)
  To: ding; +Cc: emacs-w3m

>>>>> "LMI" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
LMI> jidanni@jidanni.org writes:

>> So what keys/actions do you use when you want to
>> 1. Browse internally?
>> 2. Browse externally?

LMI> I think this might be a slightly ill-defined way of looking at this.  If
LMI> you're in an Emacs buffer, and you have an URL, then the question is:
LMI> What browser do you want to browse the URL with?  "Internal" and
LMI> "external" aren't quite clear -- you may want to use emacs-w3m, or you
LMI> may want to use w3, shr, firefox, chrome, etc.

LMI> Some of these are obviously more "internal" than others.

LMI> So if browse-url were to provide the segmentation between internal and
LMI> external browsers (I don't think it does?), then the user could
LMI> customize this, and other packages (like shr) could provide keystrokes
LMI> and menus for this.

LMI> But this isn't a Gnus issue per se, so I think you should frame this as
LMI> a feature request to the Emacs people instead.

Maybe it is a emacs-w3m issue, as I think the rendering in gnus is done
by it for me... no harm in me just CCing them...



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [emacs-w3m:11398] Re: Survey: how do you view links in a external browser?
  2010-10-24 17:03       ` [emacs-w3m:11398] " jidanni
@ 2010-10-24 17:11         ` Charles Philip Chan
  0 siblings, 0 replies; 21+ messages in thread
From: Charles Philip Chan @ 2010-10-24 17:11 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

jidanni@jidanni.org writes:

> Maybe it is a emacs-w3m issue, as I think the rendering in gnus is
> done by it for me... no harm in me just CCing them...

I do get a right-click menu with a "browse with external browser" option
when displaying with emacs-w3m (maybe your gnus/emacs-w3m version is too
old). It is only with links in plain text messages that I don't get a
right-click menu.

Charles

-- 
"MSDOS didn't get as bad as it is overnight -- it took over ten years
of careful development."
(By dmeggins@aix1.uottawa.ca)

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 16:00       ` jidanni
@ 2010-10-24 17:38         ` Richard Riley
  2010-10-24 18:18           ` jidanni
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Riley @ 2010-10-24 17:38 UTC (permalink / raw)
  To: jidanni; +Cc: ding

jidanni@jidanni.org writes:

>>>>>> "RR" == Richard Riley <rileyrg@googlemail.com> writes:
>
>>> in a right click menu, just like most other software offers.
>
> RR> Sounds like you dont want emacs then.
>
> emacs-w3m has such menus, and it is inside emacs.

right click menus? Nothing here. I dont use a mouse generally
anyway so its not an issue for me.

>
> Why can't there be such menus inside gnus? Better than remembering
> what key I've bound things to.

You are aware of C-h m?

If remembering key strokes is such a hassle then emacs might not be for
you..

But you didn't bother to provide any acknowledgement to the answers I
provided to try and help you. Did my example help?






^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 17:38         ` Richard Riley
@ 2010-10-24 18:18           ` jidanni
  2010-10-24 19:29             ` Richard Riley
  0 siblings, 1 reply; 21+ messages in thread
From: jidanni @ 2010-10-24 18:18 UTC (permalink / raw)
  To: rileyrg; +Cc: ding

>>>>> "RR" == Richard Riley <rileyrg@googlemail.com> writes:
RR> You are aware of C-h m?
Yes, since about 1986.
RR> If remembering key strokes is such a hassle then emacs might not be for you..
I think it is too late for a second marriage.
RR> But you didn't bother to provide any acknowledgement to the answers I
RR> provided to try and help you. Did my example help?
Mainly I recall setting it

http://jidanni.org/comp/configuration/
$ find|xargs grep browse
./.emacs-w3m:  'w3m-view-url-with-external-browser);maybe in 2011 will be bound by default?
./.emacs:    (define-key dired-mode-map "b" 'browse-url-of-dired-file))))
./.emacs:(global-set-key "\C-xw" 'browse-url-of-buffer)
./.emacs: browse-url-save-file t
./.emacs: browse-url-browser-function 'w3m-browse-url
./.emacs:(eval-after-load "browse-url";workaround
./.emacs:  '(let ((file (rassoc "file:/" browse-url-filename-alist)))

to emacs-w3m and fear very much having to figure out again how to make it two
headed, one for external one for internal. Hence I was hoping the
choices would someday show up in a menu like they do already for
emacs-w3m, but not gnus.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 18:18           ` jidanni
@ 2010-10-24 19:29             ` Richard Riley
  0 siblings, 0 replies; 21+ messages in thread
From: Richard Riley @ 2010-10-24 19:29 UTC (permalink / raw)
  To: jidanni; +Cc: rileyrg, ding

jidanni@jidanni.org writes:

>>>>>> "RR" == Richard Riley <rileyrg@googlemail.com> writes:
> RR> You are aware of C-h m?
> Yes, since about 1986.
> RR> If remembering key strokes is such a hassle then emacs might not be for
> you..
> I think it is too late for a second marriage.
> RR> But you didn't bother to provide any acknowledgement to the answers I
> RR> provided to try and help you. Did my example help?
> Mainly I recall setting it
>
> http://jidanni.org/comp/configuration/
> $ find|xargs grep browse
> ./.emacs-w3m: 'w3m-view-url-with-external-browser);maybe in 2011 will be bound
> by default?
> ./.emacs:    (define-key dired-mode-map "b" 'browse-url-of-dired-file))))
> ./.emacs:(global-set-key "\C-xw" 'browse-url-of-buffer)
> ./.emacs: browse-url-save-file t
> ./.emacs: browse-url-browser-function 'w3m-browse-url
> ./.emacs:(eval-after-load "browse-url";workaround
> ./.emacs:  '(let ((file (rassoc "file:/" browse-url-filename-alist)))
>
> to emacs-w3m and fear very much having to figure out again how to make it two
> headed, one for external one for internal. Hence I was hoping the
> choices would someday show up in a menu like they do already for
> emacs-w3m, but not gnus.

I'm not sure I understand.

Did you see the example of how to do what you wanted that I replied to
you with?  A key to open internally with default externally. Trivial to
swap around.





^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 15:42 ` Robert D. Crawford
@ 2010-10-24 22:22   ` Richard Riley
  2010-10-25 16:55     ` Robert D. Crawford
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Riley @ 2010-10-24 22:22 UTC (permalink / raw)
  To: ding

"Robert D. Crawford" <robdcraw@gmail.com> writes:

> 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.


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?

Have I forgotten some other part of my configuration that facilitates
this I wonder?



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 13:51 Survey: how do you view links in a external browser? jidanni
                   ` (3 preceding siblings ...)
  2010-10-24 17:03 ` Charles Philip Chan
@ 2010-10-25  0:54 ` Daniel Pittman
  2010-10-25 17:54 ` Łukasz Stelmach
  5 siblings, 0 replies; 21+ messages in thread
From: Daniel Pittman @ 2010-10-25  0:54 UTC (permalink / raw)
  To: ding

jidanni@jidanni.org writes:

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

(defadvice w3m-safe-view-this-url
  (around gnus-open-in-real-browser activate)
  "Cause w3m to open a URL in an external browser, but only within the
scope of a Gnus mail buffer.  In theory.  It presently doesn't implement
that limit at all."
  (browse-url (w3m-anchor)))

Also, setting browse-url for text/plain messages to DTRT, but that is what
fixed w3m rendered HTML messages for me.  (I don't use the new SHR stuff)

        Daniel
-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons




^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 22:22   ` Richard Riley
@ 2010-10-25 16:55     ` Robert D. Crawford
  2010-10-25 18:01       ` Richard Riley
  0 siblings, 1 reply; 21+ messages in thread
From: Robert D. Crawford @ 2010-10-25 16:55 UTC (permalink / raw)
  To: ding

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





^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 13:51 Survey: how do you view links in a external browser? jidanni
                   ` (4 preceding siblings ...)
  2010-10-25  0:54 ` Daniel Pittman
@ 2010-10-25 17:54 ` Łukasz Stelmach
  5 siblings, 0 replies; 21+ messages in thread
From: Łukasz Stelmach @ 2010-10-25 17:54 UTC (permalink / raw)
  To: ding

jidanni@jidanni.org writes:

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

I've made Shift-MiddleButton open an external browser

--8<---------------cut here---------------start------------->8---
(eval-after-load "w3m"
  '(define-key w3m-link-map [S-mouse-2]
    (lambda (event)
      (interactive "e")
      (mouse-set-point event)
      (w3m-external-view-this-url))))
--8<---------------cut here---------------end--------------->8---

-- 
Miłego dnia,
Łukasz Stelmach




^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-25 16:55     ` Robert D. Crawford
@ 2010-10-25 18:01       ` Richard Riley
  0 siblings, 0 replies; 21+ messages in thread
From: Richard Riley @ 2010-10-25 18:01 UTC (permalink / raw)
  To: ding

"Robert D. Crawford" <robdcraw@gmail.com> writes:

> 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.


Did you try the 3 lines above?


I cant see anything else I set to make it work so but guess there might
be something obscure hidden.




^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-10-24 16:10     ` Lars Magne Ingebrigtsen
  2010-10-24 17:03       ` [emacs-w3m:11398] " jidanni
@ 2010-11-29  4:09       ` jidanni
  2010-11-29  9:05         ` Rupert Swarbrick
  1 sibling, 1 reply; 21+ messages in thread
From: jidanni @ 2010-11-29  4:09 UTC (permalink / raw)
  To: ding

OK, we can read links in external browsers, but if that browser was thus
started by our command there in emacs, and not running already, then
when one wants to exit emacs, emacs will insist upon taking that
external browsers life away with emacs, else emacs will not exit.
One probably needs to write a shell wrapper around the browser so emacs
thinks it is already dead.



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Survey: how do you view links in a external browser?
  2010-11-29  4:09       ` jidanni
@ 2010-11-29  9:05         ` Rupert Swarbrick
  0 siblings, 0 replies; 21+ messages in thread
From: Rupert Swarbrick @ 2010-11-29  9:05 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

jidanni@jidanni.org writes:

> OK, we can read links in external browsers, but if that browser was thus
> started by our command there in emacs, and not running already, then
> when one wants to exit emacs, emacs will insist upon taking that

Whoah! "one wants to exit emacs" ??

Rupert :-)

[-- Attachment #2: Type: application/pgp-signature, Size: 315 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-11-29  9:05 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-24 13:51 Survey: how do you view links in a external browser? 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
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

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