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

Fix for emacspeak-atom-browse with w3m under emacs 21



This looks unnecessarily complex in that you're redefining the
function by copying its code.

from the documentation for the  variable in question (under emacs
22 but I suspect the same under  emacs 21)
browse-url-temp-file-name is a variable defined in `browse-url.el'.
Its value is nil

Automatically becomes buffer-local when set in any fashion.


Documentation:
Not documented as a variable.


so you should be able to write an around advice that binds the
above variable in a let binding.



>>>>> "Lukas" == Lukas Loehrer <listaddr1@xxxxxxxxxxx> writes:
    Lukas> Hi all, under emacs 21, the function
    Lukas> browse-url-for-buffer generates temporary file names
    Lukas> that do not end in .html. Unfortunately, w3m does not
    Lukas> like to open local files whose file extension does not
    Lukas> identify them as HTML files. Thus, emacspeak commands
    Lukas> like emacspeak-atom-browse do not work properly if
    Lukas> browse-url is set up to use w3m. I put a fix at the
    Lukas> end of this e-mail. basically, browser-url-of-buffer
    Lukas> is redefined to use the make-temp-file function from
    Lukas> the apel library if emacs 21 is used. You can put the
    Lukas> snippet somewhere in your .emacs file.
    Lukas> 
    Lukas> Best regards, Lukas
    Lukas> 
    Lukas> (when (= emacs-major-version 21) (require 'poe)
    Lukas> (require 'browse-url) (defun browse-url-of-buffer
    Lukas> (&optional buffer) "Ask a WWW browser to display
    Lukas> BUFFER.  Display the current buffer if BUFFER is nil.
    Lukas> Display only the currently visible part of BUFFER
    Lukas> (from a temporary file) if buffer is narrowed."
    Lukas> (interactive) (save-excursion (and buffer (set-buffer
    Lukas> buffer)) (let ((file-name ;; Ignore real name if
    Lukas> restricted (and (= (- (point-max) (point-min))
    Lukas> (buffer-size)) (or buffer-file-name (and (boundp
    Lukas> 'dired-directory) dired-directory))))) (or file-name
    Lukas> (progn (or browse-url-temp-file-name (setq
    Lukas> browse-url-temp-file-name (convert-standard-filename
    Lukas> (make-temp-file (expand-file-name "burl"
    Lukas> browse-url-temp-dir) nil ".html")))) (setq file-name
    Lukas> browse-url-temp-file-name) (write-region (point-min)
    Lukas> (point-max) file-name nil 'no-message)))
    Lukas> (browse-url-of-file file-name)))) )
    Lukas> 
    Lukas> -----------------------------------------------------------------------------
    Lukas> To unsubscribe from the emacspeak list or change your
    Lukas> address on the emacspeak list send mail to
    Lukas> "emacspeak-request@xxxxxxxxxxx" with a subject of
    Lukas> "unsubscribe" or "help"

-- 
Best Regards,
--raman

      
Email:  raman@xxxxxxxxxxx
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@xxxxxxxxxxx
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs

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



If you have questions about this archive or had problems using it, please send mail to:

priestdo@xxxxxxxxxxx No Soliciting!

Emacspeak List Archive | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998

Emacspeak Files | Emacspeak Blog