From c1a32ad031d6a5fc7dc644fcfc442c3c9a6e107c Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Fri, 9 Dec 2022 22:46:25 -0500 Subject: code for adding questions to the Q&A transcript --- emacsconf-subed.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'emacsconf-subed.el') 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)))) -- cgit v1.2.3