branch: elpa/subed commit 300341a7a35b78ee0bbd94a0b9c48b8618b220a6 Author: Random User <rnd...@posteo.de> Commit: Random User <rnd...@posteo.de>
subed-guess-video-file: Elaborate docstring --- subed/subed.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/subed/subed.el b/subed/subed.el index cfcd0e0..eb7601d 100644 --- a/subed/subed.el +++ b/subed/subed.el @@ -634,10 +634,14 @@ and therefore gets ARGS, which is ignored." (defun subed-guess-video-file () "Find video file with same base name as the opened file in the buffer. -The file extension of the function `buffer-file-name' is replaced -with each item in `subed-video-extensions' and the first existing -file is returned. It also checks for an existing video file with -the base name stripped from an eventual language code. +The file extension of the return value of the function +`buffer-file-name' is replaced with each item in +`subed-video-extensions' and the first existing file is returned. + +Language codes are also handled; e.g. \"foo.en.srt\" or +\"foo.estonian.srt\" -> \"foo.{mkv,mp4,...}\" (this actually +simply removes the extension from the extension-stripped file +name). Return nil if function `buffer-file-name' returns nil." (when (buffer-file-name)