Function: xwidget-webkit-save-as-file

xwidget-webkit-save-as-file is a byte-compiled function defined in xwidget.el.gz.

Signature

(xwidget-webkit-save-as-file URL MIME-TYPE FILE-NAME)

Documentation

For XWIDGET webkit, save URL of MIME-TYPE to location specified by user.

FILE-NAME combined with xwidget-webkit-download-dir is the default file name of the prompt when reading. When the file name the user specified is a directory, URL is saved at the specified directory as FILE-NAME.

Source Code

;; Defined in /usr/src/emacs/lisp/xwidget.el.gz
(defun xwidget-webkit-save-as-file (url mime-type file-name)
  "For XWIDGET webkit, save URL of MIME-TYPE to location specified by user.
FILE-NAME combined with `xwidget-webkit-download-dir' is the default file name
of the prompt when reading.  When the file name the user specified is a
directory, URL is saved at the specified directory as FILE-NAME."
  (let ((save-name (read-file-name
                    (format "Save URL `%s' of type `%s' in file/directory: "
                            url mime-type)
                    xwidget-webkit-download-dir
                    (when file-name
                      (expand-file-name
                       file-name
                       xwidget-webkit-download-dir)))))
    (if (file-directory-p save-name)
        (setq save-name
              (expand-file-name (file-name-nondirectory file-name) save-name)))
    (setq xwidget-webkit-download-dir (file-name-directory save-name))
    (url-copy-file url save-name t)))