diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2020-08-28 19:39:00 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2020-09-08 12:21:22 +0200 |
| commit | 98421882e920955a8ad59bea6dacc4c043340714 (patch) | |
| tree | c61c8a7ad56eca533f87320b786abc3569eee744 | |
| parent | 4a8aed9458b5d795363571d2f8deef08e70b4e4e (diff) | |
Use seq-some instead of -some
The former is available since Emacs 25.1.
| -rw-r--r-- | lisp/git-rebase.el | 10 | ||||
| -rw-r--r-- | lisp/magit-clone.el | 2 | ||||
| -rw-r--r-- | lisp/magit-git.el | 37 | ||||
| -rw-r--r-- | lisp/magit-mode.el | 12 | ||||
| -rw-r--r-- | lisp/magit-repos.el | 6 | ||||
| -rw-r--r-- | lisp/magit-section.el | 6 |
6 files changed, 37 insertions, 36 deletions
diff --git a/lisp/git-rebase.el b/lisp/git-rebase.el index 3d635c8..886fbbb 100644 --- a/lisp/git-rebase.el +++ b/lisp/git-rebase.el @@ -309,11 +309,11 @@ instance with all nil values is returned." (goto-char (line-beginning-position)) (if-let ((re-start (concat "^\\(?5:" (regexp-quote comment-start) "\\)? *")) - (type (-some (lambda (arg) - (let ((case-fold-search nil)) - (and (looking-at (concat re-start (cdr arg))) - (car arg)))) - git-rebase-line-regexps))) + (type (seq-some (lambda (arg) + (let ((case-fold-search nil)) + (and (looking-at (concat re-start (cdr arg))) + (car arg)))) + git-rebase-line-regexps))) (git-rebase-action :action-type type :action (when-let ((action (match-string-no-properties 1))) diff --git a/lisp/magit-clone.el b/lisp/magit-clone.el index c08a6de..3dd4b48 100644 --- a/lisp/magit-clone.el +++ b/lisp/magit-clone.el @@ -260,7 +260,7 @@ Then show the status buffer for the new repository." (match-string 1 url))) (defun magit-clone--name-to-url (name) - (or (-some + (or (seq-some (pcase-lambda (`(,re ,host ,user)) (and (string-match re name) (let ((repo (match-string 1 name))) diff --git a/lisp/magit-git.el b/lisp/magit-git.el index 6fafc97..63e0d4a 100644 --- a/lisp/magit-git.el +++ b/lisp/magit-git.el @@ -1509,30 +1509,31 @@ The returned value has the form (REMOTE . REF), where REMOTE is the name of a remote and REF is the ref local to the remote." (when-let ((ref (magit-ref-fullname refname))) (save-match-data - (-some (lambda (line) - (and (string-match "\ + (seq-some (lambda (line) + (and (string-match "\ \\`remote\\.\\([^.]+\\)\\.fetch=\\+?\\([^:]+\\):\\(.+\\)" line) - (let ((rmt (match-string 1 line)) - (src (match-string 2 line)) - (dst (match-string 3 line))) - (and (string-match (format "\\`%s\\'" - (replace-regexp-in-string - "*" "\\(.+\\)" dst t t)) - ref) - (cons rmt (replace-regexp-in-string - "*" (match-string 1 ref) src)))))) - (magit-git-lines "config" "--local" "--list"))))) + (let ((rmt (match-string 1 line)) + (src (match-string 2 line)) + (dst (match-string 3 line))) + (and (string-match (format "\\`%s\\'" + (replace-regexp-in-string + "*" "\\(.+\\)" dst t t)) + ref) + (cons rmt (replace-regexp-in-string + "*" (match-string 1 ref) src)))))) + (magit-git-lines "config" "--local" "--list"))))) (defun magit-split-branch-name (branch) (cond ((member branch (magit-list-local-branch-names)) (cons "." branch)) ((string-match "/" branch) - (or (-some (lambda (remote) - (and (string-match (format "\\`\\(%s\\)/\\(.+\\)\\'" remote) - branch) - (cons (match-string 1 branch) - (match-string 2 branch)))) - (magit-list-remotes)) + (or (seq-some (lambda (remote) + (and (string-match + (format "\\`\\(%s\\)/\\(.+\\)\\'" remote) + branch) + (cons (match-string 1 branch) + (match-string 2 branch)))) + (magit-list-remotes)) (error "Invalid branch name %s" branch))))) (defun magit-get-current-tag (&optional rev with-distance) diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el index 15090aa..2d2f0d8 100644 --- a/lisp/magit-mode.el +++ b/lisp/magit-mode.el @@ -847,13 +847,13 @@ If a frame, then only consider buffers on that frame." (w (window) (b (window-buffer window))) (f (frame) - (-some #'w (window-list frame 'no-minibuf)))) + (seq-some #'w (window-list frame 'no-minibuf)))) (pcase-exhaustive frame - (`nil (-some #'b (buffer-list))) - (`all (-some #'f (frame-list))) - (`visible (-some #'f (visible-frame-list))) - ((or `selected `t) (-some #'w (window-list (selected-frame)))) - ((guard (framep frame)) (-some #'w (window-list frame))))) + (`nil (seq-some #'b (buffer-list))) + (`all (seq-some #'f (frame-list))) + (`visible (seq-some #'f (visible-frame-list))) + ((or `selected `t) (seq-some #'w (window-list (selected-frame)))) + ((guard (framep frame)) (seq-some #'w (window-list frame))))) (magit--not-inside-repository-error))) (defun magit-mode-get-buffer (mode &optional create frame value) diff --git a/lisp/magit-repos.el b/lisp/magit-repos.el index b59de62..b23d86a 100644 --- a/lisp/magit-repos.el +++ b/lisp/magit-repos.el @@ -222,9 +222,9 @@ By default this indicates whether there are uncommitted changes. - U if there is at least one unstaged file. - S if there is at least one staged file. Only one letter is shown, the first that applies." - (-some (pcase-lambda (`(,fun . ,flag)) - (and (funcall fun) flag)) - magit-repolist-column-flag-alist)) + (seq-some (pcase-lambda (`(,fun . ,flag)) + (and (funcall fun) flag)) + magit-repolist-column-flag-alist)) (defun magit-repolist-column-unpulled-from-upstream (_id) "Insert number of upstream commits not in the current branch." diff --git a/lisp/magit-section.el b/lisp/magit-section.el index cabdea4..70e6f82 100644 --- a/lisp/magit-section.el +++ b/lisp/magit-section.el @@ -971,9 +971,9 @@ at point." (defun magit-section-match-assoc (section alist) "Return the value associated with SECTION's type or lineage in ALIST." - (-some (pcase-lambda (`(,key . ,val)) - (and (magit-section-match-1 key section) val)) - alist)) + (seq-some (pcase-lambda (`(,key . ,val)) + (and (magit-section-match-1 key section) val)) + alist)) ;;; Create |
