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

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

[nongnu] elpa/subed 06e9ce9 227/389: Make group in regexp-separator shy


From: ELPA Syncer
Subject: [nongnu] elpa/subed 06e9ce9 227/389: Make group in regexp-separator shy
Date: Fri, 3 Dec 2021 11:00:31 -0500 (EST)

branch: elpa/subed
commit 06e9ce9915bd8dbc6a2d874725a258673af2b7ab
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>

    Make group in regexp-separator shy
---
 subed/subed-srt.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index 8b5e95c..f422ab5 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -41,7 +41,7 @@
 ;;; Parsing
 
 (defconst subed-srt--regexp-timestamp 
"\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\),\\([0-9]+\\)")
-(defconst subed-srt--regexp-separator "\\([[:blank:]]*\n\\)+[[:blank:]]*\n")
+(defconst subed-srt--regexp-separator "\\(?:[[:blank:]]*\n\\)+[[:blank:]]*\n")
 
 (defun subed-srt--timestamp-to-msecs (time-string)
   "Find HH:MM:SS,MS pattern in TIME-STRING and convert it to milliseconds.
@@ -156,7 +156,7 @@ Return point or nil if no subtitle ID could be found."
                (match-found (progn (goto-char (point-min))
                                    (re-search-forward regex nil t))))
           (if match-found
-              (goto-char (match-beginning 3))
+              (goto-char (match-beginning 2))
             (goto-char orig-point)))
       ;; Find one or more blank lines.
       (re-search-forward "\\([[:blank:]]*\n\\)+" nil t)
@@ -165,7 +165,7 @@ Return point or nil if no subtitle ID could be found."
       (let* ((regex (concat "\\(" subed-srt--regexp-separator 
"\\|\\`\\)\\([0-9]+\\)$"))
              (match-found (re-search-backward regex nil t)))
         (when match-found
-          (goto-char (match-beginning 3)))))
+          (goto-char (match-beginning 2)))))
     ;; Make extra sure we're on an ID, return nil if we're not
     (when (looking-at "^\\([0-9]+\\)$")
       (point))))



reply via email to

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