prefer mapconcat over string-join (#1502)

This commit is contained in:
Nicholas Vollmer
2021-05-02 04:34:43 -04:00
committed by GitHub
parent f8dd345bd1
commit bc4b7fa409
2 changed files with 5 additions and 8 deletions

View File

@ -419,9 +419,9 @@ References from FILE are excluded."
(let* ((titles (cons (org-roam-node-title node)
(org-roam-node-aliases node)))
(rg-command (concat "rg -o --vimgrep -P -i "
(string-join (mapcar (lambda (glob) (concat "-g " glob))
(org-roam--list-files-search-globs
org-roam-file-extensions)) " ")
(mapconcat (lambda (glob) (concat "-g " glob))
(org-roam--list-files-search-globs org-roam-file-extensions)
" ")
(format " '\\[([^[]]++|(?R))*\\]%s' "
(mapconcat (lambda (title)
(format "|(\\b%s\\b)" (shell-quote-argument title)))

View File

@ -509,9 +509,7 @@ nodes."
(defun org-roam--tags-to-str (tags)
"Convert list of TAGS into a string."
(string-join
(mapcar (lambda (s) (concat "#" s)) tags)
" "))
(mapconcat (lambda (s) (concat "#" s)) tags " "))
(defun org-roam-node--format-entry (node width)
"Formats NODE for display in the results list.
@ -698,8 +696,7 @@ POINT is the point in buffer for the link.
PROPERTIES contains properties about the link."
(magit-insert-section section (org-roam-node-section)
(let ((outline (if-let ((outline (plist-get properties :outline)))
(string-join (mapcar #'org-link-display-format outline)
" > ")
(mapconcat #'org-link-display-format outline " > ")
"Top")))
(insert (concat (propertize (org-roam-node-title source-node)
'font-lock-face 'org-roam-title)