branch: elpa/magit
commit c12edf22449a22b364ce316e8fab93be7f573c77
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Use ## and seq-some instead of --some
In two cases use lambda, not ##.
---
lisp/magit-blame.el | 4 ++--
lisp/magit-git.el | 8 ++++----
lisp/magit-log.el | 6 +++---
lisp/magit-process.el | 29 +++++++++++++++--------------
lisp/magit-remote.el | 2 +-
lisp/magit-sequence.el | 2 +-
lisp/magit-status.el | 13 +++++++------
7 files changed, 33 insertions(+), 31 deletions(-)
diff --git a/lisp/magit-blame.el b/lisp/magit-blame.el
index 7278173208e..a7ec31d730b 100644
--- a/lisp/magit-blame.el
+++ b/lisp/magit-blame.el
@@ -277,8 +277,8 @@ Also see option `magit-blame-styles'."
((error "Buffer does not visit a tracked file")))))))
(defun magit-blame-chunk-at (pos)
- (--some (overlay-get it 'magit-blame-chunk)
- (overlays-at pos)))
+ (seq-some (##overlay-get % 'magit-blame-chunk)
+ (overlays-at pos)))
(defun magit-blame--overlay-at (&optional pos key)
(unless pos
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 2ea9f8768e4..a7c37afdd41 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1702,10 +1702,10 @@ according to the branch type."
(and remote (not (equal remote "."))
;; The user has opted in...
(or force
- (--some (if (magit-git-success "check-ref-format" "--branch" it)
- (equal it branch)
- (string-match-p it branch))
- magit-branch-prefer-remote-upstream))
+ (seq-some (##if (magit-git-success "check-ref-format" "--branch"
%)
+ (equal % branch)
+ (string-match-p % branch))
+ magit-branch-prefer-remote-upstream))
;; and local BRANCH tracks a remote branch...
(let ((upstream (magit-get-upstream-branch branch)))
;; whose upstream...
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index 14a774a31ba..1113697ef44 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -1143,9 +1143,9 @@ Type \\[magit-reset] to reset `HEAD' to the commit at
point.
" in reverse")
(and files (concat " touching "
(string-join files " ")))
- (--some (and (string-prefix-p "-L" it)
- (concat " " it))
- args)))
+ (seq-some (##and (string-prefix-p "-L" %)
+ (concat " " %))
+ args)))
(defun magit-insert-log (revs &optional args files)
(declare (obsolete magit--insert-log "Magit 4.0.0"))
diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index f5d5559ed3f..408ccef77df 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -106,21 +106,22 @@ displays the text of `magit-process-error-summary'
instead."
integer))
(defcustom magit-credential-cache-daemon-socket
- (--some (pcase-let ((`(,prog . ,args) (split-string it)))
- (if (and prog
+ (seq-some (lambda (line)
+ (pcase-let ((`(,prog . ,args) (split-string line)))
+ (and prog
(string-match-p
- "\\`\\(?:\\(?:/.*/\\)?git-credential-\\)?cache\\'" prog))
- (or (cl-loop for (opt val) on args
- if (string= opt "--socket")
- return val)
- (expand-file-name "~/.git-credential-cache/socket"))))
- ;; Note: `magit-process-file' is not yet defined when
- ;; evaluating this form, so we use `process-lines'.
- (ignore-errors
- (let ((process-environment
- (append magit-git-environment process-environment)))
- (process-lines magit-git-executable
- "config" "--get-all" "credential.helper"))))
+ "\\`\\(?:\\(?:/.*/\\)?git-credential-\\)?cache\\'" prog)
+ (or (cl-loop for (opt val) on args
+ if (string= opt "--socket")
+ return val)
+ (expand-file-name
"~/.git-credential-cache/socket")))))
+ ;; Note: `magit-process-file' is not yet defined when
+ ;; evaluating this form, so we use `process-lines'.
+ (ignore-errors
+ (let ((process-environment
+ (append magit-git-environment process-environment)))
+ (process-lines magit-git-executable
+ "config" "--get-all" "credential.helper"))))
"If non-nil, start a credential cache daemon using this socket.
When using Git's cache credential helper in the normal way, Emacs
diff --git a/lisp/magit-remote.el b/lisp/magit-remote.el
index 0196604cd99..787e51b2835 100644
--- a/lisp/magit-remote.el
+++ b/lisp/magit-remote.el
@@ -179,7 +179,7 @@ the now stale refspecs. Other stale branches are not
removed."
(ours (match-string 3 refspec)))
(unless (if (string-match "\\*" theirs)
(let ((re (replace-match ".*" t t theirs)))
- (--some (string-match-p re it) remote-refs))
+ (seq-some (##string-match-p re %) remote-refs))
(member theirs remote-refs))
(push (cons refspec
(if (string-match "\\*" ours)
diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el
index 8df84f4bc79..530e44363b8 100644
--- a/lisp/magit-sequence.el
+++ b/lisp/magit-sequence.el
@@ -690,7 +690,7 @@ START has to be selected from a list of recent commits."
(when (and commit (not noassert))
(setq commit (magit-rebase-interactive-assert
commit delay-edit-confirm
- (--some (string-prefix-p "--rebase-merges" it) args))))
+ (seq-some (##string-prefix-p "--rebase-merges" %) args))))
(if (and commit (not confirm))
(let ((process-environment process-environment))
(when editor
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index 0dbfbf9fb78..182130e5208 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -482,12 +482,13 @@ Type \\[magit-commit] to create a commit.
(defun magit-status-goto-initial-section ()
"Jump to the section specified by `magit-status-initial-section'."
(when-let ((section
- (--some (if (integerp it)
- (nth (1- it)
- (magit-section-siblings (magit-current-section)
- 'next))
- (magit-get-section it))
- magit-status-initial-section)))
+ (seq-some (lambda (initial)
+ (if (integerp initial)
+ (nth (1- initial)
+ (magit-section-siblings
+ (magit-current-section) 'next))
+ (magit-get-section initial)))
+ magit-status-initial-section)))
(goto-char (oref section start))
(when-let ((vis (cdr (assq 'magit-status-initial-section
magit-section-initial-visibility-alist))))