Skip to content

Commit

Permalink
Use mapcan instead of cl-mapcan
Browse files Browse the repository at this point in the history
This was added in Emacs 26.1.
  • Loading branch information
tarsius committed Nov 23, 2024
1 parent 381da7b commit 00e0540
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion borg-elpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(directory-file-name borg-drones-directory))
(unless (featurep 'epkg)
(let ((load-path
(nconc (cl-mapcan
(nconc (mapcan
(lambda (name)
(let ((dir (expand-file-name name borg-drones-directory)))
(if (file-directory-p dir)
Expand Down
24 changes: 12 additions & 12 deletions borg.el
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ containing org, texinfo and/or info files. Otherwise return a
list of directories containing a file named \"dir\"."
(let ((repo (borg-worktree clone))
(path (borg-get-all clone "info-path")))
(cl-mapcan
(mapcan
(if setup
(lambda (d)
(setq d (file-name-as-directory d))
Expand Down Expand Up @@ -373,22 +373,22 @@ the overall return value."
;; If "git submodule" gets a list command, we
;; might want to start using that. See #131.
(let ((offset (length prefix)))
(cl-mapcan (lambda (line)
(pcase-let ((`(,mode ,_ ,_ ,file) (split-string line)))
(and (equal mode "160000")
(list (substring file offset)))))
(process-lines "git" "ls-files" "-s"))))))
(mapcan (lambda (line)
(pcase-let ((`(,mode ,_ ,_ ,file) (split-string line)))
(and (equal mode "160000")
(list (substring file offset)))))
(process-lines "git" "ls-files" "-s"))))))

(defun borg-clones ()
"Return a list of cloned packages.
The returned value includes the names of all packages that were
cloned into `borg-drones-directory', including clones that have
not been assimilated yet."
(cl-mapcan (lambda (file)
(and (file-directory-p file)
(list (file-name-nondirectory file))))
(directory-files borg-drones-directory t "\\`[^.]")))
(mapcan (lambda (file)
(and (file-directory-p file)
(list (file-name-nondirectory file))))
(directory-files borg-drones-directory t "\\`[^.]")))

(defun borg-read-package (prompt &optional edit-url)
"Read a package name and URL, and return them as a list.
Expand Down Expand Up @@ -760,7 +760,7 @@ and optional NATIVE are both non-nil, then also compile natively."
(excludes (nconc
(mapcar #'expand-file-name
(borg-get-all clone "no-byte-compile"))
(cl-mapcan
(mapcan
(lambda (dir)
(list (expand-file-name (concat clone "-pkg.el") dir)
(expand-file-name (concat clone "-test.el") dir)
Expand Down Expand Up @@ -954,7 +954,7 @@ doesn't do anything."
(let ((repo (borg-worktree clone))
(exclude (borg-get-all clone "no-maketexi")))
(dolist (file (or files
(cl-mapcan
(mapcan
(lambda (dir)
(directory-files
dir t (format borg-maketexi-filename-regexp clone)))
Expand Down

0 comments on commit 00e0540

Please sign in to comment.