Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* w3m display buffer
@ 2010-11-17 18:15 Haines Brown
  2010-11-18  0:46 ` José A. Romero L.
  0 siblings, 1 reply; 4+ messages in thread
From: Haines Brown @ 2010-11-17 18:15 UTC (permalink / raw)
  To: info-gnus-english

I've posed a set of questions that may be connected, but because I'm
not sure of that I've divided them up.

I have w3m installed with emacs 23.2.1 and am able to display a .html
file with w3m (I've also installed emacs-w3m, but I see no difference
and am not sure what it is for). In addition, I have installed
sunrise-commander.

When I have a html file selected in sunrise-commander, and call "! w3m"
on it, it shows up in another buffer. However, not the buffer I want.

In contrast in sunrise-commander all I need to display a PDF file is do
RET for a selected .pdf file, and it opens in the other
sunrise-commander pane in the Doc-view mode. When I'm finished viewing
it, I can close the buffer and return to where I was before. With a html
file, in the opposite pance is displayed the the html markup as if I
intended to edit that markup, instead of display it as a webpage. 

With w3m, this page is instead displayed at the bottom in the "dired by
name" buffer, which gets split into two panes, with "dired by name" at
the left, and a Fundamental Mode pane at the right to display the web
page. This display is too small to be useful.

Ideally, I'd like simply to dispose of a dired buffer altogether,
leaving visible only the two panes of sunrise commander, and have the
html file displayed by w3m as a web page in the right pane simply by
entering RET on the file as I do with PDF files.

If I can't dispose of the "dired-by-name" buffer, I'd at least like to
reduce its size dramatically and direct w3d to display in the other
sunrise-commander pane instead of in Dired by Name.

Haines Brown

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

* Re: w3m display buffer
  2010-11-17 18:15 w3m display buffer Haines Brown
@ 2010-11-18  0:46 ` José A. Romero L.
  2010-11-18 20:10   ` Haines Brown
  0 siblings, 1 reply; 4+ messages in thread
From: José A. Romero L. @ 2010-11-18  0:46 UTC (permalink / raw)
  To: info-gnus-english

Hello Haines,

On Nov 17, 7:15 pm, Haines Brown <hai...@HistoricalMaterialism.info>
wrote:
(...)
> When I have a html file selected in sunrise-commander, and call "! w3m"
> on it, it shows up in another buffer. However, not the buffer I want.
>
> In contrast in sunrise-commander all I need to display a PDF file is do
> RET for a selected .pdf file, and it opens in the other
> sunrise-commander pane in the Doc-view mode. When I'm finished viewing
> it, I can close the buffer and return to where I was before. With a html
> file, in the opposite pance is displayed the the html markup as if I
> intended to edit that markup, instead of display it as a webpage.
(...)

Well, emacs is usually a text editor, so when you open a HTML file
it's pretty reasonable to assume that what you want to do is to edit
it ;)

To achieve the effect you want while using the Sunrise Commander do
the following:

1a) M-x customize-variable [RET] browse-url-browser-function [RET]
1b) Select "Emacs W3" from the value menu and press "Save for future
sessions"
2) Once in Sunrise, press "b" for viewing the file in the web browser.

Hope this helps.

Cheers,
--
José A. Romero L.
escherdragon at gmail
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)

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

* Re: w3m display buffer
  2010-11-18  0:46 ` José A. Romero L.
@ 2010-11-18 20:10   ` Haines Brown
  2010-11-18 23:46     ` José A. Romero L.
  0 siblings, 1 reply; 4+ messages in thread
From: Haines Brown @ 2010-11-18 20:10 UTC (permalink / raw)
  To: info-gnus-english

Romero,

Just realized I'm in the "gnus" group, not "gnu" emacs group. I really
must move my question about emacs and w3m elsewhere.

At present, in order to display a html file (I have a different emacs
seesion for when I want to edit it), I do 

        ! w3m filename.html

There are two problems with this. Most of these html files have an eight
or twn digit file name, and copying it is subject to error and takes a
little time. Second, Sunrise-Commander appears as two panes, but beneat
these panes is a scratch buffer (Lisp Interaction) mode. When I run the
above command, the scratch buffer is divided into two panes, and the
right one (Shell Command Output) displays the w3m rendering of the file.

First, I need to get rid of the scratch buffer altogether, for I don't
use it for this session of emas. Doing that might for the (Shell Command
Output) to occupy the right Sunrise-Commander pane, which is fine. 

Also I have to figure out how to run w3m on the current html file with
simply a RET, like I do with PDF. There is a browse-url.el that might
help, but I don't know if it is compatible with Sunrise-Commander.

Actually a third problem is that I don't see that I'm using
emacs-w3m. Other than a faster loading, I don't see what it is supposed
to do beyond whast the above command does.

You suggest that I define the variable "browse-url-browser-function". I
tried it, but could save it only for current session because I'm using a
custom emacs init file. I selected "Emacs W3", although I'm not sure of
its realtion to emacs-w3m or w3m. In any case, it opens the source FS,
but no buffer holds the w3(m) output.

Haines Brown        

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

* Re: w3m display buffer
  2010-11-18 20:10   ` Haines Brown
@ 2010-11-18 23:46     ` José A. Romero L.
  0 siblings, 0 replies; 4+ messages in thread
From: José A. Romero L. @ 2010-11-18 23:46 UTC (permalink / raw)
  To: info-gnus-english

On 18 Lis, 21:10, Haines Brown <hai...@HistoricalMaterialism.info>
wrote:
(...)
> Just realized I'm in the "gnus" group, not "gnu" emacs group. I really
> must move my question about emacs and w3m elsewhere.

Yes, I guess you should.

>
> At present, in order to display a html file (I have a different emacs
> seesion for when I want to edit it), I do
>
>         ! w3m filename.html
>
> There are two problems with this. Most of these html files have an eight
> or twn digit file name, and copying it is subject to error and takes a
> little time. Second, Sunrise-Commander appears as two panes, but beneat
> these panes is a scratch buffer (Lisp Interaction) mode. When I run the
> above command, the scratch buffer is divided into two panes, and the
> right one (Shell Command Output) displays the w3m rendering of the file.

Not the best solution IMHO -- that won't allow you to follow the
links.

> First, I need to get rid of the scratch buffer altogether, for I don't
> use it for this session of emas. Doing that might for the (Shell Command
> Output) to occupy the right Sunrise-Commander pane, which is fine.

Give the PopViewer extension a try, then.

> Also I have to figure out how to run w3m on the current html file with
> simply a RET, like I do with PDF. There is a browse-url.el that might
> help, but I don't know if it is compatible with Sunrise-Commander.

Maybe what you need is a "magic handler" -- something like this:

    (defun my-html-handler (operation &rest args)
      (let ((inhibit-file-name-handlers
             (cons 'my-html-handler
                   (and (eq inhibit-file-name-operation operation)
                        inhibit-file-name-handlers)))
            (inhibit-file-name-operation operation))
        (when (and (eq operation 'insert-file-contents)
                   (fboundp 'w3m)
                   (y-or-n-p "Browse in w3m? "))
          (kill-buffer (current-buffer))
          (apply 'w3m (list (car args)))
          (error "handled by w3m"))
        (apply operation args)))

    (add-to-list 'file-name-handler-alist '("\\.html?\\'" . my-html-
handler))

> Actually a third problem is that I don't see that I'm using
> emacs-w3m. Other than a faster loading, I don't see what it is supposed
> to do beyond whast the above command does.
(...)

Did you install one of w3m-el or w3m-el-snapshot in debian?

Cheers,
--
José A. Romero L.
escherdragon at gmail
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)

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

end of thread, other threads:[~2010-11-18 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-17 18:15 w3m display buffer Haines Brown
2010-11-18  0:46 ` José A. Romero L.
2010-11-18 20:10   ` Haines Brown
2010-11-18 23:46     ` José A. Romero L.

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