On 9/29/23 00:39, David Hedlund wrote:
On 9/28/23 22:05, chad wrote:
Apologies for joining late, and perhaps you have
already tried and discounted this approach, but: Have you
tried adding:
(push
'(fullscreen . maximized) default-frame-alist)
or perhaps
(push
'(fullscreen . maximized) initial-frame-alist)
to early-init? I put the first above line in
~/.emacs.d/early-init.el, and got an initially maximized
window under an odd Wayland+XWayland system as well as Win
11. I don't have reasonable access to either a more typical
X11, Wayland, or macOS system right now.
The key is to put it in early-init.el, which is consulted
before emacs makes any windows in any window system. Also
worth noting: if you end up with conflicting elisp settings
and X resources, there are a variety of ways for the latter
to silently override the former. You can check this with
"xrdb -query" (you might want to run this in a shell buffer
or pipe it to a pager).
Hope this helps,
~Chad
Today is a good day. This is working like a charm! I tried
default-frame-alist, and initial-frame-alist, in upgraded
virtual machines right now:
* X11:
** Trisquel 11: Working
** Ubuntu MATE 22.04: Working
** Ubuntu 23.04: Working
* Wayland
** Ubuntu 22.04: Working
** Ubuntu 23.04: Working
This is the only solution so far that relies 100% on Emacs Lisp. I
think this can be documented in
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.htm
Your solution effectively replaces my devilspie2 solution,
Chad. Thank you very, very much!
REQUEST: Can anyone please try Chad's solution and confirm if
it is working for
* Windows 11
* macOS
* BSD
If it is working for all of them, perhaps it's better to add a
basic section (e.g.
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode.htm)
and document that the solution:
* Will quickly maximize emacs (like `emacs -mm`) by using
~/.emacs.d/early-init.el, to avoid the slightly distracting visual
effect of Emacs starting with its default frame size and then
growing to fullscreen. Adding "(add-to-list 'default-frame-alist
'(fullscreen . maximized))" to the top of ~/.emacs will is cause
the distracting visual effect if additionally typically
configurations are added in ~/.emacs.
* Only requires Emacs lisp and works out of the box.
* Will be executed automatically when emacs starts.
---------------8<-----------------------
Just to avoid confusion, this line was added by mistake:
* ~/.emacs.d/early-init.el prevents the the visually
distracting effect is (add-to-list 'default-frame-alist
'(fullscreen . maximized))
Of course, I meant that it should be what Chad suggested: (push
'(fullscreen . maximized) default-frame-alist)
End, this line was added by mistake
---------------8<-----------------------
* Works for GNU/Linux (X11, Wayland), [Windows], [macOS], [BSD]
|