Function: package--with-response-buffer

package--with-response-buffer is a macro defined in package.el.gz.

Signature

(package--with-response-buffer URL &key ASYNC FILE ERROR-FORM NOERROR &rest BODY)

Documentation

Access URL and run BODY in a buffer containing the response.

Point is after the headers when BODY runs. FILE, if provided, is added to URL. URL can be a local file name, which must be absolute. ASYNC, if non-nil, runs the request asynchronously. ERROR-FORM is run only if a connection error occurs. If NOERROR is non-nil, don't propagate connection errors (does not apply to errors signaled by ERROR-FORM or by BODY).

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(cl-defmacro package--with-response-buffer (url &rest body &key async file error-form noerror &allow-other-keys)
  "Access URL and run BODY in a buffer containing the response.
Point is after the headers when BODY runs.
FILE, if provided, is added to URL.
URL can be a local file name, which must be absolute.
ASYNC, if non-nil, runs the request asynchronously.
ERROR-FORM is run only if a connection error occurs.  If NOERROR
is non-nil, don't propagate connection errors (does not apply to
errors signaled by ERROR-FORM or by BODY).

\(fn URL &key ASYNC FILE ERROR-FORM NOERROR &rest BODY)"
  (declare (indent defun) (debug (sexp body)))
  (while (keywordp (car body))
    (setq body (cdr (cdr body))))
  `(package--with-response-buffer-1 ,url (lambda () ,@body)
                                    :file ,file
                                    :async ,async
                                    :error-function (lambda () ,error-form)
                                    :noerror ,noerror))