mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-06 03:40:56 -08:00
gmm-util.el: Re-introduce gmm-flet using cl-letf
This commit is contained in:
parent
49596095d0
commit
066f0e09bc
4 changed files with 37 additions and 23 deletions
|
|
@ -88,6 +88,7 @@
|
|||
(require 'gnus)
|
||||
(require 'gnus-start)
|
||||
(require 'gnus-util)
|
||||
(require 'gmm-utils)
|
||||
|
||||
(defvar gnus-topic-alist) ;; gnus-group.el
|
||||
(eval-when-compile
|
||||
|
|
@ -176,21 +177,16 @@ and `gnus-topic-alist'. Also see `gnus-variable-list'."
|
|||
(defun gnus-sync-lesync-call (url method headers &optional kvdata)
|
||||
"Make an access request to URL using KVDATA and METHOD.
|
||||
KVDATA must be an alist."
|
||||
(let ((orig-json-alist-p (symbol-function 'json-alist-p)))
|
||||
(fset 'json-alist-p
|
||||
(lambda (list) (gnus-sync-json-alist-p list))) ; temp patch
|
||||
(unwind-protect
|
||||
(let ((url-request-method method)
|
||||
(url-request-extra-headers headers)
|
||||
(url-request-data (if kvdata (json-encode kvdata) nil)))
|
||||
(with-current-buffer (url-retrieve-synchronously url)
|
||||
(let ((data (gnus-sync-lesync-parse)))
|
||||
(gnus-message
|
||||
12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
|
||||
method url `((headers . ,headers) (data ,kvdata)) data)
|
||||
(kill-buffer (current-buffer))
|
||||
data)))
|
||||
(fset 'json-alist-p orig-json-alist-p))))
|
||||
(gmm-flet ((json-alist-p (list) (gnus-sync-json-alist-p list))) ; temp patch
|
||||
(let ((url-request-method method)
|
||||
(url-request-extra-headers headers)
|
||||
(url-request-data (if kvdata (json-encode kvdata) nil)))
|
||||
(with-current-buffer (url-retrieve-synchronously url)
|
||||
(let ((data (gnus-sync-lesync-parse)))
|
||||
(gnus-message 12 "gnus-sync-lesync-call: %s URL %s sent %S got %S"
|
||||
method url `((headers . ,headers) (data ,kvdata)) data)
|
||||
(kill-buffer (current-buffer))
|
||||
data)))))
|
||||
|
||||
(defun gnus-sync-lesync-PUT (url headers &optional data)
|
||||
(gnus-sync-lesync-call url "PUT" headers data))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue