Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
emacs-w3
w3-fetch-callback.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File w3-fetch-callback.diff of Package emacs-w3
*** lisp/w3.el 03 Mar 2006 05:13:41 +0200 1.32 --- lisp/w3.el 01 Sep 2006 03:30:17 +0300 *************** *** 293,375 **** (w3-setup-reload-timer uri (url-view-url t) (string-to-int (or reload "5")))))) ! (defun w3-fetch-callback (url) ! (w3-nasty-disgusting-http-equiv-handling (current-buffer) url) ! ;; Process any cookie and refresh headers. ! (let (headers) ! (ignore-errors ! (save-restriction ! (mail-narrow-to-head) ! (goto-char (point-min)) ! (unless (save-excursion ! (search-forward ":" (line-end-position) t)) ! (forward-line)) ! (setq headers (mail-header-extract)) ! (let (refreshed) ! (dolist (header headers) ! ;; Act on multiple cookies if necessary, but only on a ! ;; single refresh request in case there's more than one. ! (case (car header) ! (refresh (unless refreshed ! (w3-handle-refresh-header (cdr header)) ! (setq refreshed t)))))))) ! (let ((handle (mm-dissect-buffer t)) ! (w3-explicit-coding-system ! (or w3-explicit-coding-system ! (w3-recall-explicit-coding-system url))) ! (buff nil)) ! (message "Downloading of `%s' complete." url) ! (url-mark-buffer-as-dead (current-buffer)) ! (unless headers ! (setq headers (list (cons 'content-type ! (mm-handle-media-type handle))))) ! ;; Fixme: can handle be null? ! (cond ! ((equal (mm-handle-media-type handle) "text/html") ! ;; Special case text/html if it comes through w3-fetch ! (set-buffer (generate-new-buffer " *w3-html*")) ! (mm-disable-multibyte) ! (mm-insert-part handle) ! (w3-decode-charset handle) ! (setq url-current-object (url-generic-parse-url url)) ! (w3-prepare-buffer) ! (setq url-current-mime-headers headers) ! (w3-notify-when-ready (current-buffer)) ! (mm-destroy-parts handle)) ! ;; ((equal (mm-handle-media-type handle) "text/xml") ! ;; ;; Special case text/xml if it comes through w3-fetch ! ;; (set-buffer (generate-new-buffer " *w3-xml*")) ! ;; (mm-disable-multibyte) ! ;; (mm-insert-part handle) ! ;; (w3-decode-charset handle) ! ;; !!! Need some function to view XML nicely... maybe the ! ;; !!! customize tree control? ! ;; (setq url-current-object (url-generic-parse-url url) ! ;; url-current-mime-headers headers) ! ;; (mm-destroy-parts handle) ! ;; (w3-notify-when-ready (current-buffer))) ! ((equal (car-safe (mm-handle-type handle)) ! "application/x-elisp-parsed-html") ! ;; Also need to special-case pre-parsed representations of HTML. ! ;; Fixme: will this need decoding? ! (w3-prepare-tree (read (set-marker (make-marker) 1 ! (mm-handle-buffer handle))))) ! ((mm-inlinable-p handle) ! ;; We can view it inline! ! (set-buffer (generate-new-buffer url)) ! (require 'mm-view) ; make sure methods are defined ! (mm-display-part handle) ! (set-buffer-modified-p nil) ! (w3-mode) ! (if (equal "image" (mm-handle-media-supertype handle)) ! (setq cursor-type nil)) ! (setq url-current-mime-headers headers) ! (w3-notify-when-ready (current-buffer))) ! (t ! ;; Must be an external viewer ! (mm-display-part handle) ! ;;(mm-destroy-parts handle) ! ))))) ;;;###autoload (defun w3-fetch (&optional url target) --- 293,382 ---- (w3-setup-reload-timer uri (url-view-url t) (string-to-int (or reload "5")))))) ! (defun w3-fetch-callback (&rest args) ! (let ((url (cond ! ;; see callback argument conventions in docstring of ! ;; `url-retrieve' ! ((eq (car args) :redirect) ! (caddr args)) ! (t ! (car args))))) ! (w3-nasty-disgusting-http-equiv-handling (current-buffer) url) ! ;; Process any cookie and refresh headers. ! (let (headers) ! (ignore-errors ! (save-restriction ! (mail-narrow-to-head) ! (goto-char (point-min)) ! (unless (save-excursion ! (search-forward ":" (line-end-position) t)) ! (forward-line)) ! (setq headers (mail-header-extract)) ! (let (refreshed) ! (dolist (header headers) ! ;; Act on multiple cookies if necessary, but only on a ! ;; single refresh request in case there's more than one. ! (case (car header) ! (refresh (unless refreshed ! (w3-handle-refresh-header (cdr header)) ! (setq refreshed t)))))))) ! (let ((handle (mm-dissect-buffer t)) ! (w3-explicit-coding-system ! (or w3-explicit-coding-system ! (w3-recall-explicit-coding-system url))) ! (buff nil)) ! (message "Downloading of `%s' complete." url) ! (url-mark-buffer-as-dead (current-buffer)) ! (unless headers ! (setq headers (list (cons 'content-type ! (mm-handle-media-type handle))))) ! ;; Fixme: can handle be null? ! (cond ! ((equal (mm-handle-media-type handle) "text/html") ! ;; Special case text/html if it comes through w3-fetch ! (set-buffer (generate-new-buffer " *w3-html*")) ! (mm-disable-multibyte) ! (mm-insert-part handle) ! (w3-decode-charset handle) ! (setq url-current-object (url-generic-parse-url url)) ! (w3-prepare-buffer) ! (setq url-current-mime-headers headers) ! (w3-notify-when-ready (current-buffer)) ! (mm-destroy-parts handle)) ! ;; ((equal (mm-handle-media-type handle) "text/xml") ! ;; ;; Special case text/xml if it comes through w3-fetch ! ;; (set-buffer (generate-new-buffer " *w3-xml*")) ! ;; (mm-disable-multibyte) ! ;; (mm-insert-part handle) ! ;; (w3-decode-charset handle) ! ;; !!! Need some function to view XML nicely... maybe the ! ;; !!! customize tree control? ! ;; (setq url-current-object (url-generic-parse-url url) ! ;; url-current-mime-headers headers) ! ;; (mm-destroy-parts handle) ! ;; (w3-notify-when-ready (current-buffer))) ! ((equal (car-safe (mm-handle-type handle)) ! "application/x-elisp-parsed-html") ! ;; Also need to special-case pre-parsed representations of HTML. ! ;; Fixme: will this need decoding? ! (w3-prepare-tree (read (set-marker (make-marker) 1 ! (mm-handle-buffer handle))))) ! ((mm-inlinable-p handle) ! ;; We can view it inline! ! (set-buffer (generate-new-buffer url)) ! (require 'mm-view) ; make sure methods are defined ! (mm-display-part handle) ! (set-buffer-modified-p nil) ! (w3-mode) ! (if (equal "image" (mm-handle-media-supertype handle)) ! (setq cursor-type nil)) ! (setq url-current-mime-headers headers) ! (w3-notify-when-ready (current-buffer))) ! (t ! ;; Must be an external viewer ! (mm-display-part handle) ! ;;(mm-destroy-parts handle) ! )))))) ;;;###autoload (defun w3-fetch (&optional url target)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor