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

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

[elpa] externals/denote 561553db8e 132/355: fix: Use the correct match s


From: ELPA Syncer
Subject: [elpa] externals/denote 561553db8e 132/355: fix: Use the correct match subgroup in `denote-link--find-value`
Date: Sun, 26 Jun 2022 23:58:13 -0400 (EDT)

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

    fix: Use the correct match subgroup in `denote-link--find-value`
    
    Also document that dependence on subgroup in doc strings.
---
 denote-link.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/denote-link.el b/denote-link.el
index ca0668b980..399c12bd53 100644
--- a/denote-link.el
+++ b/denote-link.el
@@ -95,13 +95,19 @@ files."
   "Return value from REGEXP by searching the file."
   (goto-char (point-min))
   (re-search-forward regexp)
-  (match-string-no-properties 3))
+  (match-string-no-properties 1))
 
-(defconst denote-link--title-regexp "^\\(#\\+\\)?\\(title:\\)[\s\t]+\\(.*\\)"
-  "Regular expression for title key and value.")
+(defconst denote-link--title-regexp 
"^\\(?:#\\+\\)?\\(?:title:\\)[\s\t]+\\(?1:.*\\)"
+  "Regular expression for title key and value.
 
-(defconst denote-link--identifier-regexp 
"^.?.?\\b\\(identifier\\|ID\\)\\s-*[:=]\\s-*\"?\\([0-9T]+\\)"
-  "Regular expression for filename key and value.")
+The match that needs to be extracted is explicityly marked as
+group 1.  `denote-link--find-value' uses the group 1 sting.")
+
+(defconst denote-link--identifier-regexp 
"^.?.?\\b\\(?:identifier\\|ID\\)\\s-*[:=]\\s-*\"?\\(?1:[0-9T]+\\)"
+  "Regular expression for filename key and value.
+
+The match that needs to be extracted is explicityly marked as
+group 1.  `denote-link--find-value' uses the group 1 sting.")
 
 (defconst denote-link--link-format-org "[[file:%s][%s (%s)]]"
   "Format of Org link to note.")



reply via email to

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