[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 2efc49757e 2/9: subed-save-excursion: go back to poi
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/subed 2efc49757e 2/9: subed-save-excursion: go back to point in more cases |
|
Date: |
Tue, 28 Nov 2023 19:00:19 -0500 (EST) |
branch: elpa/subed
commit 2efc49757eeeb08f8a502e9c588f5608b7ee65b4
Author: Sacha Chua <sacha@sachachua.com>
Commit: Sacha Chua <sacha@sachachua.com>
subed-save-excursion: go back to point in more cases
* subed/subed-common.el (subed-save-excursion): Go back to point.
---
subed/subed-common.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/subed/subed-common.el b/subed/subed-common.el
index a16211bc8a..b1596a84db 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -93,15 +93,19 @@ subtitles) as long the subtitle IDs don't change."
(declare (debug t))
(save-excursion
`(let ((sub-id (subed-subtitle-id))
- (sub-pos (subed-subtitle-relative-point)))
+ (sub-pos (subed-subtitle-relative-point))
+ (pos (point)))
(progn ,@body)
- (subed-jump-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)))))
+ (if sub-id
+ (progn
+ (subed-jump-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)))
+ (goto-char pos)))))
(defmacro subed-for-each-subtitle (beg end reverse &rest body)
"Run BODY for each subtitle between the region specified by BEG and END.
- [nongnu] elpa/subed updated (774e5b3f07 -> a5668700a5), ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed 80ea6f8389 3/9: Mark subed-set-subtitle-comment as interactive., ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed 2efc49757e 2/9: subed-save-excursion: go back to point in more cases,
ELPA Syncer <=
- [nongnu] elpa/subed 8dd38c8b16 8/9: subed-waveform: Allow showing all waveforms, add M-mouse-1 and M-mouse-3, ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed 2709ca293b 4/9: subed-subtitles-sorted-hook: New hook., ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed 94976a262a 5/9: Default to keeping MPV open at the end of the file, ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed 56abe632b0 6/9: Add autoload for subed-tsv-mode, ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed 191f301553 7/9: test-subed-vtt: Add test for sorting from the header., ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed a5668700a5 9/9: 1.2.8: bump version, document news, ELPA Syncer, 2023/11/28
- [nongnu] elpa/subed f73ee618bf 1/9: New function subed-media-file controlled by subed-media-file-functions, ELPA Syncer, 2023/11/28