johanvts / emacs-fireplace

A cozy fireplace for emacs.
732 stars 21 forks source link

Fix: Attempted fix for fireplace not resizing easily #33

Open Mallchad opened 3 years ago

Mallchad commented 3 years ago

I noticed that my fireplace wasn't resizing dynamically very easily, and whislt this wasn't really a big deal, I got curious and had a look. I want my fireplace to be cozy! <3

The actual offending line is rather Line 244: '(add-hook 'window-size-change-functions 'fireplace--update-locals-vars nil t)' As per the documentation the 'Functions called during redisplay when window sizes have changed. The value should be a list of functions that take one argument.'

So that's all the problem is, the function is being called with an argument it isn't expecting, the documentation states it passes the window as an argument. But here we don't care about that, so I just added a 'stub-window' to 'eat' the argument.

Although, it occurs to me this might be a bit lazy, and I could quite easily use the passed argument to update the fileplace vars, instead of searching for the (hardcoded) buffer every time. But hey, it works.

Also here I used &optional because of that one other time when the update-vars function is called, but again, this could easily be adaopted to supply the window context properly.

EDIT: I should note that I've been using this fix for a solid year or something, by straight overriding the function with a nearly identical copy of 7296ced in my 'init.el'. It should work just fine.