[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacspeak-w3m-browse-rss-at-point

Hi Robert,

the problem is somewhat complicated. The function you have patched is
not used at all when you call
emacspeak.w3m-browse-rss-at-point. Still it is good to have fixed that
bug :).

The call chain is the following:

    emacspeak-w3-browse-xml-url-with-style (w3 not w3m)

The problem is that browse-url-of-buffer does not seem to work with
w3m. The problem is with the missing html file extension as you have described.

Thus, the correct thing to do would be to get  browse-url-of-buffer
or w3m fixed. For me, I have diverted the control flow from
emacspeak-rss-display to emacspeak-w3m-browse-xml-url-with-style (w3m
not w3 this time). This is not a good solution of course. Another idea
would be to change emacspeak-w3m-browse-rss-at-point as follows:

(defun emacspeak-w3m-browse-rss-at-point ()
  "Browses RSS url under point from w3m."
  (unless (eq major-mode 'w3m-mode)
    (error "Not in a W3m buffer."))
  (let ((url (emacspeak-w3m-url-at-point)))
      (emacspeak-auditory-icon 'select-object)
	   (expand-file-name "rss.xsl" emacspeak-xslt-directory)
	   url t))
     (t (error "No URL under point.")))))

Here, we call emacspeak-w3m-browse-xml-url-with-style directly so the
execution eventually ends up in the function we patched earlier.

Maybe, there is a setting in w3m by which it can be persuaded to open
any file as html. This would make it work, but would also only solve
the problem partially because the path through
emacspeak-w3-browse-xml-url-with-style still does some w3 specific
things (mainly installing hooks). This does not seem to hurt much but
is not nice.

Best regards, Lukas

Robert D. Crawford writes ("Re: emacspeak-w3m-browse-rss-at-point (patch)"):
> Hello Lukas,
> Lukas Loehrer <listaddr1@gmx.net> writes:
> > it is a bug. Here is the patch to fix it. I messed up the paranthesis
> > in the original code. Sorry for that.
> Thanks for the patch.  I think I have another problem.  I applied this
> patch by hand, as I have made changes to the emacspeak-w3m.el file that
> I am running from.  As far as I could see, it is just a matter of a
> paren on one line that should have been on another line.  I took a look
> at what was going on in this function, and I think I understand what is
> going on and  what is going wrong, but I don't know why or how to fix
> it.  
> In the code:
> (defun emacspeak-w3m-preview-this-buffer ()
>   "Preview this buffer in w3m."
>   (interactive)
>   (let ((filename
>          (format "/tmp/%s.html"
>                  (make-temp-name "w3m"))))
>     (write-region (point-min) 
>                   (point-max)
>                   filename)
> 	(w3m-find-file filename)
> 	(delete-file filename)))
> (I included the whole function so that you could see that I had changed
> it correctly)
> in the let part, we are assigning the variable file name to the result
> of the following function:
>          (format "/tmp/%s.html"
>                  (make-temp-name "w3m"))))
> and here is where I think there might be a problem.  The filenames I am
> getting look like this:
> burl22925Y-g
> instead of what I think they should look like which is something that
> starts with "w3m" and ends with ".html".  When w3m-find-file opens the
> file, it is displayed in fundamental mode.
> As far as I can tell, the code looks right.  I assume that you have
> tested it and it works for you.  Any ideas why it is not working here?
> This is nice functionality, but it is not essential for me.  I simply
> thought it would be nice to take a look at the rss feeds that I might be
> interested in subscribing to before putting them in gnus.
> In other words, I am in no hurry.  Not that I feel that you are
> obligated to take time to fix this.  After all, I've gotten my moneys
> worth out of it.  :)
> rdc
> -- 
> Robert D. Crawford
> rdc1x@comcast.net
> -----------------------------------------------------------------------------
> To unsubscribe from the emacspeak list or change your address on the
> emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
> subject of "unsubscribe" or "help"

To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help"

Emacspeak Files | Subscribe | Unsubscribe | Search