From be86a9a3ec81913947a69870c8517570b9461463 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 22 Dec 2024 13:17:34 +0100 Subject: [PATCH] update restclient Signed-off-by: Andreas Gerler --- .../restclient-pkg.el | 11 ------ .../restclient-autoloads.el | 38 +++++++++---------- .../restclient-pkg.el | 10 +++++ .../restclient.el | 33 +++++++++++++--- 4 files changed, 56 insertions(+), 36 deletions(-) delete mode 100644 elpa/restclient-20221203.1808/restclient-pkg.el rename elpa/{restclient-20221203.1808 => restclient-20231010.1327}/restclient-autoloads.el (54%) create mode 100644 elpa/restclient-20231010.1327/restclient-pkg.el rename elpa/{restclient-20221203.1808 => restclient-20231010.1327}/restclient.el (96%) diff --git a/elpa/restclient-20221203.1808/restclient-pkg.el b/elpa/restclient-20221203.1808/restclient-pkg.el deleted file mode 100644 index 6cd12bd1..00000000 --- a/elpa/restclient-20221203.1808/restclient-pkg.el +++ /dev/null @@ -1,11 +0,0 @@ -(define-package "restclient" "20221203.1808" "An interactive HTTP client for Emacs" 'nil :commit "0ba72816f92f3d5906cdf76f418fd0a3ee72809b" :authors - '(("Pavel Kurnosov" . "pashky@gmail.com")) - :maintainers - '(("Pavel Kurnosov" . "pashky@gmail.com")) - :maintainer - '("Pavel Kurnosov" . "pashky@gmail.com") - :keywords - '("http")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/restclient-20221203.1808/restclient-autoloads.el b/elpa/restclient-20231010.1327/restclient-autoloads.el similarity index 54% rename from elpa/restclient-20221203.1808/restclient-autoloads.el rename to elpa/restclient-20231010.1327/restclient-autoloads.el index e0983305..426274bb 100644 --- a/elpa/restclient-20221203.1808/restclient-autoloads.el +++ b/elpa/restclient-20231010.1327/restclient-autoloads.el @@ -1,12 +1,14 @@ -;;; restclient-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- -;; +;;; restclient-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "restclient" "restclient.el" (0 0 0 0)) ;;; Generated autoloads from restclient.el (autoload 'restclient-http-send-current "restclient" "\ @@ -14,31 +16,29 @@ Sends current request. Optional argument RAW don't reformat response if t. Optional argument STAY-IN-WINDOW do not move focus to response buffer if t. -\(fn &optional RAW STAY-IN-WINDOW)" t nil) - +(fn &optional RAW STAY-IN-WINDOW SUPPRESS-RESPONSE-BUFFER)" t) (autoload 'restclient-http-send-current-raw "restclient" "\ -Sends current request and get raw result (no reformatting or syntax highlight of XML, JSON or images)." t nil) - +Sends current request and get raw result (no reformatting or syntax highlight of XML, JSON or images)." t) (autoload 'restclient-http-send-current-stay-in-window "restclient" "\ -Send current request and keep focus in request window." t nil) - +Send current request and keep focus in request window." t) +(autoload 'restclient-http-send-current-suppress-response-buffer "restclient" "\ +Send current request but don't show response buffer." t) (autoload 'restclient-mode "restclient" "\ Turn on restclient mode. -\(fn)" t nil) - +(fn)" t) (register-definition-prefixes "restclient" '("restclient-")) - -;;;*** -;;;### (autoloads nil nil ("restclient-pkg.el") (0 0 0 0)) +;;; End of scraped data + +(provide 'restclient-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; restclient-autoloads.el ends here diff --git a/elpa/restclient-20231010.1327/restclient-pkg.el b/elpa/restclient-20231010.1327/restclient-pkg.el new file mode 100644 index 00000000..ea1f307f --- /dev/null +++ b/elpa/restclient-20231010.1327/restclient-pkg.el @@ -0,0 +1,10 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "restclient" "20231010.1327" + "An interactive HTTP client for Emacs." + () + :url "https://github.com/pashky/restclient.el" + :commit "e2a2b13482d72634f8e49864cd9e5c907a5fe137" + :revdesc "e2a2b13482d7" + :keywords '("http") + :authors '(("Pavel Kurnosov" . "pashky@gmail.com")) + :maintainers '(("Pavel Kurnosov" . "pashky@gmail.com"))) diff --git a/elpa/restclient-20221203.1808/restclient.el b/elpa/restclient-20231010.1327/restclient.el similarity index 96% rename from elpa/restclient-20221203.1808/restclient.el rename to elpa/restclient-20231010.1327/restclient.el index 722a10ec..b76cba4a 100644 --- a/elpa/restclient-20221203.1808/restclient.el +++ b/elpa/restclient-20231010.1327/restclient.el @@ -5,6 +5,8 @@ ;; Author: Pavel Kurnosov ;; Maintainer: Pavel Kurnosov ;; Created: 01 Apr 2012 +;; Package-Version: 20231010.1327 +;; Package-Revision: e2a2b13482d7 ;; Keywords: http ;; This file is not part of GNU Emacs. @@ -363,7 +365,7 @@ (while (re-search-forward "\\\\[Uu]\\([0-9a-fA-F]\\{4\\}\\)" nil t) (replace-match (char-to-string (decode-char 'ucs (string-to-number (match-string 1) 16))) t nil)))) -(defun restclient-http-handle-response (status method url bufname raw stay-in-window) +(defun restclient-http-handle-response (status method url bufname raw stay-in-window suppress-response-buffer) "Switch to the buffer returned by `url-retreive'. The buffer contains the raw HTTP response sent by the server." (setq restclient-within-call nil) @@ -381,9 +383,10 @@ The buffer contains the raw HTTP response sent by the server." (buffer-enable-undo) (restclient-response-mode) (run-hooks 'restclient-response-loaded-hook) - (if stay-in-window - (display-buffer (current-buffer) t) - (switch-to-buffer-other-window (current-buffer))))))) + (unless suppress-response-buffer + (if stay-in-window + (display-buffer (current-buffer) t) + (switch-to-buffer-other-window (current-buffer)))))))) (defun restclient-decode-response (raw-http-response-buffer target-buffer-name same-name) "Decode the HTTP response using the charset (encoding) specified in the Content-Type header. If no charset is specified, default to UTF-8." @@ -489,6 +492,17 @@ The buffer contains the raw HTTP response sent by the server." start (match-end 0))) headers)) +(defun restclient-get-response-headers () + "Returns alist of current response headers. Works *only* with with +hook called from `restclient-http-send-current-raw', usually +bound to C-c C-r." + (let ((start (point-min)) + (headers-end (+ 1 (string-match "\n\n" (buffer-substring-no-properties (point-min) (point-max)))))) + (restclient-parse-headers (buffer-substring-no-properties start headers-end)))) + +(defun restclient-set-var-from-header (var header) + (restclient-set-var var (cdr (assoc header (restclient-get-response-headers))))) + (defun restclient-read-file (path) (with-temp-buffer (insert-file-contents path) @@ -605,12 +619,12 @@ The buffer contains the raw HTTP response sent by the server." eg. -> on-response (message \"my hook called\")" ) ;;;###autoload -(defun restclient-http-send-current (&optional raw stay-in-window) +(defun restclient-http-send-current (&optional raw stay-in-window suppress-response-buffer) "Sends current request. Optional argument RAW don't reformat response if t. Optional argument STAY-IN-WINDOW do not move focus to response buffer if t." (interactive) - (restclient-http-parse-current-and-do 'restclient-http-do raw stay-in-window)) + (restclient-http-parse-current-and-do 'restclient-http-do raw stay-in-window suppress-response-buffer)) ;;;###autoload (defun restclient-http-send-current-raw () @@ -624,6 +638,12 @@ Optional argument STAY-IN-WINDOW do not move focus to response buffer if t." (interactive) (restclient-http-send-current nil t)) +;;;###autoload +(defun restclient-http-send-current-suppress-response-buffer () + "Send current request but don't show response buffer." + (interactive) + (restclient-http-send-current nil nil t)) + (defun restclient-jump-next () "Jump to next request in buffer." (interactive) @@ -768,6 +788,7 @@ Optional argument STAY-IN-WINDOW do not move focus to response buffer if t." (define-key map (kbd "C-c C-c") 'restclient-http-send-current) (define-key map (kbd "C-c C-r") 'restclient-http-send-current-raw) (define-key map (kbd "C-c C-v") 'restclient-http-send-current-stay-in-window) + (define-key map (kbd "C-c C-b") 'restclient-http-send-current-suppress-response-buffer) (define-key map (kbd "C-c C-n") 'restclient-jump-next) (define-key map (kbd "C-c C-p") 'restclient-jump-prev) (define-key map (kbd "C-c C-.") 'restclient-mark-current) -- 2.47.3