mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
nit: fix indentation
This commit is contained in:
@ -688,38 +688,38 @@ References from FILE are excluded."
|
|||||||
(shell-command-to-string "rg --pcre2-version"))))
|
(shell-command-to-string "rg --pcre2-version"))))
|
||||||
(let* ((titles (cons (org-roam-node-title node)
|
(let* ((titles (cons (org-roam-node-title node)
|
||||||
(org-roam-node-aliases node)))
|
(org-roam-node-aliases node)))
|
||||||
;; Create temp file for the regex pattern
|
;; Create temp file for the regex pattern
|
||||||
(temp-file (make-temp-file "org-roam-rg-pattern-"))
|
(temp-file (make-temp-file "org-roam-rg-pattern-"))
|
||||||
(rg-command (org-roam-unlinked-references--rg-command titles temp-file)))
|
(rg-command (org-roam-unlinked-references--rg-command titles temp-file)))
|
||||||
;; Use unwind-protect to ensure temp file cleanup even if errors occur
|
;; Use unwind-protect to ensure temp file cleanup even if errors occur
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(let* ((results (split-string (shell-command-to-string rg-command) "\n"))
|
(let* ((results (split-string (shell-command-to-string rg-command) "\n"))
|
||||||
f row col match)
|
f row col match)
|
||||||
(magit-insert-section (unlinked-references)
|
(magit-insert-section (unlinked-references)
|
||||||
(magit-insert-heading "Unlinked References:")
|
(magit-insert-heading "Unlinked References:")
|
||||||
(dolist (line results)
|
(dolist (line results)
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(when (string-match org-roam-unlinked-references-result-re line)
|
(when (string-match org-roam-unlinked-references-result-re line)
|
||||||
(setq f (match-string 1 line)
|
(setq f (match-string 1 line)
|
||||||
row (string-to-number (match-string 2 line))
|
row (string-to-number (match-string 2 line))
|
||||||
col (string-to-number (match-string 3 line))
|
col (string-to-number (match-string 3 line))
|
||||||
match (match-string 4 line))
|
match (match-string 4 line))
|
||||||
(when (and match
|
(when (and match
|
||||||
(not (file-equal-p (org-roam-node-file node) f))
|
(not (file-equal-p (org-roam-node-file node) f))
|
||||||
(member (downcase match) (mapcar #'downcase titles)))
|
(member (downcase match) (mapcar #'downcase titles)))
|
||||||
(magit-insert-section section (org-roam-grep-section)
|
(magit-insert-section section (org-roam-grep-section)
|
||||||
(oset section file f)
|
(oset section file f)
|
||||||
(oset section row row)
|
(oset section row row)
|
||||||
(oset section col col)
|
(oset section col col)
|
||||||
(insert (propertize (format "%s:%s:%s"
|
(insert (propertize (format "%s:%s:%s"
|
||||||
(truncate-string-to-width (file-name-base f) 15 nil nil t)
|
(truncate-string-to-width (file-name-base f) 15 nil nil t)
|
||||||
row col) 'font-lock-face 'org-roam-dim)
|
row col) 'font-lock-face 'org-roam-dim)
|
||||||
" "
|
" "
|
||||||
(org-roam-fontify-like-in-org-mode
|
(org-roam-fontify-like-in-org-mode
|
||||||
(org-roam-unlinked-references-preview-line f row))
|
(org-roam-unlinked-references-preview-line f row))
|
||||||
"\n"))))))
|
"\n"))))))
|
||||||
(insert ?\n)))
|
(insert ?\n)))
|
||||||
;; Clean up temp file - this runs even if an error occurs above
|
;; Clean up temp file - this runs even if an error occurs above
|
||||||
(delete-file temp-file)))))
|
(delete-file temp-file)))))
|
||||||
|
|
||||||
(provide 'org-roam-mode)
|
(provide 'org-roam-mode)
|
||||||
|
Reference in New Issue
Block a user