diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-12-09 22:46:25 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-12-09 22:46:25 -0500 |
commit | c1a32ad031d6a5fc7dc644fcfc442c3c9a6e107c (patch) | |
tree | da21e24a057dfde16817ab01fa89fd1924d0e84b /emacsconf-subed.el | |
parent | 923de3f273dd82f52072cffcb9a84737fc287f7f (diff) | |
download | emacsconf-el-c1a32ad031d6a5fc7dc644fcfc442c3c9a6e107c.tar.xz emacsconf-el-c1a32ad031d6a5fc7dc644fcfc442c3c9a6e107c.zip |
code for adding questions to the Q&A transcript
Diffstat (limited to 'emacsconf-subed.el')
-rw-r--r-- | emacsconf-subed.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/emacsconf-subed.el b/emacsconf-subed.el index b219a6a..ec02a9d 100644 --- a/emacsconf-subed.el +++ b/emacsconf-subed.el @@ -29,8 +29,8 @@ (require 'subed) -(defcustom emacsconf-subed-subtitle-max-length 60 - "Target number of characters." +(defcustom emacsconf-subed-subtitle-max-length nil + "Target number of characters. Default to `fill-column'." :group 'emacsconf :type 'integer) @@ -123,7 +123,7 @@ TYPE can be 'end if you want the match end instead of the beginning." (defun emacsconf-reflow-automatically () (interactive) - (let* ((subtitle-text-limit emacsconf-subed-subtitle-max-length) + (let* ((subtitle-text-limit (or emacsconf-subed-subtitle-max-length fill-column)) (auto-space-msecs 700) (subtitles (mapconcat @@ -287,7 +287,7 @@ Create it if necessary." "Do some simple validation of subtitles." (interactive) (while (not (eobp)) - (if (> (length (subed-subtitle-text)) emacsconf-subed-subtitle-max-length) + (if (> (length (subed-subtitle-text)) (or emacsconf-subed-subtitle-max-length fill-column)) (error "Length %d exceeds maximum length" (length (subed-subtitle-text)))) (if (< (- (subed-subtitle-msecs-stop) (subed-subtitle-msecs-start)) emacsconf-subed-subtitle-minimum-duration-ms) (error "Duration %d is less than minimum" (- (subed-subtitle-msecs-stop) (subed-subtitle-msecs-start)))) |