Use 'delete-region' instead of 'delete-line'

The latter requires 'subr'.

Thanks to Kaushal Modi for reporting the bug in issue 2 over at the
GitHub mirror: <https://github.com/protesilaos/denote/issues/2>.
This commit is contained in:
Protesilaos Stavrou 2022-06-08 19:13:44 +03:00
parent 739d485600
commit 0e65f05bbb
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -130,10 +130,10 @@ This heading is appended to a file when another links to it.")
(let ((default-directory (denote-directory)))
(save-excursion
(goto-char (point-min))
(when (re-search-forward denote-link-backlink-heading nil t))
(while (re-search-forward denote-link--backlink-regexp nil t)
(unless (file-exists-p (match-string-no-properties 1))
(delete-line))))))
(when (re-search-forward denote-link-backlink-heading nil t)
(while (re-search-forward denote-link--backlink-regexp nil t)
(unless (file-exists-p (match-string-no-properties 1))
(delete-region (point-at-bol) (point-at-bol 2))))))))
(provide 'denote-link)
;;; denote-link.el ends here