branch: elpa/magit commit 59ba18a060ad2075a9d34aea9064e2d62f1cd752 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Use ## and seq-some instead of --any-p --- lisp/magit-diff.el | 18 +++++++++--------- lisp/magit-log.el | 9 ++++----- lisp/magit-process.el | 6 +++--- lisp/magit-section.el | 10 +++++----- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 1bc7385dd42..a573c7f6c4c 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -1544,12 +1544,12 @@ instead." t)) (defun magit-diff-ignore-any-space-p () - (--any-p (member it magit-buffer-diff-args) - '("--ignore-cr-at-eol" - "--ignore-space-at-eol" - "--ignore-space-change" "-b" - "--ignore-all-space" "-w" - "--ignore-blank-space"))) + (seq-some (##member % magit-buffer-diff-args) + '("--ignore-cr-at-eol" + "--ignore-space-at-eol" + "--ignore-space-change" "-b" + "--ignore-all-space" "-w" + "--ignore-blank-space"))) (defun magit-diff-toggle-refine-hunk (&optional style) "Turn diff-hunk refining on or off. @@ -1963,13 +1963,13 @@ commit or stash at point, then prompt for a commit." ((derived-mode-p 'magit-diff-mode) (seq-filter #'magit-file-section-p (oref magit-root-section children)))))) - (if (--any-p (oref it hidden) sections) + (if (seq-some (##oref % hidden) sections) (dolist (s sections) (magit-section-show s) (magit-section-hide-children s)) (let ((children (mapcan (##oref % children) sections))) - (cond ((and (--any-p (oref it hidden) children) - (--any-p (oref it children) children)) + (cond ((and (seq-some (##oref % hidden) children) + (seq-some (##oref % children) children)) (mapc #'magit-section-show-headings sections)) ((seq-some #'magit-section-hidden-body children) (mapc #'magit-section-show-children sections)) diff --git a/lisp/magit-log.el b/lisp/magit-log.el index fe03f9b402e..14a774a31ba 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -1073,9 +1073,8 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (unless (length= files 1) (setq args (remove "--follow" args))) (when (and (car magit-log-remove-graph-args) - (--any-p (string-match-p - (concat "^" (regexp-opt magit-log-remove-graph-args)) it) - args)) + (let ((re (concat "^" (regexp-opt magit-log-remove-graph-args)))) + (seq-some (##string-match-p re %) args))) (setq args (remove "--graph" args))) (setq args (magit-log--maybe-drop-color-graph args limit)) (when-let* ((limit limit) @@ -1087,8 +1086,8 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (not (member revs '("--all" "--branches"))) (not (seq-some (lambda (arg) - (--any-p (string-prefix-p it arg) - magit-log-disable-graph-hack-args)) + (seq-some (##string-prefix-p % arg) + magit-log-disable-graph-hack-args)) args)) (magit-git-string "rev-list" "--count" "--first-parent" args revs)))) diff --git a/lisp/magit-process.el b/lisp/magit-process.el index 296b4aa2239..f5d5559ed3f 100644 --- a/lisp/magit-process.el +++ b/lisp/magit-process.el @@ -998,7 +998,7 @@ from the user." (defun magit-process-match-prompt (prompts string) "Match STRING against PROMPTS and set match data. Return the matched string, appending \": \" if needed." - (when (--any-p (string-match it string) prompts) + (when (seq-some (##string-match % string) prompts) (let ((prompt (match-string 0 string))) (cond ((string-suffix-p ": " prompt) prompt) ((string-suffix-p ":" prompt) (concat prompt " ")) @@ -1264,8 +1264,8 @@ Limited by `magit-process-error-tooltip-max-lines'." (delete-char -1) (oset section content nil)) (when (and (= exit-code 0) - (not (--any-p (eq (window-buffer it) buffer) - (window-list)))) + (not (seq-some (##eq (window-buffer %) buffer) + (window-list)))) (magit-section-hide section))))) (defun magit-process-display-buffer (process) diff --git a/lisp/magit-section.el b/lisp/magit-section.el index 6375e8f7b87..339c1b625e4 100644 --- a/lisp/magit-section.el +++ b/lisp/magit-section.el @@ -972,7 +972,7 @@ With a prefix argument also expand it." heading) "Toggle visibility of bodies of children of the current section." (interactive (list (magit-current-section))) (let* ((children (oref section children)) - (show (--any-p (oref it hidden) children))) + (show (seq-some (##oref % hidden) children))) (dolist (c children) (oset c hidden show))) (magit-section-show section)) @@ -1036,8 +1036,8 @@ global map, this involves advising `tab-bar--define-keys'." (magit-section-show section) (magit-section-hide-children section)) ((let ((children (oref section children))) - (cond ((and (--any-p (oref it hidden) children) - (--any-p (oref it children) children)) + (cond ((and (seq-some (##oref % hidden) children) + (seq-some (##oref % children) children)) (magit-section-show-headings section)) ((seq-some #'magit-section-hidden-body children) (magit-section-show-children section)) @@ -1047,8 +1047,8 @@ global map, this involves advising `tab-bar--define-keys'." "Cycle visibility of all sections in the current buffer." (interactive) (let ((children (oref magit-root-section children))) - (cond ((and (--any-p (oref it hidden) children) - (--any-p (oref it children) children)) + (cond ((and (seq-some (##oref % hidden) children) + (seq-some (##oref % children) children)) (magit-section-show-headings magit-root-section)) ((seq-some #'magit-section-hidden-body children) (magit-section-show-children magit-root-section))