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

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

[nongnu] elpa/subed fd737b7 035/389: Use save-excursion in subed--save-e


From: ELPA Syncer
Subject: [nongnu] elpa/subed fd737b7 035/389: Use save-excursion in subed--save-excursion
Date: Fri, 3 Dec 2021 10:59:52 -0500 (EST)

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

    Use save-excursion in subed--save-excursion
---
 subed/subed.el | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/subed/subed.el b/subed/subed.el
index f94f887..6935914 100644
--- a/subed/subed.el
+++ b/subed/subed.el
@@ -369,16 +369,17 @@ buffer."
   "Restore relative point within current subtitle after executing BODY.
 This also works if the buffer changes as long the subtitle IDs
 don't change."
-  `(let ((sub-id (subed--subtitle-id))
-         (sub-pos (subed--subtitle-relative-point)))
-     (progn ,@body)
-     (subed-move-to-subtitle-id sub-id)
-     ;; Subtitle text may have changed and we may not be able to move to the
-     ;; exact original position
-     (condition-case nil
-         (forward-char sub-pos)
-       ('beginning-of-buffer nil)
-       ('end-of-buffer nil))))
+  (save-excursion
+    `(let ((sub-id (subed--subtitle-id))
+           (sub-pos (subed--subtitle-relative-point)))
+       (progn ,@body)
+       (subed-move-to-subtitle-id sub-id)
+       ;; Subtitle text may have changed and we may not be able to move to the
+       ;; exact original position
+       (condition-case nil
+           (forward-char sub-pos)
+         ('beginning-of-buffer nil)
+         ('end-of-buffer nil)))))
 
 (defun subed-guess-video-file ()
   "Return path to video if replacing the buffer file name's



reply via email to

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