Function: eww-open-file

eww-open-file is an autoloaded, interactive and byte-compiled function defined in eww.el.gz.

Signature

(eww-open-file FILE)

Documentation

Render FILE using EWW.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
;;;###autoload (defalias 'browse-web 'eww)

;;;###autoload
(defun eww-open-file (file)
  "Render FILE using EWW."
  (interactive "fFile: ")
  (eww (concat "file://"
	       (and (memq system-type '(windows-nt ms-dos))
		    "/")
	       (expand-file-name file))
       nil
       ;; The file name may be a non-local Tramp file.  The URL
       ;; library doesn't understand these file names, so use the
       ;; normal Emacs machinery to load the file.
       (with-current-buffer (generate-new-buffer " *eww file*")
         (set-buffer-multibyte nil)
         (insert "Content-type: " (or (mailcap-extension-to-mime
                                       (url-file-extension file))
                                      "application/octet-stream")
                 "\n\n")
         (insert-file-contents file)
         (current-buffer))))