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

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

[nongnu] elpa/subed dbc8394 222/389: Prevent extra goto-char when jumpin


From: ELPA Syncer
Subject: [nongnu] elpa/subed dbc8394 222/389: Prevent extra goto-char when jumping to specific subtitle ID
Date: Fri, 3 Dec 2021 11:00:30 -0500 (EST)

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

    Prevent extra goto-char when jumping to specific subtitle ID
---
 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 acc90f7..8b5e95c 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -155,9 +155,9 @@ Return point or nil if no subtitle ID could be found."
                (regex (format "\\(%s\\|\\`\\)\\(%d\\)$" 
subed-srt--regexp-separator sub-id))
                (match-found (progn (goto-char (point-min))
                                    (re-search-forward regex nil t))))
-          (goto-char orig-point)
-          (when match-found
-            (goto-char (match-beginning 3))))
+          (if match-found
+              (goto-char (match-beginning 3))
+            (goto-char orig-point)))
       ;; Find one or more blank lines.
       (re-search-forward "\\([[:blank:]]*\n\\)+" nil t)
       ;; Find two or more blank lines or the beginning of the buffer, followed



reply via email to

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