From 908494f3aa571ab58d8cc864a237f25264a75b5a Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 17:15:27 +0100 Subject: [PATCH] update restclient --- .../restclient-20190122.942/restclient-pkg.el | 2 -- .../restclient-autoloads.el | 11 ++---- .../restclient-pkg.el | 2 ++ .../restclient.el | 36 ++++++++++++------- 4 files changed, 28 insertions(+), 23 deletions(-) delete mode 100644 elpa/restclient-20190122.942/restclient-pkg.el rename elpa/{restclient-20190122.942 => restclient-20191009.1208}/restclient-autoloads.el (75%) create mode 100644 elpa/restclient-20191009.1208/restclient-pkg.el rename elpa/{restclient-20190122.942 => restclient-20191009.1208}/restclient.el (96%) diff --git a/elpa/restclient-20190122.942/restclient-pkg.el b/elpa/restclient-20190122.942/restclient-pkg.el deleted file mode 100644 index 20788084..00000000 --- a/elpa/restclient-20190122.942/restclient-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "restclient" "20190122.942" "An interactive HTTP client for Emacs" 'nil :commit "cb2ff3db4e15f5d87db48d72af821b6c2ceb3b41" :keywords '("http") :authors '(("Pavel Kurnosov" . "pashky@gmail.com")) :maintainer '("Pavel Kurnosov" . "pashky@gmail.com")) diff --git a/elpa/restclient-20190122.942/restclient-autoloads.el b/elpa/restclient-20191009.1208/restclient-autoloads.el similarity index 75% rename from elpa/restclient-20190122.942/restclient-autoloads.el rename to elpa/restclient-20191009.1208/restclient-autoloads.el index 2a86a2b7..e8a43956 100644 --- a/elpa/restclient-20190122.942/restclient-autoloads.el +++ b/elpa/restclient-20191009.1208/restclient-autoloads.el @@ -1,12 +1,10 @@ ;;; restclient-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "restclient" "restclient.el" (0 0 0 0)) +;;;### (autoloads nil "restclient" "restclient.el" (23994 46383 317800 +;;;;;; 14000)) ;;; Generated autoloads from restclient.el (autoload 'restclient-http-send-current "restclient" "\ @@ -31,14 +29,11 @@ Turn on restclient mode. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "restclient" '("restclient-"))) - ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; restclient-autoloads.el ends here diff --git a/elpa/restclient-20191009.1208/restclient-pkg.el b/elpa/restclient-20191009.1208/restclient-pkg.el new file mode 100644 index 00000000..71551096 --- /dev/null +++ b/elpa/restclient-20191009.1208/restclient-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "restclient" "20191009.1208" "An interactive HTTP client for Emacs" 'nil :commit "e8ca809ace13549a1ddffb4e4aaa5d5fce750f3d" :keywords '("http") :authors '(("Pavel Kurnosov" . "pashky@gmail.com")) :maintainer '("Pavel Kurnosov" . "pashky@gmail.com")) diff --git a/elpa/restclient-20190122.942/restclient.el b/elpa/restclient-20191009.1208/restclient.el similarity index 96% rename from elpa/restclient-20190122.942/restclient.el rename to elpa/restclient-20191009.1208/restclient.el index 3a6b75da..0dc02b29 100644 --- a/elpa/restclient-20190122.942/restclient.el +++ b/elpa/restclient-20191009.1208/restclient.el @@ -6,7 +6,7 @@ ;; Maintainer: Pavel Kurnosov ;; Created: 01 Apr 2012 ;; Keywords: http -;; Package-Version: 20190122.942 +;; Package-Version: 20191009.1208 ;; This file is not part of GNU Emacs. ;; This file is public domain software. Do what you want. @@ -187,22 +187,18 @@ ad-do-it)) (ad-activate 'url-http-user-agent-string) -(defun restclient-restore-header-variables () - (url-set-mime-charset-string) - (setq url-mime-language-string nil) - (setq url-mime-encoding-string nil) - (setq url-mime-accept-string nil) - (setq url-personal-mail-address nil)) - (defun restclient-http-do (method url headers entity &rest handle-args) "Send ENTITY and HEADERS to URL as a METHOD request." (if restclient-log-request (message "HTTP %s %s Headers:[%s] Body:[%s]" method url headers entity)) (let ((url-request-method (encode-coding-string method 'us-ascii)) (url-request-extra-headers '()) - (url-request-data (encode-coding-string entity 'utf-8))) - - (restclient-restore-header-variables) + (url-request-data (encode-coding-string entity 'utf-8)) + (url-mime-charset-string (url-mime-charset-string)) + (url-mime-language-string nil) + (url-mime-encoding-string nil) + (url-mime-accept-string nil) + (url-personal-mail-address nil)) (dolist (header headers) (let* ((mapped (assoc-string (downcase (car header)) @@ -275,7 +271,12 @@ (insert-image (create-image img nil t)))) ((eq guessed-mode 'js-mode) - (let ((json-special-chars (remq (assoc ?/ json-special-chars) json-special-chars))) + (let ((json-special-chars (remq (assoc ?/ json-special-chars) json-special-chars)) + ;; Emacs 27 json.el uses `replace-buffer-contents' for + ;; pretty-printing which is great because it keeps point and + ;; markers intact but can be very slow with huge minimalized + ;; JSON. We don't need that here. + (json-pretty-print-max-secs 0)) (ignore-errors (json-pretty-print-buffer))) (restclient-prettify-json-unicode))) @@ -300,7 +301,6 @@ The buffer contains the raw HTTP response sent by the server." (setq restclient-request-time-end (current-time)) (if (= (point-min) (point-max)) (signal (car (plist-get status :error)) (cdr (plist-get status :error))) - (restclient-restore-header-variables) (when (buffer-live-p (current-buffer)) (with-current-buffer (restclient-decode-response (current-buffer) @@ -310,6 +310,7 @@ The buffer contains the raw HTTP response sent by the server." (unless raw (restclient-prettify-response method url)) (buffer-enable-undo) + (restclient-response-mode) (run-hooks 'restclient-response-loaded-hook) (if stay-in-window (display-buffer (current-buffer) t) @@ -597,6 +598,15 @@ Optional argument STAY-IN-WINDOW do not move focus to response buffer if t." ("\C-c\C-a" . restclient-toggle-body-visibility-or-indent)) :group 'restclient) +(define-minor-mode restclient-response-mode + "Minor mode to allow additional keybindings in restclient response buffer." + :init-value nil + :lighter nil + :keymap '(("q" . (lambda () + (interactive) + (quit-window (get-buffer-window (current-buffer)))))) + :group 'restclient) + ;;;###autoload (define-derived-mode restclient-mode fundamental-mode "REST Client" "Turn on restclient mode." -- 2.47.3