[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed bf3e832 382/389: Check if subed--cps-overlay exists
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed bf3e832 382/389: Check if subed--cps-overlay exists before trying to update it |
Date: |
Fri, 3 Dec 2021 11:01:03 -0500 (EST) |
branch: elpa/subed
commit bf3e832fbb29582c9bbddebea6582bc635b7f752
Author: Sacha Chua <sacha@sachachua.com>
Commit: Random User <rndusr@posteo.de>
Check if subed--cps-overlay exists before trying to update it
* subed/subed-common.el (subed--update-cps-overlay): Do this only if
the overlay exists. This makes code work even if the overlay has not
been created, as in the case of non-interactive use.
---
subed/subed-common.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/subed/subed-common.el b/subed/subed-common.el
index ebe6795..e53d98e 100644
--- a/subed/subed-common.el
+++ b/subed/subed-common.el
@@ -1286,12 +1286,13 @@ attribute(s)."
"Update the CPS overlay.
This accepts and ignores any number of arguments so that it can
be run in `after-change-functions'."
- (let ((cps (subed-calculate-cps)))
- (when (numberp cps)
- (overlay-put
- subed--cps-overlay
- 'after-string
- (propertize (format " %.1f CPS" cps) 'face 'shadow 'display '(height
0.9))))))
+ (when (overlayp subed--cps-overlay)
+ (let ((cps (subed-calculate-cps)))
+ (when (numberp cps)
+ (overlay-put
+ subed--cps-overlay
+ 'after-string
+ (propertize (format " %.1f CPS" cps) 'face 'shadow 'display '(height
0.9)))))))
(provide 'subed-common)
;;; subed-common.el ends here
- [nongnu] elpa/subed b42f563 378/389: Add audio extensions, (continued)
- [nongnu] elpa/subed b42f563 378/389: Add audio extensions, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6b1a6f2 367/389: Add computing and displaying characters per second, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3ba295b 336/389: Fix "service name too long", ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 961e5eb 343/389: More subed-vtt fixes: require subed-vtt, validate better, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 87b3823 353/389: subed-split-subtitle works at the beginning or end of subtitle text, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3b4b56a 384/389: Merge pull request #49 from sachac/fix-vtt-spaces, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed bee9e63 342/389: subed-vtt: Fix syncing point with player, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 016c6a5 363/389: subed-split-subtitle: Handle more cases, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6164f88 380/389: Keep track of video being played, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 70561f0 381/389: Make hours optional in VTT files, following the spec, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed bf3e832 382/389: Check if subed--cps-overlay exists before trying to update it,
ELPA Syncer <=
- [nongnu] elpa/subed b6e08c2 383/389: Handle spaces in between VTT subtitles, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 564b6fe 386/389: Add preliminary support for comments in VTT files, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed d5751c5 334/389: Change default faces to inherit color values, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 65ed21c 350/389: Add tests/test-subed-vtt.el, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6eba992 376/389: Add ability to proportionally scale subtitles., ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 7d1aa59 385/389: Make timestamp-to-msecs a generic function, ELPA Syncer, 2021/12/03