sachac / subed

subed is a subtitle editor for Emacs
177 stars 16 forks source link

New command subed-split-subtitle splits at point with MPV timestamp #25

Closed sachac closed 3 years ago

sachac commented 3 years ago

This makes it pretty easy to tweak the flow of automatically generated subtitles. =)

rndusr commented 3 years ago

Thank you for contributing so much. Some issues I found, though:

  1. Splitting when point is on the ID or in the timestamps line breaks the subtitle. You need to find out if point is in the subtitle's text and, if not, move it to some default position.

  2. When splitting while point is at the end of the subtitle (C-M-e), I get this error: Wrong type argument: integer-or-marker-p, nil

  3. When splitting while point is on the empty line between two subtitles, the empty line is removed and an empty subtitle is inserted after the next one.

  4. The new subtitle has ID 0. Maybe call subed-regenerate-ids-soon?

sachac commented 3 years ago

Sure, here's a tweak that takes care of detecting if we're in the middle of the text. It also regenerates IDs.

sachac commented 3 years ago

Actually, I'll work on this a little more so that it can split even at the end of the subtitle text. That way, it'll be easier to use subed while transcribing.

rndusr commented 3 years ago

I think it would be better if splitting would never throw an error message.

If point is not on the text, it could move point to the beginning/middle/end of the text.

Or it could do something smart like finding the first newline and split there. But that may not be worth the added complexity.