branch: externals/denote
commit d509565e6b1c9e7194abec36cf8004eee940d37e
Merge: 444db90dab f42b6d663b
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: GitHub <nore...@github.com>

    Merge pull request #637 from dizzyyogi/gh_issue_636_dizzyyogi
    
    Check in denote--file-has-backlinks-p whether link matches file id
---
 denote.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/denote.el b/denote.el
index 7820dac31a..e6628f19fb 100644
--- a/denote.el
+++ b/denote.el
@@ -6050,8 +6050,12 @@ Also see `denote-get-links'."
           (with-temp-buffer
             (insert-file-contents file)
             (goto-char (point-min))
-            (when (re-search-forward link-regexp nil t)
-              (throw 'has-backlinks t))))))))
+            (while (re-search-forward link-regexp nil t)
+              (when
+                  (string-equal
+                   (caar (denote--inside-link-regexp-p link-regexp (point)))
+                   id)
+                (throw 'has-backlinks t)))))))))
 
 ;;;###autoload
 (defun denote-find-backlink ()

Reply via email to