From b28940a44e41923836fe771ba9845a3e4cdf97e7 Mon Sep 17 00:00:00 2001 From: Spencer Williams Date: Fri, 11 Jul 2025 16:42:34 -0400 Subject: Fix drafts not counted for broken links --- lisp/seam.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/seam.el b/lisp/seam.el index a228f4c..2330b97 100644 --- a/lisp/seam.el +++ b/lisp/seam.el @@ -312,12 +312,13 @@ completion prompt is given to choose the type." seam-note-directory type (concat (when draft "-") slug ".org")))) -(defun seam-get-links-to-file (file) +(defun seam-get-links-to-file (file &optional include-drafts) "Return filename of each note which links to FILE." (cl-loop for file in (remove (expand-file-name file) (seam-note-files-containing-string (format "[[seam:%s]" (file-name-base file)))) - when (or seam-export--include-drafts + when (or include-drafts + seam-export--include-drafts (not (seam-draft-p file))) collect file)) @@ -619,7 +620,7 @@ buffer is killed after deletion." (let ((file (buffer-file-name))) (seam-get-note-type file) ;Error if file isn't a Seam note. (list - (let ((incoming (length (seam-get-links-to-file file)))) + (let ((incoming (length (seam-get-links-to-file file t)))) (and (yes-or-no-p (format "Really %s `%s' and kill buffer%s?" (if delete-by-moving-to-trash -- cgit v1.2.3