[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed aecaf3d 309/389: Better support for fill-paragraph
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed aecaf3d 309/389: Better support for fill-paragraph |
Date: |
Fri, 3 Dec 2021 11:00:47 -0500 (EST) |
branch: elpa/subed
commit aecaf3deca964dd35f282f1798d493da47d6fb1e
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>
Better support for fill-paragraph
---
subed/subed-srt.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/subed/subed-srt.el b/subed/subed-srt.el
index 6561140..df075de 100644
--- a/subed/subed-srt.el
+++ b/subed/subed-srt.el
@@ -550,8 +550,22 @@ scheduled call is canceled and another call is scheduled in
"This function is called when subed-mode is entered for a SRT file."
(setq-local subed--subtitle-format "srt")
(setq-local font-lock-defaults '(subed-srt-font-lock-keywords))
- (setq-local paragraph-start "^[[:alnum:]\n]+")
- (setq-local paragraph-separate "\n\n"))
+ ;; Support for fill-paragraph (M-q)
+ (let ((timestamps-regexp (concat subed-srt--regexp-timestamp
+ " *--> *"
+ subed-srt--regexp-timestamp)))
+ (setq-local paragraph-separate (concat "^\\("
+ (mapconcat 'identity
`("[[:blank:]]*"
+
"[[:digit:]]+"
+
,timestamps-regexp) "\\|")
+ "\\)$"))
+ (setq-local paragraph-start (concat "\\("
+ ;; Mulitple speakers in the same
+ ;; subtitle are often distinguished
with
+ ;; a "-" at the start of the line.
+ (mapconcat 'identity '("^-"
+
"[[:graph:]]*$") "\\|")
+ "\\)"))))
(provide 'subed-srt)
;;; subed-srt.el ends here
- [nongnu] elpa/subed d87e2cd 290/389: Add save-place-local-mode to example config, (continued)
- [nongnu] elpa/subed d87e2cd 290/389: Add save-place-local-mode to example config, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e7ae26e 292/389: Add target: clean, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 73e11d4 291/389: Define subed-mode as derived mode, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed df96747 297/389: Rename subed-mpv--handle-event -> subed-mpv--client-handle-event, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 4ef1646 298/389: subed-mpv-find-video: Kill previous mpv instance if existing, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 0872ab7 299/389: Remove "subed-mode enabled" message, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 6215cb1 300/389: Add test-compile target, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 9078a46 303/389: subed-srt--validate: Don't complain if buffer contains only whitespace, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed f2f11ca 305/389: subed-mpv-find-video: Gracefully handle new file, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed fabc7dc 306/389: Move function around, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed aecaf3d 309/389: Better support for fill-paragraph,
ELPA Syncer <=
- [nongnu] elpa/subed d34bdec 310/389: Fix mismatched parens in example config, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 66889a1 311/389: Fix test: Renumbering does not modify the kill-ring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed e1fd29b 312/389: subed-srt--regenerate-ids: Do not modify empty buffer, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ca015d4 313/389: Fix one compile warning, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 317c411 314/389: Remove declarations, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 72020af 315/389: Use long options, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed be43268 316/389: Fix test-compile target, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3753706 318/389: Fix warning about missing function: subed-mpv--sub-add-after-save, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 473fbc2 319/389: subed-srt--subtitle-text: Improve docstring, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 05ba952 320/389: Only add subtitles file if subed-subtitle-id returns non-nil, ELPA Syncer, 2021/12/03