branch: externals/denote
commit 739d485600eadfa7c026090232308f61066dcc63
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Fix bug about missing point in link de-duplication
---
 denote-link.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/denote-link.el b/denote-link.el
index 5deeb513f4..e36fe6066a 100644
--- a/denote-link.el
+++ b/denote-link.el
@@ -121,9 +121,8 @@ This heading is appended to a file when another links to 
it.")
          (format "* %s\n%s\n\n" heading "# Do not edit; this is for denote.el 
and related")))
       (insert (format "- %s\n" origin-link))
       ;; delete duplicate links
-      (unwind-protect
-          (delete-duplicate-lines heading-point (point-max) nil nil t)
-        (widen)))))
+      (when heading-point
+          (delete-duplicate-lines heading-point (point-max) nil nil t)))))
 
 (defun denote-link-clear-stale-backlinks ()
   "Delete backlinks that no longer point to files."

Reply via email to