branch: externals/denote
commit fa8bda2cab386b7bac7452eb58ea480489147e12
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Use denote-link-markdown-follow only if there is a link
    
    Otherwise, we are breaking general markdown-mode functionality.
    
    Thanks to pmenair for bringing this matter to my attention in issue
    290: <https://github.com/protesilaos/denote/issues/290>.
---
 README.org | 2 +-
 denote.el  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 944ec0be2c..aaa4da9e01 100644
--- a/README.org
+++ b/README.org
@@ -5339,7 +5339,7 @@ Denote is meant to be a collective effort.  Every bit of 
help matters.
   Monnier, Stefan Thesing, Thibaut Benjamin, Tomasz Hołubowicz, Vedang
   Manerikar, Wesley Harvey, Zhenxu Xu, arsaber101, ezchi, jarofromel,
   leinfink (Henrik), l-o-l-h (Lincoln), mattyonweb, maxbrieiev,
-  mentalisttraceur, relict007.
+  mentalisttraceur, pmenair, relict007.
 
 + Ideas and/or user feedback :: Abin Simon, Aditya Yadav, Alan
   Schmitt, Aleksandr Vityazev, Alex Hirschfeld, Alfredo Borrás, Ashton
diff --git a/denote.el b/denote.el
index 43e21aa37a..6b14ac498a 100644
--- a/denote.el
+++ b/denote.el
@@ -3954,9 +3954,9 @@ positions, limit the process to the region in-between."
 (defun denote-link-markdown-follow (link)
   "Function to open Denote file present in LINK.
 To be assigned to `markdown-follow-link-functions'."
-  (string-match denote-id-regexp link)
-  (funcall denote-link-button-action
-           (denote-get-path-by-id (match-string 0 link))))
+  (when (ignore-errors (string-match denote-id-regexp link))
+    (funcall denote-link-button-action
+             (denote-get-path-by-id (match-string 0 link)))))
 
 (eval-after-load 'markdown-mode
   '(add-hook 'markdown-follow-link-functions #'denote-link-markdown-follow))

Reply via email to