[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 7db9cc3785 21/31: Chore: Shorten assorted long
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive 7db9cc3785 21/31: Chore: Shorten assorted long lines |
Date: |
Fri, 1 Dec 2023 01:00:39 -0500 (EST) |
branch: elpa/hyperdrive
commit 7db9cc378501001c9869e4f4f1f01ae5142b2cae
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Joseph Turner <joseph@ushin.org>
Chore: Shorten assorted long lines
This tackles lines that managed to be too long all by themselves,
without many surrounding lines also being to long (and therefore
requiring a different kind of line-shorting).
---
hyperdrive-history.el | 8 +++++---
hyperdrive-lib.el | 28 +++++++++++++++++++---------
hyperdrive-mirror.el | 16 ++++++++++------
hyperdrive-org.el | 3 ++-
hyperdrive-vars.el | 5 +++--
tests/test-hyperdrive-org.el | 3 ++-
6 files changed, 41 insertions(+), 22 deletions(-)
diff --git a/hyperdrive-history.el b/hyperdrive-history.el
index 64a6f291d1..39a4a9d5d3 100644
--- a/hyperdrive-history.el
+++ b/hyperdrive-history.el
@@ -269,7 +269,8 @@ Interactively, diff range entry at point with previous
entry."
(cl-defun h/history-find-file
(range-entry &key (then (lambda ()
- (pop-to-buffer (current-buffer)
'(display-buffer-same-window)))))
+ (pop-to-buffer (current-buffer)
+ '(display-buffer-same-window)))))
"Visit hyperdrive entry in RANGE-ENTRY at point.
Then call THEN. When entry does not exist, does nothing and
returns nil. When entry is not known to exist, attempts to load
@@ -353,8 +354,9 @@ buffer."
;; argument list and perform the user
interactions
;; in the body? This change would deduplicate
the
;; check for the existence of the entry.
- (read-file-name "Filename: "
- (expand-file-name name
h/download-directory)))))
+ (read-file-name
+ "Filename: "
+ (expand-file-name name
h/download-directory)))))
(list range-entry read-filename)) h/history-mode)
(pcase-exhaustive (h/range-entry-exists-p range-entry)
('t
diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 96baa3af25..daaf1c0ec7 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -422,7 +422,8 @@ be \\+`unknown'."
(when-let ((previous-entry (he/at previous-version entry)))
;; Entry version is currently its range end, but it should be its
;; version range start.
- (setf (he/version previous-entry) (car (he/version-range
previous-entry)))
+ (setf (he/version previous-entry)
+ (car (he/version-range previous-entry)))
previous-entry)))))))
(defun he/at (version entry)
@@ -474,9 +475,11 @@ Sends a request to the gateway for hyperdrive's latest
version."
(cl-return-from he/next next-entry))
;; ENTRY is a file...
- (pcase-let* ((`(,_range-start . ,(map (:range-end range-end)))
(he/version-range entry))
+ (pcase-let* ((`(,_range-start . ,(map (:range-end range-end)))
+ (he/version-range entry))
(next-range-start (1+ range-end))
- ((map (:existsp next-range-existsp) (:range-end
next-range-end))
+ ((map (:existsp next-range-existsp)
+ (:range-end next-range-end))
;; TODO: If cl struct copiers are extended like this:
;;
https://lists.gnu.org/archive/html/help-gnu-emacs/2021-10/msg00797.html
;; replace following sexp with
@@ -503,7 +506,9 @@ Sends a request to the gateway for hyperdrive's latest
version."
(cl-defun h/open
(entry &key recurse (createp t) (messagep t)
(then (lambda ()
- (pop-to-buffer (current-buffer)
'((display-buffer-reuse-window display-buffer-same-window))))))
+ (pop-to-buffer (current-buffer)
+ '((display-buffer-reuse-window
+ display-buffer-same-window))))))
"Open hyperdrive ENTRY.
If RECURSE, proceed up the directory hierarchy if given path is
not found. THEN is a function to pass to the handler which will
@@ -519,7 +524,8 @@ echo area when the request for the file is made."
(h/fill entry
:then (lambda (entry)
(pcase-let* (((cl-struct hyperdrive-entry type) entry)
- (handler (alist-get type h/type-handlers nil nil
#'string-match-p)))
+ (handler (alist-get type h/type-handlers
+ nil nil #'string-match-p)))
(unless (h//entry-directory-p entry)
;; No need to fill latest version for directories,
;; since we do it in `h//fill' already.
@@ -716,7 +722,8 @@ correct ETag header. Returns the latest version number."
;; places where this function is called. Better yet, update
;; `h/version-ranges' (and `h/hyperdrives'?) in a
;; lower-level function, perhaps a wrapper for `h/api'?
- (setf (h/latest-version hyperdrive) (string-to-number (map-elt headers
'etag))))
+ (setf (h/latest-version hyperdrive)
+ (string-to-number (map-elt headers 'etag))))
;; TODO: Consider using symbol-macrolet to simplify place access.
@@ -1173,7 +1180,8 @@ INITIAL-INPUT-NUMBER is converted to a string and passed
to
;; Don't use read-number since it cannot return nil.
(version (read-string
(format-prompt prompt nil (h//format-hyperdrive hyperdrive))
- (when initial-input-number (number-to-string
initial-input-number))
+ (when initial-input-number
+ (number-to-string initial-input-number))
'h//version-history)))
(unless (string-blank-p version)
(string-to-number version))))
@@ -1203,7 +1211,8 @@ is passed to `read-string' as its DEFAULT-VALUE argument."
Prompts with PROMPT. Defaults to current entry if it exists."
(let ((default (when h/current-entry
(he/url h/current-entry))))
- (string-trim (read-string (format-prompt prompt default) nil
'h//url-history default))))
+ (string-trim (read-string (format-prompt prompt default)
+ nil 'h//url-history default))))
(defvar h//name-history nil
"Minibuffer history of `hyperdrive-read-name'.")
@@ -1212,7 +1221,8 @@ Prompts with PROMPT. Defaults to current entry if it
exists."
"Wrapper for `read-string' with common history.
Prompts with PROMPT and DEFAULT, according to `format-prompt'.
DEFAULT and INITIAL-INPUT are passed to `read-string' as-is."
- (read-string (format-prompt prompt default) initial-input 'h//name-history
default))
+ (read-string (format-prompt prompt default)
+ initial-input 'h//name-history default))
(cl-defun h/put-metadata (hyperdrive &key then)
"Put HYPERDRIVE's metadata into the appropriate file, then call THEN."
diff --git a/hyperdrive-mirror.el b/hyperdrive-mirror.el
index 2d42193e20..c13f437ab0 100644
--- a/hyperdrive-mirror.el
+++ b/hyperdrive-mirror.el
@@ -103,8 +103,7 @@ STATUS is one of:
(propertize url 'display short-url)))
(unless h/mirror-columns
- (setq-default h/mirror-columns
- (get 'h/mirror-columns 'standard-value)))
+ (setq-default h/mirror-columns (get 'h/mirror-columns 'standard-value)))
;;;; Functions
@@ -119,7 +118,9 @@ After uploading files, open PARENT-ENTRY."
(or (eq status 'new) (eq status 'newer)))
files-and-urls))
(progress-reporter
- (make-progress-reporter (format "Uploading %s files: " (length
upload-files-and-urls)) 0 (length upload-files-and-urls)))
+ (make-progress-reporter
+ (format "Uploading %s files: " (length upload-files-and-urls))
+ 0 (length upload-files-and-urls)))
(queue (make-plz-queue
:limit h/queue-limit
:finally (lambda ()
@@ -206,8 +207,10 @@ filter and set NO-CONFIRM to t."
(with-current-buffer buffer
(with-silent-modifications
(erase-buffer)
- (insert (propertize (format "Comparing files
(%s/%s)..." num-filled num-of)
- 'face
'font-lock-comment-face)))))))
+ (insert (propertize
+ (format "Comparing files (%s/%s)..."
+ num-filled num-of)
+ 'face 'font-lock-comment-face)))))))
(h/mirror-mode)
(setq-local h/mirror-query `( ,source ,hyperdrive
:target-dir ,target-dir
@@ -352,7 +355,8 @@ grouping keys, as in `hyperdrive-mirror-default-keys'."
("Lambda function" .
(lambda () (read--expression "Lambda: " "(lambda (filename) )")))
("Named function" .
- (lambda () (intern (completing-read "Named function: " obarray
#'functionp t))))))
+ (lambda () (intern (completing-read "Named function: "
+ obarray #'functionp t))))))
;; TODO(transient): Implement returning values from prefixes,
;; allowing us to use a sub-prefix here instead of completing-read.
(reader (completing-read "Filter type: " readers nil t))
diff --git a/hyperdrive-org.el b/hyperdrive-org.el
index c5a2efe4c2..9cfdbe0f03 100644
--- a/hyperdrive-org.el
+++ b/hyperdrive-org.el
@@ -151,7 +151,8 @@ the logic for handling links of \"file\" type."
:hyperdrive hyperdrive
:path (expand-file-name (org-element-property :path context)
(file-name-directory path))
- :etc `((target . ,(org-element-property :search-option
context))))))
+ :etc `((target . ,(org-element-property
+ :search-option context))))))
entry))))
(defun h/org--insert-link-after-advice (&rest _)
diff --git a/hyperdrive-vars.el b/hyperdrive-vars.el
index 0d3da25d20..e8954a1a5e 100644
--- a/hyperdrive-vars.el
+++ b/hyperdrive-vars.el
@@ -146,8 +146,9 @@ through a shell)."
When \\+`any-version', try to reuse an existing buffer showing the
same entry at any version. When \\+`same-version', try to reuse
an existing buffer at the same version, or make a new buffer."
- :type '(choice (const :tag "Use an existing buffer at any version"
any-version)
- (const :tag "Use an existing buffer at the same version"
same-version)))
+ :type '(choice
+ (const :tag "Use an existing buffer at any version" any-version)
+ (const :tag "Use an existing buffer at the same version"
same-version)))
;;;;;; Entry formatting
diff --git a/tests/test-hyperdrive-org.el b/tests/test-hyperdrive-org.el
index 2b8c30539b..60326df6a3 100644
--- a/tests/test-hyperdrive-org.el
+++ b/tests/test-hyperdrive-org.el
@@ -128,7 +128,8 @@ Point is indicated by ★."
(cl-defun h/test-org-insert-link-string (scenario &key public-key path)
"Return link for SCENARIO inserted into entry with PUBLIC-KEY and PATH."
(declare (indent defun))
- (pcase-let (((map :url :desc) (alist-get scenario
h/test-org-store-link-scenarios)))
+ (pcase-let (((map :url :desc)
+ (alist-get scenario h/test-org-store-link-scenarios)))
(with-temp-buffer
;; TODO: Initialize this buffer only once for this file's tests.
(org-mode)
- [nongnu] elpa/hyperdrive 1e8c2f0973 24/31: Chore: Use semantically correct contitionals, (continued)
- [nongnu] elpa/hyperdrive 1e8c2f0973 24/31: Chore: Use semantically correct contitionals, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 6b9bc701e5 14/31: Chore: Shorten long lines in hd/dir-handler, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 8131f9afbf 16/31: Chore: Shorten long lines in h/history--format-range-entry, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 772cea7acf 15/31: Chore: Shorten long lines in h/diff-file-entries, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive cc4f2caddc 31/31: Change: (h/org--link) Return plist, not alist, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 3b6d5eb3d3 28/31: Docs: Document hyperdrive-gateway-process-type, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive aaf7581df2 10/31: Chore: Spread nested conditions across multiple lines, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 42bd06b68c 29/31: Fix: (h/{start, stop}) Docstrings, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 43ddaf6cd4 30/31: Tidy: (h/gateway-process-type) Improve docstring, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 063e94607c 20/31: Chore: Begin multi-line values of defvar on a new line, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 7db9cc3785 21/31: Chore: Shorten assorted long lines,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 3edc7cc2ea 05/31: Chore: Begin pcase-let*'s BINDINGS on a new line, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive c4c9471144 09/31: Chore: Set one variable per setf and setq-local form, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 285692b095 08/31: Chore: Consistently use setf even if setq would work, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive cd652eb9a2 12/31: Chore: Shorten long lines within comments, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive a806d3d575 11/31: Chore: Break up long lines in the context of keywords arguments, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 8bfe858d12 18/31: Chore: Shorten long lines in h/history, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive c5b75983f5 27/31: Tidy: (h/gateway-process-type) "run" is first arg to hyper-gateway, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 67c49adf70 22/31: Chore: Join some short lines, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive 5f7c75b09e 26/31: Meta: Update changelog with hyperdrive-gateway-process-type, ELPA Syncer, 2023/12/01
- [nongnu] elpa/hyperdrive ee36298f3f 13/31: Chore: Break up long lines involving h/message, ELPA Syncer, 2023/12/01