[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-jj 8a90a91263 21/58: Refactor vc-jj-dir-extra-header
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-jj 8a90a91263 21/58: Refactor vc-jj-dir-extra-headers |
Date: |
Sat, 15 Mar 2025 07:01:39 -0400 (EDT) |
branch: externals/vc-jj
commit 8a90a912632ca71a4492f3643c208430d9ee00f5
Author: Rudi Schlatte <rudi@constantly.at>
Commit: Wojciech Siewierski <vifon@noreply.codeberg.org>
Refactor vc-jj-dir-extra-headers
Eliminate two layers of nesting: fold one seq-let and one let* into a
top-level pcase-let*
---
vc-jj.el | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/vc-jj.el b/vc-jj.el
index eb39aaca81..bb79c1daf9 100644
--- a/vc-jj.el
+++ b/vc-jj.el
@@ -106,9 +106,11 @@ If the current change is conflicted, divergent or hidden,
also
add a Status header. (We do not check for emptiness of the
current change since the user can see that via the list of files
below the headers anyway.)"
- (let* ((default-directory dir)
- (info (process-lines "jj" "log" "--no-graph" "-r" "@" "-T"
- "concat(
+ (pcase-let* ((default-directory dir)
+ (`( ,change-id ,change-id-short ,commit-id ,commit-id-short
+ ,description ,bookmarks ,conflict ,divergent ,hidden)
+ (process-lines "jj" "log" "--no-graph" "-r" "@" "-T"
+ "concat(
self.change_id().short(), \"\\n\",
self.change_id().shortest(), \"\\n\",
self.commit_id().short(), \"\\n\",
@@ -118,24 +120,21 @@ bookmarks.join(\",\"), \"\\n\",
self.conflict(), \"\\n\",
self.divergent(), \"\\n\",
self.hidden(), \"\\n\"
-)")))
- (seq-let [change-id change-id-short commit-id commit-id-short
- description bookmarks conflict divergent hidden]
- info
- (cl-flet ((fmt (key value &optional prefix)
+)"))
+ (status (concat
+ (when (string= conflict "true") "(conflict)")
+ (when (string= divergent "true") "(divergent)")
+ (when (string= hidden "true") "(hidden)")))
+ (change-id-suffix (substring change-id (length
change-id-short)))
+ (commit-id-suffix (substring commit-id (length
commit-id-short))))
+ (cl-flet ((fmt (key value &optional prefix)
(concat
(propertize (format "% -11s: " key) 'face 'vc-dir-header)
;; there is no header value emphasis face, so we
;; use vc-dir-status-up-to-date for the prefix.
(when prefix (propertize prefix 'face
'vc-dir-status-up-to-date))
(propertize value 'face 'vc-dir-header-value))))
- (let ((status (concat
- (when (string= conflict "true") "(conflict)")
- (when (string= divergent "true") "(divergent)")
- (when (string= hidden "true") "(hidden)")))
- (change-id-suffix (substring change-id (length change-id-short)))
- (commit-id-suffix (substring commit-id (length
commit-id-short))))
- (string-join (seq-remove
+ (string-join (seq-remove
#'null
(list
(fmt "Description" (if (string= description "") "(no
description set)" description))
@@ -143,11 +142,12 @@ self.hidden(), \"\\n\"
(fmt "Commit" commit-id-suffix commit-id-short)
(unless (string= bookmarks "") (fmt "Bookmarks"
bookmarks))
(unless (string= status "")
- ;; open-code this line instead of adding a face
parameter to `fmt'
+ ;; open-code this line instead of adding a
+ ;; `face' parameter to `fmt'
(concat
(propertize (format "% -11s: " "Status") 'face
'vc-dir-header)
(propertize status 'face
'vc-dir-status-warning)))))
- "\n"))))))
+ "\n"))))
(defun vc-jj-working-revision (file)
(when-let ((default-directory (vc-jj-root file)))
- [elpa] externals/vc-jj 23db0c6751 54/58: Use vc-jj-program in vc-push, vc-pull defaults, (continued)
- [elpa] externals/vc-jj 23db0c6751 54/58: Use vc-jj-program in vc-push, vc-pull defaults, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 71a84c08fe 58/58: Add cl-lib dependency, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 616c2aea6f 15/58: Merge #1 and #2: Fix and improve vc-dir, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 290cd89ad8 57/58: Try to make vc-dir more performant, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 56bacbe747 55/58: Remove vc-jj--call-jj, use vc-switches, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 24161b5249 19/58: Differentiate between added and modified files in `vc-jj-state`, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 117c75b740 20/58: Better mode-line indicator, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 5df3902990 33/58: Add .gitignore, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 1ec756866d 39/58: Fix byte-compilation warnings, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj ead089c231 43/58: Use "jj file track" in vc-jj-register, ELPA Syncer, 2025/03/15
- [elpa] externals/vc-jj 8a90a91263 21/58: Refactor vc-jj-dir-extra-headers,
ELPA Syncer <=
- [elpa] externals/vc-jj 3dd1103608 41/58: Show immutable status in vc-dir headers, ELPA Syncer, 2025/03/15