unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Hedlund <public@beloved.name>
To: emacs-devel@gnu.org
Subject: Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux - Improved solution by Chad: ~/.emacs.d/early-init.el
Date: Sat, 30 Sep 2023 17:50:48 +0200	[thread overview]
Message-ID: <aa750c20-07e8-4e6e-a6ec-79f23cc1a79c@beloved.name> (raw)
In-Reply-To: <6a7034f0-db9d-433d-9b86-2769356ed513@beloved.name>

[-- Attachment #1: Type: text/plain, Size: 5424 bytes --]


On 9/29/23 19:54, David Hedlund wrote:
>
>
> On 9/29/23 19:18, David Hedlund wrote:
>>
>>
>> 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
>>>
It works in Windows 11 too. I just tested this in 
Win11_22H2_EnglishInternational_x64v2.iso Home edition, upgraded.

"(push '(fullscreen . maximized) default-frame-alist)" is added to 
.emacs.d/early-init.el it expanded the buffer equally quickly like when 
this was added to a .emacs file (with 100 lines):

(add-hook 'emacs-startup-hook 'toggle-frame-maximized)

(setq frame-resize-pixelwise t)
(set-frame-position nil 0 0)
(set-frame-size nil (display-pixel-width) (display-pixel-height) t)


For GNU/Linux adding this to .emacs (same file size as for the Windows 
11 experiment) caused a delay:

(add-hook 'emacs-startup-hook 'toggle-frame-maximized)


So for Windows, there are two methods that can be used, but for 
GNU/Linux only one solution works (adding "(push '(fullscreen . 
maximized) default-frame-alist)" to .emacs.d/early-init.el)


With this said, the OS independent solution is to add "(push 
'(fullscreen . maximized) default-frame-alist)" to 
.emacs.d/early-init.el which can be documented in a new page, 
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode.htm



>>> * 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:
>>>
>
> * The only reason why I suggested the file name 
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html, 
> or 
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode, 
> is to make it consistent with 
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-MS_002dWindows.html 
> that is describing both fullscreen mode, but also maximized mode.
>
> * Perhaps it's better to use the file name 
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-maximize-mode.html 
> to avoid confusion.
>
Eli said: "

"Fullscreen" is widely accepted terminology for what is discussed
there.  Moreover, typing "i maximized RET" and "i fullscreen RET" in
both the ELisp and the Emacs user manuals brings you to the same text,
so we already have the two equivalent terms covered, and renaming the
node is not necessary IMO."


>
>>> * 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]
>>>
>>>

[-- Attachment #2: Type: text/html, Size: 10904 bytes --]

  parent reply	other threads:[~2023-09-30 15:50 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 12:11 Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux David Hedlund
2023-09-26 14:12 ` Björn Bidar
2023-09-26 14:36   ` Emanuel Berg
2023-09-26 15:57   ` David Hedlund
2023-09-26 22:24     ` Emanuel Berg
2023-09-26 22:33     ` Emanuel Berg
2023-09-27 11:21       ` David Hedlund
2023-09-27 13:16         ` David Hedlund
2023-09-27 13:25           ` Emanuel Berg
2023-09-27 15:07             ` David Hedlund
2023-09-27 15:10               ` David Hedlund
2023-09-27 17:29                 ` David Hedlund
2023-09-28 20:05                   ` chad
2023-09-28 22:39                     ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux - Improved solution by Chad: ~/.emacs.d/early-init.el David Hedlund
2023-09-29 17:18                       ` David Hedlund
2023-09-29 17:54                         ` David Hedlund
2023-09-29 19:46                           ` Emanuel Berg
2023-09-30 15:50                           ` David Hedlund [this message]
2023-10-05  4:01                             ` David Hedlund
2023-10-05  4:19                               ` Emanuel Berg
2023-10-19 13:57                                 ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux -- Lisp code for `emacs --maximize` David Hedlund
2023-10-27  2:19                     ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux David Hedlund
2023-11-10 11:04                     ` David Hedlund
2023-09-28 23:26                   ` Björn Bidar
2023-09-29 16:09                     ` Emanuel Berg
2023-09-29 17:46                       ` David Hedlund
2023-09-29 17:20                     ` David Hedlund
2023-09-27 15:21               ` Emanuel Berg
2023-09-27 13:28           ` David Hedlund
2023-09-27 14:03             ` Emanuel Berg
2023-09-27 15:18               ` David Hedlund
2023-09-27 13:21         ` Emanuel Berg
2023-09-26 16:06 ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html David Hedlund
2023-09-26 19:11   ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html Emanuel Berg
2023-09-26 20:06     ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html David Hedlund
2023-09-27  3:53       ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html Corwin Brust
2023-09-27 18:04         ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html David Hedlund
2023-09-29  7:00 ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux Eli Zaretskii
2023-09-29 17:12   ` David Hedlund
2023-09-29 17:35     ` Eli Zaretskii
2023-09-29 20:57       ` David Hedlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa750c20-07e8-4e6e-a6ec-79f23cc1a79c@beloved.name \
    --to=public@beloved.name \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).