sachac / subed

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

Invalid function error in subed-waveform-toggle-show-all #66

Open Tekki opened 6 months ago

Tekki commented 6 months ago

subed 1.2.11 Emacs 29.1 Debian Bookworm 12.4

When I call subed-waveform-toggle-show-all I get the error message

subed-waveform-add-to-all: Invalid function: subed-for-each-subtitle

This error doesn't occur if I either

If I byte-recompile subed-waveform I get, between a lot of similar warnings, the following one

subed-waveform.el:475:4: Warning: the function ‘subed-for-each-subtitle’ is
    not known to be defined.

And when I use waveform after that, the error appears again.

Tekki commented 6 months ago

It helps if I change the beginning of the code to

(require 'svg)
(eval-when-compile
  (provide 'subed-waveform)
  (require 'subed-common))

The call to provide is to prevent a circular reference between the two files. Which is a bit ugly; why is subed-waveform (and subed-mpv ) required in subed-common?

sachac commented 3 days ago

Whoops, thanks! Yeah, that require didn't make sense. I've swapped them around. Does this work better for you?