Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* gnus-article-browse-html-article / X11 forwarding
@ 2014-05-29 16:41 Joseph Mingrone
  2014-06-08  0:06 ` Joseph Mingrone
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Mingrone @ 2014-05-29 16:41 UTC (permalink / raw)
  To: info-gnus-english

Hello,

I recently discovered gnus-article-browse-html-article to view HTML
parts of articles in an external browser.  This works great when the
Emacs window is displayed on the local host.

I often use X11 forwarding to display the Emacs client window on a
remote host.  That is, I keep an Emacs daemon always running on my
desktop at work and display a client on my laptop.  This has some nice
properties.  For example, when I follow a link, Firefox/Conkeror is run
on my laptop (I think this is a Firefox/XULRunner feature).  However,
Firefox/Conkeror running on my laptop can't find those files in
desktop:/tmp created by gnus-article-browse-html-article.

My desktop has a web server set up, so I thought one solution would be
to have gnus-article-browse-html-article place the files under /www/tmp/
(I will password protect that directory, of course) and have the URL
changed from file://tmp/blah.html to http://desktop_hostname/blah.html.
Changing the location of the temporary files was easy enough.  I just had
to change mm-tmp-directory to /www/tmp/.

How can I then get the browser to look for
http://desktop_hostname/tmp/blah.html instead of
file:///www/tmp/blah.html?

Or, is there a better solution?

Thanks,

Joseph

P.S. I thought I posted this yesterday, but it didn't seem to show up.
My apologies if you get it twice.



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

* Re: gnus-article-browse-html-article / X11 forwarding
  2014-05-29 16:41 gnus-article-browse-html-article / X11 forwarding Joseph Mingrone
@ 2014-06-08  0:06 ` Joseph Mingrone
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Mingrone @ 2014-06-08  0:06 UTC (permalink / raw)
  To: info-gnus-english

Joseph Mingrone <jrm@ftfl.ca> writes:

> Hello,
>
> I recently discovered gnus-article-browse-html-article to view HTML
> parts of articles in an external browser.  This works great when the
> Emacs window is displayed on the local host.
>
> I often use X11 forwarding to display the Emacs client window on a
> remote host.  That is, I keep an Emacs daemon always running on my
> desktop at work and display a client on my laptop.  This has some nice
> properties.  For example, when I follow a link, Firefox/Conkeror is run
> on my laptop (I think this is a Firefox/XULRunner feature).  However,
> Firefox/Conkeror running on my laptop can't find those files in
> desktop:/tmp created by gnus-article-browse-html-article.

The solution I came up with involved making customized versions of
`gnus-article-browse-html-article` and `gnus-article-browse-html-parts`,
which I called `gnus-article-browse-remote-html-article` and
`gnus-article-browse-remote-html-parts`, respectively.  The changes were minor.

The only change in `gnus-article-browse-remote-html-article` is that it
calls `gnus-article-browse-remote-html-parts` instead of
`gnus-article-browse-html-parts`.  In `gnus-article-browse-remote-html-parts`, the line 

(let (type file charset content cid-dir tmp-file showed)

changes to

(let (type file charset content cid-dir tmp-file showed
(temporary-file-directory "/www/tmp") )

and after 

(setq tmp-file (mm-make-temp-file
                ;; Do we need to care for 8.3 filenames?
                "mm-" nil ".html")) 

I added the line

(set-file-modes tmp-file #o644)).

Finally

(browse-url-of-file (or tmp-file (expand-file-name file)))

changes to

(browse-url-of-file (concat "http://" system-name (replace-regexp-in-string "/www" "" tmp-file)))

but this may vary depending on your web server configuration.

Joseph



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

end of thread, other threads:[~2014-06-08  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29 16:41 gnus-article-browse-html-article / X11 forwarding Joseph Mingrone
2014-06-08  0:06 ` Joseph Mingrone

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