emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]