emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote c9926a528e 133/355: perf: Stop searching for the


From: ELPA Syncer
Subject: [elpa] externals/denote c9926a528e 133/355: perf: Stop searching for the title or identifier after the 1st match
Date: Sun, 26 Jun 2022 23:58:14 -0400 (EDT)

branch: externals/denote
commit c9926a528e1571d126240fa630331e3d5425b7b6
Author: Kaushal Modi <kaushal.modi@gmail.com>
Commit: Kaushal Modi <kaushal.modi@gmail.com>

    perf: Stop searching for the title or identifier after the 1st match
    
    This also avoids any false matches with that regexp further down in
    the note content.
---
 denote-link.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/denote-link.el b/denote-link.el
index 399c12bd53..75eb13f68d 100644
--- a/denote-link.el
+++ b/denote-link.el
@@ -94,7 +94,7 @@ files."
 (defun denote-link--find-value (regexp)
   "Return value from REGEXP by searching the file."
   (goto-char (point-min))
-  (re-search-forward regexp)
+  (re-search-forward regexp nil nil 1) ;Stop search after the first match
   (match-string-no-properties 1))
 
 (defconst denote-link--title-regexp 
"^\\(?:#\\+\\)?\\(?:title:\\)[\s\t]+\\(?1:.*\\)"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]