branch: elpa/subed commit dbc839420e6bba2dcf1afcaba69a6f201dca75bd Author: Random User <rnd...@posteo.de> Commit: Random User <rnd...@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