yanghaoxie / transient-posframe

GNU General Public License v3.0
31 stars 8 forks source link

Fix setting and updating size of transient's frame #7

Open tarsius opened 2 weeks ago

tarsius commented 2 weeks ago

This fixes the regression described in #5. Additionally fixes a second issue, which (I assume) has always existed. Please see 4db747a8d1a332c3b634cf4c302c14c9c96bf01f for details.

6 also tries to fix the regression, but it just hacks around it without understanding the cause.

I've also included some cleanup and minor improvements. Feel free to drop the parts you don't like.

aaronjensen commented 2 weeks ago

This is much improved as it actually sizes properly. One thing I noticed is that the bottom has an extra gray border that's visible. I'm not sure if it's intentional or not or maybe something in my config. It looks like the color of my mode line, so maybe it's that?

CleanShot 2024-11-10 at 18 06 30@2x

tarsius commented 2 weeks ago

That line (or rather its color) serves a purpose, but it's not essential (most users don't know about it and honestly I don't pay attention to it either).

Customize transient-mode-line-format to hide it, change its thickness, or display a mode-line instead.

aaronjensen commented 2 weeks ago

Thank you.

seagle0128 commented 1 week ago

Kindly ping. Can it be merged?

seagle0128 commented 1 week ago

This is much improved as it actually sizes properly. One thing I noticed is that the bottom has an extra gray border that's visible. I'm not sure if it's intentional or not or maybe something in my config. It looks like the color of my mode line, so maybe it's that?

There is a trick to remove the gray line: adding this to the parameter of posframe-show.

   :height (with-current-buffer buffer (1- (count-screen-lines (point-min) (point-max))))
seagle0128 commented 1 week ago

@tarsius I checked the source code, and there is no transient--fit-window-to-buffer in the original file. Can you please double check?

aaronjensen commented 1 week ago

@seagle0128

There is a trick to remove the gray line...

As dgutov mentioned, the most direct way to remove it is (setq transient-mode-line-format nil).

Regarding transient--fit-window-to-buffer, please make sure you are using the version from GitHub, rather than the one bundled with Emacs.

seagle0128 commented 1 week ago

@aaronjensen Thank you for letting me know.