Closed terlar closed 6 years ago
Both changes look good to me. The unload function probably never worked, but I've never used it myself. I'll add some tests for it.
Regarding the buffer-file-name
thing: would you mind trying the old code with the line https://github.com/wasamasa/nov.el/blob/7d14b6a2aa649e2213348883893a24a6a6083cb9/nov.el#L683 commented out? I suspect this might be causing the problem. I can't find any documentation that suggests major modes should not set set-visited-file-name nil
, so I think your changes are good.
Good find, I can confirm that your theory is correct. I searched through all other packages quickly and only found one other instance the flycheck-ert file (inside flycheck). But could very well be other things out there that uses this trick.
Thanks for the quick feedback and the package. Wasn't sure if the package was "dead" or just stable, hehe.
This is a fix for #14 it adds a check to see if
buffer-file-name
is defined before trying to use it. I see this as the solution as we can't control for which files these hooks will run.Also fix the
yatemplate-unload-function
, when it tried to remove the hooks it used undefined variable references instead of referring to the functions.I am not sure if these are things that worked differently in older emacs versions, but at least in the latest version I run into these issues.