[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz-see 4d788655b6 03/10: Rename package
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/plz-see 4d788655b6 03/10: Rename package |
|
Date: |
Wed, 1 Nov 2023 18:58:45 -0400 (EDT) |
branch: externals/plz-see
commit 4d788655b639ed8fe999fa251bb920f8d1137e00
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Rename package
---
plzi.el => plz-see.el | 146 +++++++++++++++++++++++++-------------------------
1 file changed, 73 insertions(+), 73 deletions(-)
diff --git a/plzi.el b/plz-see.el
similarity index 61%
rename from plzi.el
rename to plz-see.el
index 0629b25ac6..96f8429818 100644
--- a/plzi.el
+++ b/plz-see.el
@@ -1,4 +1,4 @@
-;;; plzi.el --- Interactive HTTP client -*- lexical-binding: t;
-*-
+;;; plz-see.el --- Interactive HTTP client -*- lexical-binding:
t; -*-
;; Copyright (C) 2023 Augusto Stoffel
@@ -29,57 +29,57 @@
;;; User options and variables
-(defgroup plzi nil
+(defgroup plz-see nil
"Interactive HTTP client."
:group 'plz
- :link '(url-link "https://github.com/astoff/plzi.el"))
+ :link '(url-link "https://github.com/astoff/plz-see.el"))
-(defcustom plzi-base-url nil
- "Prefix to add to the URL argument of `plzi', if relative.
+(defcustom plz-see-base-url nil
+ "Prefix to add to the URL argument of `plz-see', if relative.
Here \"relative\" means, paradoxically, that the URL in question
starts with '/'."
:local t
:type '(choice string (const :tag "None" nil))
:safe #'stringp)
-(defcustom plzi-base-headers nil
+(defcustom plz-see-base-headers nil
"List of headers to add to all requests.
Entries of this alist are ignored if the same header is given
-explicitly in the HEADERS argument of `plzi'."
+explicitly in the HEADERS argument of `plz-see'."
:local t
:type '(alist :key-type string :value-type string)
:safe #'listp)
-(defcustom plzi-keep-buffers 10
+(defcustom plz-see-keep-buffers 10
"How many response buffers to keep.
If nil, never delete old response buffers."
:type '(choice natnum (const :tag "Keep all" nil)))
-(defcustom plzi-display-action nil
- "The ACTION argument `plzi' passes to `display-buffer'."
+(defcustom plz-see-display-action nil
+ "The ACTION argument `plz-see' passes to `display-buffer'."
:type 'sexp)
-(defcustom plzi-header-line-format
- (let ((headers '(plzi-header-line-status
- plzi-header-line-content-type
- plzi-header-line-content-length
- plzi-header-line-show-headers)))
+(defcustom plz-see-header-line-format
+ (let ((headers '(plz-see-header-line-status
+ plz-see-header-line-content-type
+ plz-see-header-line-content-length
+ plz-see-header-line-show-headers)))
(dolist (sym headers)
(put sym 'risky-local-variable t))
(cons "" headers))
- "Header line format for plzi result buffers."
+ "Header line format for plz-see result buffers."
:type 'sexp)
-(defcustom plzi-headers-buffer nil
+(defcustom plz-see-headers-buffer nil
"Buffer used to display request headers.
This can be nil to add the headers to the response buffer itself,
or a buffer name to use a separate buffer."
:type 'sexp)
-(defface plzi-header '((t :inherit font-lock-comment-face))
- "Face added by `plzi-insert-headers' to response headers.")
+(defface plz-see-header '((t :inherit font-lock-comment-face))
+ "Face added by `plz-see-insert-headers' to response headers.")
-(defcustom plzi-content-type-alist
+(defcustom plz-see-content-type-alist
`(("\\`text/html" . html-mode)
("\\`\\(application\\|text\\)/xml" . xml-mode)
("\\`application/xhtml\\+xml" . xml-mode)
@@ -95,89 +95,89 @@ or a buffer name to use a separate buffer."
:type '(alist :key-type regexp
:value-type function))
-(defvar-local plzi-response nil
- "Store the `plz-response' object in a plzi buffer.")
+(defvar-local plz-see-response nil
+ "Store the `plz-response' object in a plz-see buffer.")
-(defvar plzi--buffers '(0 . nil)
- "List of buffers generated by `plzi'.
+(defvar plz-see--buffers '(0 . nil)
+ "List of buffers generated by `plz-see'.
The car is the number of buffers created so far.")
;;; Response buffer header line
-(defvar plzi-header-line-status
+(defvar plz-see-header-line-status
'(:eval
- (setq-local plzi-header-line-status
+ (setq-local plz-see-header-line-status
(format "HTTP/%s %s"
- (plz-response-version plzi-response)
- (let ((status (plz-response-status plzi-response)))
+ (plz-response-version plz-see-response)
+ (let ((status (plz-response-status plz-see-response)))
(propertize (number-to-string status)
'face (if (<= 200 status 299) 'success
'error)))))))
-(defvar plzi-header-line-content-type
+(defvar plz-see-header-line-content-type
'(:eval
- (setq-local plzi-header-line-content-type
+ (setq-local plz-see-header-line-content-type
(when-let ((ct (alist-get 'content-type
- (plz-response-headers
plzi-response))))
+ (plz-response-headers
plz-see-response))))
(format " | %s" ct)))))
-(defvar plzi-header-line-content-length
+(defvar plz-see-header-line-content-length
'(:eval
- (setq-local plzi-header-line-content-length
+ (setq-local plz-see-header-line-content-length
(when-let ((len (alist-get 'content-length
- (plz-response-headers
plzi-response))))
+ (plz-response-headers
plz-see-response))))
(format " | %s bytes" len)))))
-(defvar plzi-header-line-show-headers
+(defvar plz-see-header-line-show-headers
'(:eval
- (setq-local plzi-header-line-show-headers
+ (setq-local plz-see-header-line-show-headers
(format " | %s"
(buttonize "show headers"
(lambda (buffer)
(with-selected-window (get-buffer-window
buffer)
- (plzi-insert-headers)))
+ (plz-see-insert-headers)))
(current-buffer))))))
;;; Response buffer construction
-(defun plzi--prepare-buffer (response)
+(defun plz-see--prepare-buffer (response)
(let* ((buffer (generate-new-buffer
- (format "*plzi-%s*" (cl-incf (car plzi--buffers)))))
+ (format "*plz-see-%s*" (cl-incf (car plz-see--buffers)))))
(error (and (plz-error-p response) response))
(response (if error (plz-error-response error) response))
(headers (plz-response-headers response))
(mode (when-let ((ct (alist-get 'content-type headers)))
- (alist-get ct plzi-content-type-alist
+ (alist-get ct plz-see-content-type-alist
nil nil #'string-match-p)))
(body (plz-response-body response)))
(with-current-buffer buffer
(save-excursion
(insert body)
(when mode (funcall mode)))
- (setq-local plzi-response response)
- (setq header-line-format plzi-header-line-format)
- (push buffer (cdr plzi--buffers))
- (when-let ((oldbufs (and plzi-keep-buffers
- (seq-drop (cdr plzi--buffers)
- (1- plzi-keep-buffers)))))
+ (setq-local plz-see-response response)
+ (setq header-line-format plz-see-header-line-format)
+ (push buffer (cdr plz-see--buffers))
+ (when-let ((oldbufs (and plz-see-keep-buffers
+ (seq-drop (cdr plz-see--buffers)
+ (1- plz-see-keep-buffers)))))
(dolist (b (cdr oldbufs))
(kill-buffer b))
(setf (cdr oldbufs) nil))
buffer)))
-(defun plzi--continue (as continue)
+(defun plz-see--continue (as continue)
(lambda (response)
(if-let ((curl-error (and (plz-error-p response)
(plz-error-curl-error response))))
(message "curl error %s: %s" (car curl-error) (cdr curl-error))
- (let ((buffer (plzi--prepare-buffer response)))
- (display-buffer buffer plzi-display-action)
+ (let ((buffer (plz-see--prepare-buffer response)))
+ (display-buffer buffer plz-see-display-action)
(when continue
(funcall continue
(pcase-exhaustive as
('response response)
('buffer buffer)
((or 'binary 'string 'file `(file ,_))
- (user-error "plzi does not accept :as %s" as))
+ (user-error "plz-see does not accept :as %s" as))
((pred functionp)
(with-temp-buffer
(insert (plz-response-body response))
@@ -186,21 +186,21 @@ The car is the number of buffers created so far.")
;;; User commands
-(defun plzi-kill-old-buffers (n)
- "Kill all but the N most recent plzi buffers.
+(defun plz-see-kill-old-buffers (n)
+ "Kill all but the N most recent plz-see buffers.
Interactively, N is the prefix argument."
(interactive "p")
- (let ((buffers (seq-drop plzi--buffers n)))
+ (let ((buffers (seq-drop plz-see--buffers n)))
(dolist (buffer (cdr buffers))
(kill-buffer buffer))
(setf (cdr buffers) nil)))
-(defun plzi-insert-headers ()
- "Insert response headers into `plzi-headers-buffer'."
+(defun plz-see-insert-headers ()
+ "Insert response headers into `plz-see-headers-buffer'."
(interactive)
- (let ((headers (plz-response-headers plzi-response))
- (hbuffer (when plzi-headers-buffer
- (get-buffer-create plzi-headers-buffer))))
+ (let ((headers (plz-response-headers plz-see-response))
+ (hbuffer (when plz-see-headers-buffer
+ (get-buffer-create plz-see-headers-buffer))))
(with-current-buffer (or hbuffer (current-buffer))
(let ((inhibit-read-only t))
(save-excursion
@@ -209,32 +209,32 @@ Interactively, N is the prefix argument."
(insert (format "%s: %s\n" k v)))
(insert ?\n)
(add-text-properties (point-min) (point)
- '(face plzi-header
- font-lock-face plzi-header
+ '(face plz-see-header
+ font-lock-face plz-see-header
fontified t)))))
(if hbuffer
(display-buffer hbuffer)
- (setq-local plzi-header-line-show-headers nil))))
+ (setq-local plz-see-header-line-show-headers nil))))
;;;###autoload
-(cl-defun plzi (method
- url
- &rest rest
- &key headers then else as
- &allow-other-keys)
+(cl-defun plz-see (method
+ url
+ &rest rest
+ &key headers then else as
+ &allow-other-keys)
(interactive `(get ,(read-from-minibuffer "Make GET request: ")))
- (when (and plzi-base-url
+ (when (and plz-see-base-url
(string-prefix-p "/" url))
- (setq url (concat plzi-base-url url)))
- (dolist (h plzi-base-headers)
+ (setq url (concat plz-see-base-url url)))
+ (dolist (h plz-see-base-headers)
(unless (assoc (car h) headers)
(push h headers)))
(apply #'plz method url
:headers headers
:as 'response
- :then (plzi--continue as then)
- :else (plzi--continue as else)
+ :then (plz-see--continue as then)
+ :else (plz-see--continue as else)
rest))
-(provide 'plzi)
-;;; plzi.el ends here
+(provide 'plz-see)
+;;; plz-see.el ends here
- [elpa] branch externals/plz-see created (now c55e6aa297), ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see bdcc265ce9 01/10: Initial commit, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 0dc77f9f69 04/10: Add readme and docstrings, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see f0198fd494 05/10: Add screenshot, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 08ab7e7923 08/10: Expand docstring, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see f82b7530bb 02/10: Handle missing content-type and content-length correctly, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 4d788655b6 03/10: Rename package,
ELPA Syncer <=
- [elpa] externals/plz-see c55e6aa297 10/10: Version 0.1, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 9b45fb544f 06/10: Address comments from emacs-devel, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 939c39fbf2 07/10: Add completion predicate for command, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see e144d38654 09/10: Don't make base URL and headers variables buffer-local by default, ELPA Syncer, 2023/11/01