Closed notuntoward closed 3 years ago
As a quick response to No.2, could you try to use Supporting w32 needs still improvement.moom-user-margin
to remove the offset in your environment, probably (setq moom-user-margin '(0 0 16 0))
.
If you use '(0 0 16 -16)
for the value, I think No.3 will also be resolved.
Additionally, version 1.4.3
now supports moom-fill-height
as you requested.
Also I added moom-use-font-module
to disable font module even if moom-font.el exisits from version 1.4.8
.
So, I fixed an issue you reported regarding No. 1 and 2. Could you try version 1.4.9
without moom-user-margin
configuration that I mentioned above. Note: If you use dual monitors, you may have to configure moom-user-margin
for some adjustments.
Thanks for the changes.
M-x moom-fill-height
, and it does increase the frame to (close to) full height, but it still doesn't position it so that the top edge of the screen is at the top edge of the monitor. It seems that anybody who calls this command would want the positioning to happen when you run it.moom-user-margin
doesn't seem to have an effect. I left it at the default customization (t
), and my understanding is that then, M-x moom-fill-screen
should fill the screen with the frame without changing the font. But it does change the font. I tried customizing moom-user-margin
to nil
but this didn't change the behavior.(setq moom-user-margin '(0 0 16 0))
does do something. But now M-x moom-move-frame-to-edge-left
undershoots the frame edge (screenshot)I believe the latest version 1.4.9 will do correct at least in my test environment (Windows 10, 27.1 installed from zip). So I need some clarifications to resolve your issue.
Could you try the following configurations in your init.el?
(when (require 'moom nil t)
(setq moom-verbose t)
(setq moom-use-font-module nil)
(setq moom-user-margin '(0 0 0 0)) ;; FYI, the default value is '(0 0 0 0), not t
(moom-mode 1))
A. M-x moom-move-frame
This will bring the frame to the top left corner of your screen. If you see some spaces between top edge and left edge, then moom-user-margin
should be adjusted in your init.el. The last image that you kindly provided, it seems that it requires '(-56 0 -16 0)
but this adjustment highly depends on user environments, so each value would be incorrect. Note: the 4 values represent the margin from {top, bottom, left, right} in order.
B. M-x moom-fill-screen
After the attempt of "A" described above, then please try to call moom-fill-screen
. If the adjustment of moom-user-margin
is good, then the screen will be filled as you expected. If not, please change the user margin again in terms of margins from bottom and right edge. M-x moom-reset will help you to avoid restart your Emacs.
Now I understand the confusion on moom-fill-screen. The command will expand the frame to fill the screen but actually the position will not be changed. I'll release updated version after resolving the margin adjustment issue in this thread. If you want to use such feature now, please add the following code to your init.el.
(add-hook 'moom-before-fill-screen-hook #'moom-move-frame)
C. M-: (moom-check-user-margin '(0 0 0 0))
moom-check-user-margin
could help you to find the appropriate values of moom-user-margin
. The command is NOT interactive so please eval the command in minibuffer.
D. moom-use-font-module
If you configure moom-use-font-module
to nil before calling (moom-mode 1)
in you init.el as I described above. I believe font size will never be changed. If the font size is changed in your side, please give me information in detail so that I will try to reproduce it.
FYI: You can also use M-x moom-toggle-frame-maximized
instead of M-x moom-fill-screen
.
Thanks, are you planning to put 1.49 on melpa?
Yeap, 1.4.9
is already downloadable as 20210216.1044
from MELPA. Normally the latest version will automatically be registered in MELPA with a delay about half a day.
moom-toggle-frame-maximized
is great -- with your suggestions, the margins are correct and the fonts don't change. It's a really nice way to quickly open up the emacs view and then when I've found what I'm looking for, to shrink the frame back to exactly where it was before.
Would it be possible to have a moom-fill-height-toggle
? By that I mean, "set the height to vertically fill the screen and set the position to the top screen edge. And then be able to toggle it back to where it was."
This is the operation I'd use the most, if it was available.
The below almost works -- the only problem is that moom-fill-height
makes the frame a few pixels too tall (the screenshot below shows result of M-x moom-fill-height
. Any suggestions? Does this code break anything?
(setq moom--height-maximized nil)
(defun moom-toggle-frame-height-maximized ()
"Toggle frame height maximized."
(interactive)
(let ((moom--print-status nil))
(if (setq moom--height-maximized (not moom--height-maximized))
(progn
(moom--save-last-status)
(moom-move-frame-to-edge-top)
(moom-fill-height))
(moom-restore-last-status)))
(moom-print-status))
I think the code seems good and now it is a time to configure moom-user-margin
but if do so it would break a covered screen area when togging moom-toggle-frame-maximized
. But I'm not sure, could you just try to customize moom-user-magrin
?
I'm currently little bit nervous to add toggle commands as you suggested because I'm planning to provide an undo feature for each command in a unified way.
BTW, I use moom-cycle-frame-height
to fill height. The command will change frame height in 4 steps as default like {1/4, 1/2, 3/4, 4/4}. You can change the number of steps by M-: (moom-update-height-steps 2)
but currently the minimum step is limited to greater than 1. Honestly speaking I like this command.
Yes, if you're planning a general undo mechanism, then it certainly doesn't make sense to add more toggles.
About the need to set pixel user-margins, though, this can be problematic across multiple machines. For example, I directly use or remotely log into four different computers, each with different screen sizes, resolutions and fonts.
Somehow, standard emacs handles this without me setting pixel margins for each new machine. The instance where this is most clear is frame handling on startup. In my emacs config file, I have the line:
(add-to-list 'default-frame-alist '(fullscreen . fullheight)) ; startup at full height
This vertically maximizes and perfectly positions the initial startup frame without any other parameters. But unfortunately, after startup, there is no similar interactive function for vertical frame maximization. Emacs must have the interface to do this, but I haven't been able to find it. `
I have checked the moom-toggle-frame-height-maximized
in my environment. It performed as I expected and I found a few pixel space between bottom edge, i.e. 3 pixel I think. Moreover, moom-toggle-frame-maximized
has also same a few pixel space. So I believe it is good idea to add the default margins for Windows 10, i.e. '(0 -3 0 0)
. Actually I'm using the margin as moom-user-margin
for my machine.
If it is integrated as the default margins for Windows 10, then I believe you don't need any adjustments in every machine at least Windows 10. What do you think? If you agree this idea, I'll make this change in the next release but before to do so I need some comments from you to clarify.
A. bottom margin
According to your report, the margin, a few pixel between bottom edge, appears in moom-toggle-frame-height-maximized
but not for moom-toggle-frame-height-maximized
. When I tested that moom-toggle-frame-height-maximized
had the same a few pixel space between bottom edge. Could you verify again?
B. appropriate value for the margin
In my environment, 3 pixel is the best value to integrate as the default value for Windows 10. If you think it should be 4 or other value, please let me know. I'll adopt the value because you are the best Moom user :)
FYI: version 1.4.10 is released at 2021-02-21 05:00(UTC). The release includes some updates on moom-fill-screen
and moom-fill-height
. Both commands now automatically move to the top edge of screen as we discussed in this thread. Thank you for remarkable catch up.
'(0 -3 0 0)
is selected as the new default margin for w32. If you have further comments, please create a new issue.
Thanks for distributing
moom
-- it's a much needed replacement for the now deprecatedframe-cmds
package.Here are some thing I've discovered about it:
M-x moom-fill-height
is missing. It's in the documentation, though. This is very the function I was looking for.M-x moom-move-frame-to-edge-left
moves the frame slightly off the screen. The screenshot is of the left edge of the screen after running this command.M-x moom-fill-screen
does expand the frame but doesn't position it so that it fills the screenM-x moom-toggle-font-module
. A customization that always turned font scaling off would solve this problem.This is with emacs 27.1 on Windows 10