* Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
@ 2023-09-26 12:11 David Hedlund
2023-09-26 14:12 ` Björn Bidar
` (2 more replies)
0 siblings, 3 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-26 12:11 UTC (permalink / raw)
To: Emacs-devel
[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]
Methods to always maximize `emacs` (for example, from Alt+F2 in MATE),
without the slightly distracting visual effect when the default frame
size is growing to fullscreen. The window will be maximized quickly,
like "emacs --maximize".
###########################
Windows - Solved
A while ago I suggested how to expand the Emacs window rapidly for
Windows -
https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00155.html
It has now been added:
"
Alternatively, you can avoid the visual effect of Emacs changing its
frame size entirely in your init file (i.e., without using the
Registry), like this:
(setq frame-resize-pixelwise t)
(set-frame-position nil 0 0)
(set-frame-size nil (display-pixel-width) (display-pixel-height) t)
" -
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-MS_002dWindows.html.
Here's the old revision:
https://web.archive.org/web/20230202024025/https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-MS_002dWindows.html
###########################
GNU/Linux - proposed new section:
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
As far as I know, this cannot be done entirely with Emacs LISP for
GNU/Linux, but I found a workaround by combining it with devilspie2.
I've successfully used this recipe for Trisquel 11:
* Step 1 to quickly maximize the window[1]: Install, configure, and
autostart devilspie2 to nearly maximize emacs[1]. Run this in a terminal
or as a script:
# Install devilspie2
sudo apt-get -y install devilspie2
# Configure devilspie2
mkdir -p ~/.config/devilspie2/
width="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d
'x' -f1)"
height="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d
'x' -f2)"
tee ~/.config/devilspie2/emacs.lua /dev/null << EOF
if (get_class_instance_name() == "emacs") then
set_window_geometry(0, 0, $width, $height);
end
EOF
# Autostart devilspie2
mkdir -p "$HOME/.config/autostart/" # The directory does not exist by
default
cd "$HOME/.config/autostart/" || exit
file="devilspie-2.desktop"
touch "$file"
desktop-file-edit \
--set-name="Devilspie 2" \
--set-comment="Perform scripted actions on windows as they are created" \
--set-key="Type" --set-value="Application" \
--set-key="Exec" --set-value="devilspie2" \
--set-key="X-MATE-Autostart-Delay" --set-value="0" \
"$file"
desktop-file-validate "$file"
* Step 2 to quickly maximize the window[1]: Add this to ~/.emacs:
(add-to-list 'default-frame-alist '(fullscreen . maximized))
* Log out and then log back into your desktop environment
* Every time you open `emacs`, regardless how you are opening it, it
will open the window equally fast as `emacs --maximize`
[1]: Workaround to bug: maximize* commands don't work for Emacs -
https://savannah.nongnu.org/bugs/index.php?63979
The above steps can of course be rewritten and described for general use
to make it useful for any GNU/Linux distro.
[-- Attachment #2: Type: text/html, Size: 4805 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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 16:06 ` 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
2 siblings, 2 replies; 41+ messages in thread
From: Björn Bidar @ 2023-09-26 14:12 UTC (permalink / raw)
To: David Hedlund; +Cc: Emacs-devel
David Hedlund <public@beloved.name> writes:
> As far as I know, this cannot be done entirely with Emacs LISP for
> GNU/Linux, but I found a workaround by combining it with devilspie2.
>
> [1]: Workaround to bug: maximize* commands don't work for Emacs -
> https://savannah.nongnu.org/bugs/index.php?63979
There are a few ways to achieve this on Linux. The Emacs wiki has a some
examples, e.g:
(defun toggle-fullscreen ()
"Toggle full screen on X11"
(interactive)
(when (eq window-system 'x)
(set-frame-parameter
nil 'fullscreen
(when (not (frame-parameter nil 'fullscreen)) 'fullboth))))
Or:
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
The first example also could work with PGTK, but the example only checks for
window system of x build . I'm not sure how exactly fullscreen should be
done on Wayland.
Is the builtin function `toggle-frame-fullscreen` enough?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-26 14:12 ` Björn Bidar
@ 2023-09-26 14:36 ` Emanuel Berg
2023-09-26 15:57 ` David Hedlund
1 sibling, 0 replies; 41+ messages in thread
From: Emanuel Berg @ 2023-09-26 14:36 UTC (permalink / raw)
To: emacs-devel
Björn Bidar wrote:
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
Indeed, here are some more fun things you can do with
wmctrl(1)
https://dataswamp.org/~incal/conf/.zsh/wm
https://dataswamp.org/~incal/conf/.zsh/transparency
Those files are zsh but the commands works more broadly
than that.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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
1 sibling, 2 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-26 15:57 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]
On 9/26/23 16:12, Björn Bidar wrote:
> David Hedlund<public@beloved.name> writes:
>
>> As far as I know, this cannot be done entirely with Emacs LISP for
>> GNU/Linux, but I found a workaround by combining it with devilspie2.
>>
>> [1]: Workaround to bug: maximize* commands don't work for Emacs -
>> https://savannah.nongnu.org/bugs/index.php?63979
> There are a few ways to achieve this on Linux. The Emacs wiki has a some
> examples, e.g:
>
> (defun toggle-fullscreen ()
> "Toggle full screen on X11"
> (interactive)
> (when (eq window-system 'x)
> (set-frame-parameter
> nil 'fullscreen
> (when (not (frame-parameter nil 'fullscreen)) 'fullboth))))
>
> Or:
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
>
> The first example also could work with PGTK, but the example only checks for
> window system of x build .
Thank you, but none of the solutions worked in Trisquel 11 (X11).
> I'm not sure how exactly fullscreen should be
> done on Wayland.
>
> Is the builtin function `toggle-frame-fullscreen` enough?
>
That will open emacs in full screen mode, as the subject says I want it
to maximize. However, as a side note, I observed that
toggle-frame-fullscreen expands the buffer quickly (like `emacs
--maximize`) which gives me hope.
[-- Attachment #2: Type: text/html, Size: 2312 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
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 16:06 ` 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-29 7:00 ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux Eli Zaretskii
2 siblings, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-26 16:06 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
So my original email suggest a complete solution, is this something we
can add to a new page,
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
, and then update it with improved solutions in the future?
[-- Attachment #2: Type: text/html, Size: 649 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
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 ` 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
0 siblings, 1 reply; 41+ messages in thread
From: Emanuel Berg @ 2023-09-26 19:11 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
> So my original email suggest a complete solution, is this
> something we can add to a new page,
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
> and then update it with improved solutions in the future?
Subject URL was new for me if nothing else :P
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
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 ` 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
0 siblings, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-26 20:06 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 2564 bytes --]
On 9/26/23 21:11, Emanuel Berg wrote:
> David Hedlund wrote:
>
>> So my original email suggest a complete solution, is this
>> something we can add to a new page,
>> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
>> and then update it with improved solutions in the future?
> Subject URL was new for me if nothing else :P
>
Methods to always maximize `emacs` (for example, from Alt+F2 in MATE),
without the slightly distracting visual effect when the default frame
size is growing to fullscreen. The window will be maximized quickly,
like "emacs --maximize".
GNU/Linux - proposed new section:
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
As far as I know, this cannot be done entirely with Emacs LISP for
GNU/Linux, but I found a workaround by combining it with devilspie2.
I've successfully used this recipe for Trisquel 11:
* Step 1 to quickly maximize the window[1]: Install, configure, and
autostart devilspie2 to nearly maximize emacs[1]. Run this in a terminal
or as a script:
# Install devilspie2
sudo apt-get -y install devilspie2
# Configure devilspie2
mkdir -p ~/.config/devilspie2/
width="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d
'x' -f1)"
height="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d
'x' -f2)"
tee ~/.config/devilspie2/emacs.lua /dev/null << EOF
if (get_class_instance_name() == "emacs") then
set_window_geometry(0, 0, $width, $height);
end
EOF
# Autostart devilspie2
mkdir -p "$HOME/.config/autostart/" # The directory does not exist by
default
cd "$HOME/.config/autostart/" || exit
file="devilspie-2.desktop"
touch "$file"
desktop-file-edit \
--set-name="Devilspie 2" \
--set-comment="Perform scripted actions on windows as they are created" \
--set-key="Type" --set-value="Application" \
--set-key="Exec" --set-value="devilspie2" \
--set-key="X-MATE-Autostart-Delay" --set-value="0" \
"$file"
desktop-file-validate "$file"
* Step 2 to quickly maximize the window[1]: Add this to ~/.emacs:
(add-to-list 'default-frame-alist '(fullscreen . maximized))
* Log out and then log back into your desktop environment
* Every time you open `emacs`, regardless how you are opening it, it
will open the window equally fast as `emacs --maximize`
[1]: Workaround to bug: maximize* commands don't work for Emacs -
https://savannah.nongnu.org/bugs/index.php?63979
The above steps can of course be rewritten and described for general use
to make it useful for any GNU/Linux distro.
[-- Attachment #2: Type: text/html, Size: 4395 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-26 15:57 ` David Hedlund
@ 2023-09-26 22:24 ` Emanuel Berg
2023-09-26 22:33 ` Emanuel Berg
1 sibling, 0 replies; 41+ messages in thread
From: Emanuel Berg @ 2023-09-26 22:24 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
> Thank you, but none of the solutions worked in Trisquel 11
> (X11).
Now it sounds like Trisquel is some version of X, but it's
a Linux distro, a distro based on Ubuntu which in turn is
based on Debian.
So wmctrl(1) should absolutely work for that, if you don't
want fullscreen but instead maximizing there are the
maximized_vert and maximized_horz properties - see man man
page for wmctrl, line 39.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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
1 sibling, 1 reply; 41+ messages in thread
From: Emanuel Berg @ 2023-09-26 22:33 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
> Thank you, but none of the solutions worked in Trisquel 11
> (X11)
$ wmctrl -r :ACTIVE: -b toggle,maximized_horz,maximized_vert
To always set, use 'add' instead of 'toggle'. To always unset,
use 'remove'.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
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 ` 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
0 siblings, 1 reply; 41+ messages in thread
From: Corwin Brust @ 2023-09-27 3:53 UTC (permalink / raw)
To: David Hedlund; +Cc: emacs-devel
Hi David
On Tue, Sep 26, 2023 at 3:06 PM David Hedlund <public@beloved.name> wrote:
>
>
> On 9/26/23 21:11, Emanuel Berg wrote:
>
> David Hedlund wrote:
>
> So my original email suggest a complete solution, is this
> something we can add to a new page,
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
> and then update it with improved solutions in the future?
>
AFAIK the HTML pages representing the online Emacs manual are defined
within the sources for the manual, itself. IOW, to add a "page" for
this would entail creating a new manual section, at which the new page
would appear when new HTML versions of the manual are published, along
with some subsequent release of Emacs (say, the next major version, if
the change was made in the development branch).
>
> Subject URL was new for me if nothing else :P
>
> Methods to always maximize `emacs` (for example, from Alt+F2 in MATE), without the slightly distracting visual effect when the default frame size is growing to fullscreen. The window will be maximized quickly, like "emacs --maximize".
>
This seems like very helpful information. As a precursor --or even an
alternative-- to proposing a patch to the manual to provide these
examples, what would you think of adding this into the EmacsWiki? I
believe it is not unheard of to link from the manual to EmacsWiki,
thus you could potentially simplify the patch involved by proposing
adding some minimal explanation and a link (rather than
providing/motivating a patch adding -e.g.- a section).
>
> GNU/Linux - proposed new section: https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
>
>
> As far as I know, this cannot be done entirely with Emacs LISP for GNU/Linux, but I found a workaround by combining it with devilspie2.
>
>
> I've successfully used this recipe for Trisquel 11:
>
> * Step 1 to quickly maximize the window[1]: Install, configure, and autostart devilspie2 to nearly maximize emacs[1]. Run this in a terminal or as a script:
>
> # Install devilspie2
> sudo apt-get -y install devilspie2
>
> # Configure devilspie2
> mkdir -p ~/.config/devilspie2/
>
> width="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)"
> height="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2)"
>
> tee ~/.config/devilspie2/emacs.lua /dev/null << EOF
> if (get_class_instance_name() == "emacs") then
>
> set_window_geometry(0, 0, $width, $height);
>
> end
> EOF
>
> # Autostart devilspie2
> mkdir -p "$HOME/.config/autostart/" # The directory does not exist by default
> cd "$HOME/.config/autostart/" || exit
> file="devilspie-2.desktop"
> touch "$file"
> desktop-file-edit \
> --set-name="Devilspie 2" \
> --set-comment="Perform scripted actions on windows as they are created" \
> --set-key="Type" --set-value="Application" \
> --set-key="Exec" --set-value="devilspie2" \
> --set-key="X-MATE-Autostart-Delay" --set-value="0" \
> "$file"
> desktop-file-validate "$file"
>
> * Step 2 to quickly maximize the window[1]: Add this to ~/.emacs: (add-to-list 'default-frame-alist '(fullscreen . maximized))
> * Log out and then log back into your desktop environment
> * Every time you open `emacs`, regardless how you are opening it, it will open the window equally fast as `emacs --maximize`
>
> [1]: Workaround to bug: maximize* commands don't work for Emacs - https://savannah.nongnu.org/bugs/index.php?63979
>
>
>
> The above steps can of course be rewritten and described for general use to make it useful for any GNU/Linux distro.
Thanks for figuring all this out!
Corwin
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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:21 ` Emanuel Berg
0 siblings, 2 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-27 11:21 UTC (permalink / raw)
To: emacs-devel, bjorn.bidar, incal
[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]
On 9/27/23 00:33, Emanuel Berg wrote:
> David Hedlund wrote:
>
>> Thank you, but none of the solutions worked in Trisquel 11
>> (X11)
> $ wmctrl -r :ACTIVE: -b toggle,maximized_horz,maximized_vert
>
> To always set, use 'add' instead of 'toggle'. To always unset,
> use 'remove'.
>
Thank you, this is exactly what I want! It expands the window quickly
(like emacs -mm) from the terminal.
* This works from the terminal with an open emacs Window: $ wmctrl -i -r
"0x06400142" -b toggle,maximized_vert,maximized_horz
* However *shell-command "wmctrl...* doesn't not run from ~/.emacs
(tried it in a fresh Trisquel 11 installation from a virtual machine),
the window size is opened in the default size:
---
Failed the settings suggested by Björn Bidar (as I mentioned earlier):
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
---
Failed with the command that is working from the terminal (escaped double quotes, and made sure that the window is open and that the window ID is correct):
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -i -r \"0x06400142\" -b toggle,maximized_vert,maximized_horz"))
---
Failed:
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -b toggle,maximized_horz,maximized_vert"))
---
Any idea why*shell-command* is not executed?
[-- Attachment #2: Type: text/html, Size: 2262 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 11:21 ` David Hedlund
@ 2023-09-27 13:16 ` David Hedlund
2023-09-27 13:25 ` Emanuel Berg
2023-09-27 13:28 ` David Hedlund
2023-09-27 13:21 ` Emanuel Berg
1 sibling, 2 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-27 13:16 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1984 bytes --]
On 9/27/23 13:21, David Hedlund wrote:
>
>
> On 9/27/23 00:33, Emanuel Berg wrote:
>> David Hedlund wrote:
>>
>>> Thank you, but none of the solutions worked in Trisquel 11
>>> (X11)
>> $ wmctrl -r :ACTIVE: -b toggle,maximized_horz,maximized_vert
>>
>> To always set, use 'add' instead of 'toggle'. To always unset,
>> use 'remove'.
>>
> Thank you, this is exactly what I want! It expands the window quickly
> (like emacs -mm) from the terminal.
>
>
> * This works from the terminal with an open emacs Window: $ wmctrl -i
> -r "0x06400142" -b toggle,maximized_vert,maximized_horz
>
>
> * However *shell-command "wmctrl...* doesn't not run from ~/.emacs
> (tried it in a fresh Trisquel 11 installation from a virtual machine),
> the window size is opened in the default size:
>
> ---
> Failed the settings suggested by Björn Bidar (as I mentioned earlier):
>
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>
> ---
>
>
> Failed with the command that is working from the terminal (escaped double quotes, and made sure that the window is open and that the window ID is correct):
>
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -i -r \"0x06400142\" -b toggle,maximized_vert,maximized_horz"))
>
> ---
>
>
> Failed:
>
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -b toggle,maximized_horz,maximized_vert"))
>
>
> ---
>
> Any idea why*shell-command* is not executed?
It also fails in Ubuntu MATE 23.04 (default window size):
-------------------------8<-----------------------------
sudo apt install -y emacs wmctrl # Just press Enter during the "Postfix
Configuration"
tee ~/.emacs > /dev/null << 'EOF'
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
EOF
emacs
-------------------------8<-----------------------------
[-- Attachment #2: Type: text/html, Size: 3203 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 11:21 ` David Hedlund
2023-09-27 13:16 ` David Hedlund
@ 2023-09-27 13:21 ` Emanuel Berg
1 sibling, 0 replies; 41+ messages in thread
From: Emanuel Berg @ 2023-09-27 13:21 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
> tried it in a fresh Trisquel 11
This should not be an issue with your Linux distro, in
all likelihood.
> Failed the settings suggested by Björn Bidar (as I mentioned
> earlier):
>
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
It works for me, from the/a terminal as well as from Emacs
with M-x switch-full-screen RET
> Any idea why*shell-command* is not executed?
It is executed, maybe you don't notice the change?
Try removing the maximized_vert and maximized_horz properties,
or set the window size manually to something small, so you can
see that the window isn't in fullscreen. Then just M-x the
fullscreen command as above - should work, right?
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 13:16 ` David Hedlund
@ 2023-09-27 13:25 ` Emanuel Berg
2023-09-27 15:07 ` David Hedlund
2023-09-27 13:28 ` David Hedlund
1 sibling, 1 reply; 41+ messages in thread
From: Emanuel Berg @ 2023-09-27 13:25 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
> sudo apt install -y emacs wmctrl # Just press Enter during the
> "Postfix Configuration"
>
> tee ~/.emacs > /dev/null << 'EOF'
>
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>
> EOF
Yes, do that and then M-x switch-full-screen RET
or just type
(shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
and do C-x C-e for `eval-last-sexp'.
It doesn't work?
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 13:16 ` David Hedlund
2023-09-27 13:25 ` Emanuel Berg
@ 2023-09-27 13:28 ` David Hedlund
2023-09-27 14:03 ` Emanuel Berg
1 sibling, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-27 13:28 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 2424 bytes --]
On 9/27/23 15:16, David Hedlund wrote:
>
>
> On 9/27/23 13:21, David Hedlund wrote:
>>
>>
>> On 9/27/23 00:33, Emanuel Berg wrote:
>>> David Hedlund wrote:
>>>
>>>> Thank you, but none of the solutions worked in Trisquel 11
>>>> (X11)
>>> $ wmctrl -r :ACTIVE: -b toggle,maximized_horz,maximized_vert
>>>
>>> To always set, use 'add' instead of 'toggle'. To always unset,
>>> use 'remove'.
>>>
>> Thank you, this is exactly what I want! It expands the window quickly
>> (like emacs -mm) from the terminal.
>>
>>
>> * This works from the terminal with an open emacs Window: $ wmctrl -i
>> -r "0x06400142" -b toggle,maximized_vert,maximized_horz
>>
>>
>> * However *shell-command "wmctrl...* doesn't not run from ~/.emacs
>> (tried it in a fresh Trisquel 11 installation from a virtual
>> machine), the window size is opened in the default size:
>>
>> ---
>> Failed the settings suggested by Björn Bidar (as I mentioned earlier):
>>
>> (defun switch-full-screen ()
>> (interactive)
>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>>
>> ---
>>
>>
>> Failed with the command that is working from the terminal (escaped double quotes, and made sure that the window is open and that the window ID is correct):
>>
>> (defun switch-full-screen ()
>> (interactive)
>> (shell-command "wmctrl -i -r \"0x06400142\" -b toggle,maximized_vert,maximized_horz"))
>>
>> ---
>>
>>
>> Failed:
>>
>> (defun switch-full-screen ()
>> (interactive)
>> (shell-command "wmctrl -r :ACTIVE: -b toggle,maximized_horz,maximized_vert"))
>>
>>
>> ---
>>
>> Any idea why*shell-command* is not executed?
>
>
> It also fails in Ubuntu MATE 23.04 (default window size):
>
> -------------------------8<-----------------------------
>
> sudo apt install -y emacs wmctrl # Just press Enter during the
> "Postfix Configuration"
>
>
> tee ~/.emacs > /dev/null << 'EOF'
>
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>
> EOF
>
>
> emacs
>
> -------------------------8<-----------------------------
>
Ubuntu 22.04 (Wayland) cannot use wmctrl like Trisquel 11 (X11) and
Ubuntu MATE 23.04 (X11) . For Ubuntu, my devilspie2 solution works, I'm
sure there are other solutions. However, please, let's focus why wmctrl
cannot be executed from init in Trisquel and Ubuntu MATE right now to
avoid more confusion.
[-- Attachment #2: Type: text/html, Size: 4020 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 13:28 ` David Hedlund
@ 2023-09-27 14:03 ` Emanuel Berg
2023-09-27 15:18 ` David Hedlund
0 siblings, 1 reply; 41+ messages in thread
From: Emanuel Berg @ 2023-09-27 14:03 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
>> (defun switch-full-screen ()
>> (interactive)
>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>
> [...] let's focus why wmctrl cannot be executed from init in
> Trisquel and Ubuntu MATE right now to avoid more confusion.
1. Make the terminal emulator window small so one can see that
it isn't in fullscreen mode.
2. From the terminal, confirm that this works
$ wmctrl -r :ACTIVE: -b toggle,fullscreen
3. If it does, in the Emacs window, do the same thing, first
make it small so it is clear it isn't in fullscreen mode,
then type and eval with C-x C-e or `eval-last-sexp'
(shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 13:25 ` Emanuel Berg
@ 2023-09-27 15:07 ` David Hedlund
2023-09-27 15:10 ` David Hedlund
2023-09-27 15:21 ` Emanuel Berg
0 siblings, 2 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-27 15:07 UTC (permalink / raw)
To: emacs-devel, corwin
[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]
On 9/27/23 15:25, Emanuel Berg wrote:
> David Hedlund wrote:
>
>> sudo apt install -y emacs wmctrl # Just press Enter during the
>> "Postfix Configuration"
>>
>> tee ~/.emacs > /dev/null << 'EOF'
>>
>> (defun switch-full-screen ()
>> (interactive)
>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>>
>> EOF
> Yes, do that and then M-x switch-full-screen RET
>
> or just type
>
> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>
> and do C-x C-e for `eval-last-sexp'.
>
> It doesn't work?
>
Sorry, it works, I just expected the snippet from Emacs wiki to work
out-of-the-box automatically. But I had to add: (add-hook
'after-init-hook 'switch-full-screen) . Also, "toggle" is useless for
wmctrl in this situation, so I replaced it with "add", and I replaced
"fullscreen" with "maximized_horz,maximized_vert"
Here's the final solution for X11 (Trisquel, Ubuntu MATE), but not for
Wayland (Ubuntu):
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
This is a very compact and useful solution. Again, I suggest it to be documented in the Emacs Manual in a new page:https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
Again, the devilspie2 solution is much longer, can be used for both X11 and Wayland.
[-- Attachment #2: Type: text/html, Size: 2662 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 15:07 ` David Hedlund
@ 2023-09-27 15:10 ` David Hedlund
2023-09-27 17:29 ` David Hedlund
2023-09-27 15:21 ` Emanuel Berg
1 sibling, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-27 15:10 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1773 bytes --]
On 9/27/23 17:07, David Hedlund wrote:
>
>
> On 9/27/23 15:25, Emanuel Berg wrote:
>> David Hedlund wrote:
>>
>>> sudo apt install -y emacs wmctrl # Just press Enter during the
>>> "Postfix Configuration"
>>>
>>> tee ~/.emacs > /dev/null << 'EOF'
>>>
>>> (defun switch-full-screen ()
>>> (interactive)
>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>>>
>>> EOF
>> Yes, do that and then M-x switch-full-screen RET
>>
>> or just type
>>
>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>>
>> and do C-x C-e for `eval-last-sexp'.
>>
>> It doesn't work?
>>
>
> Sorry, it works, I just expected the snippet from Emacs wiki to work
> out-of-the-box automatically. But I had to add: (add-hook
> 'after-init-hook 'switch-full-screen) . Also, "toggle" is useless for
> wmctrl in this situation, so I replaced it with "add", and I replaced
> "fullscreen" with "maximized_horz,maximized_vert"
>
> Here's the final solution for X11 (Trisquel, Ubuntu MATE), but not for
> Wayland (Ubuntu):
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
Sorry, I forgot to add (add-hook 'after-init-hook 'switch-full-screen).
Here's everything:
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
(add-hook 'after-init-hook 'switch-full-screen)
>
>
> This is a very compact and useful solution. Again, I suggest it to be documented in the Emacs Manual in a new page:https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
>
> Again, the devilspie2 solution is much longer, can be used for both X11 and Wayland.
>
[-- Attachment #2: Type: text/html, Size: 3541 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 14:03 ` Emanuel Berg
@ 2023-09-27 15:18 ` David Hedlund
0 siblings, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-27 15:18 UTC (permalink / raw)
To: emacs-devel, bjorn.bidar, incal
[-- Attachment #1: Type: text/plain, Size: 829 bytes --]
On 9/27/23 16:03, Emanuel Berg wrote:
> David Hedlund wrote:
>
>>> (defun switch-full-screen ()
>>> (interactive)
>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>> [...] let's focus why wmctrl cannot be executed from init in
>> Trisquel and Ubuntu MATE right now to avoid more confusion.
> 1. Make the terminal emulator window small so one can see that
> it isn't in fullscreen mode.
>
> 2. From the terminal, confirm that this works
>
> $ wmctrl -r :ACTIVE: -b toggle,fullscreen
>
> 3. If it does, in the Emacs window, do the same thing, first
> make it small so it is clear it isn't in fullscreen mode,
> then type and eval with C-x C-e or `eval-last-sexp'
>
> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>
Thank you very much for helping out, Emanuel, and Björn.
[-- Attachment #2: Type: text/html, Size: 1499 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 15:07 ` David Hedlund
2023-09-27 15:10 ` David Hedlund
@ 2023-09-27 15:21 ` Emanuel Berg
1 sibling, 0 replies; 41+ messages in thread
From: Emanuel Berg @ 2023-09-27 15:21 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
>> Yes, do that and then M-x switch-full-screen RET
>>
>> or just type
>>
>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>>
>> and do C-x C-e for `eval-last-sexp'.
>>
>> It doesn't work?
>
> Sorry, it works, I just expected the snippet from Emacs wiki
> to work out-of-the-box automatically. But I had to
> add: (add-hook 'after-init-hook 'switch-full-screen) .
> Also, "toggle" is useless for wmctrl in this situation, so
> I replaced it with "add", and I replaced "fullscreen" with
> "maximized_horz,maximized_vert"
No problem, yeah, sometimes my patience is shorter than the
women's skirts on Ibiza. Glad that it worked finally.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 15:10 ` David Hedlund
@ 2023-09-27 17:29 ` David Hedlund
2023-09-28 20:05 ` chad
2023-09-28 23:26 ` Björn Bidar
0 siblings, 2 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-27 17:29 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 2505 bytes --]
On 9/27/23 17:10, David Hedlund wrote:
>
>
> On 9/27/23 17:07, David Hedlund wrote:
>>
>>
>> On 9/27/23 15:25, Emanuel Berg wrote:
>>> David Hedlund wrote:
>>>
>>>> sudo apt install -y emacs wmctrl # Just press Enter during the
>>>> "Postfix Configuration"
>>>>
>>>> tee ~/.emacs > /dev/null << 'EOF'
>>>>
>>>> (defun switch-full-screen ()
>>>> (interactive)
>>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>>>>
>>>> EOF
>>> Yes, do that and then M-x switch-full-screen RET
>>>
>>> or just type
>>>
>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>>>
>>> and do C-x C-e for `eval-last-sexp'.
>>>
>>> It doesn't work?
>>>
>>
>> Sorry, it works, I just expected the snippet from Emacs wiki to work
>> out-of-the-box automatically. But I had to add: (add-hook
>> 'after-init-hook 'switch-full-screen) . Also, "toggle" is useless
>> for wmctrl in this situation, so I replaced it with "add", and I
>> replaced "fullscreen" with "maximized_horz,maximized_vert"
>>
>> Here's the final solution for X11 (Trisquel, Ubuntu MATE), but not
>> for Wayland (Ubuntu):
>> (defun switch-full-screen ()
>> (interactive)
>> (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
>
> Sorry, I forgot to add (add-hook 'after-init-hook
> 'switch-full-screen). Here's everything:
>
>
> (defun switch-full-screen ()
> (interactive)
> (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
> (add-hook 'after-init-hook 'switch-full-screen)
>
>
Sorry, I just found out that even if it's added to the top of ~/.emacs,
this will not expand the buffer quickly like `emacs -mm` for a typical
~/.emacs that need to load a lot of stuff. It will not expand the buffer
faster than
(add-to-list 'default-frame-alist '(fullscreen . maximized)) -- so
it's a useless solution since it requires wmctrl
Also, the wmctrl solution requires the package to be installed
Right now the only way to automaticall and always quickly expand the
buffer like `emacs -mm`, regardless the size of ~/.emacs, is to use
devilspie2 solution that I added in the first post in this thread.
>
>> This is a very compact and useful solution. Again, I suggest it to be documented in the Emacs Manual in a new page:https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
>>
>> Again, the devilspie2 solution is much longer, can be used for both X11 and Wayland.
>>
[-- Attachment #2: Type: text/html, Size: 4789 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
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 ` David Hedlund
0 siblings, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-27 18:04 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 4577 bytes --]
On 9/27/23 05:53, Corwin Brust wrote:
> Hi David
>
> On Tue, Sep 26, 2023 at 3:06 PM David Hedlund<public@beloved.name> wrote:
>>
>> On 9/26/23 21:11, Emanuel Berg wrote:
>>
>> David Hedlund wrote:
>>
>> So my original email suggest a complete solution, is this
>> something we can add to a new page,
>> https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
>> and then update it with improved solutions in the future?
>>
> AFAIK the HTML pages representing the online Emacs manual are defined
> within the sources for the manual, itself. IOW, to add a "page" for
> this would entail creating a new manual section, at which the new page
> would appear when new HTML versions of the manual are published, along
> with some subsequent release of Emacs (say, the next major version, if
> the change was made in the development branch).
Thank you!
>
>> Subject URL was new for me if nothing else :P
>>
>> Methods to always maximize `emacs` (for example, from Alt+F2 in MATE), without the slightly distracting visual effect when the default frame size is growing to fullscreen. The window will be maximized quickly, like "emacs --maximize".
>>
> This seems like very helpful information. As a precursor --or even an
> alternative-- to proposing a patch to the manual to provide these
> examples, what would you think of adding this into the EmacsWiki? I
> believe it is not unheard of to link from the manual to EmacsWiki,
> thus you could potentially simplify the patch involved by proposing
> adding some minimal explanation and a link (rather than
> providing/motivating a patch adding -e.g.- a section).
As far as I know, the devilspie2/.emacs solution that I figured out, is
the /only/ way to make emacs behave like `emacs -mm` right now. Both of
them will:
* Always run the settings regardless how emacs is opened (e.g. Alt+F2 in
MATE) despite that an external program (devilspie2) is used.
* The buffer will:
** Expand automatically when emacs opens
** Expand quickly like `emacs -mm`
* Like `emacs -mm`, the size of ~/.emacs does not impact the time it
takes to expand the buffer.
This makes the devilspie2 solution unique, since all solutions at
https://www.emacswiki.org/emacs/FullScreen makes the buffer expand
slowly. That's why I suggest that we should add my devilspie2/.emacs
solution to
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
>
>> GNU/Linux - proposed new section:https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html
>>
>>
>> As far as I know, this cannot be done entirely with Emacs LISP for GNU/Linux, but I found a workaround by combining it with devilspie2.
>>
>>
>> I've successfully used this recipe for Trisquel 11:
>>
>> * Step 1 to quickly maximize the window[1]: Install, configure, and autostart devilspie2 to nearly maximize emacs[1]. Run this in a terminal or as a script:
>>
>> # Install devilspie2
>> sudo apt-get -y install devilspie2
>>
>> # Configure devilspie2
>> mkdir -p ~/.config/devilspie2/
>>
>> width="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)"
>> height="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2)"
>>
>> tee ~/.config/devilspie2/emacs.lua /dev/null << EOF
>> if (get_class_instance_name() == "emacs") then
>>
>> set_window_geometry(0, 0, $width, $height);
>>
>> end
>> EOF
>>
>> # Autostart devilspie2
>> mkdir -p "$HOME/.config/autostart/" # The directory does not exist by default
>> cd "$HOME/.config/autostart/" || exit
>> file="devilspie-2.desktop"
>> touch "$file"
>> desktop-file-edit \
>> --set-name="Devilspie 2" \
>> --set-comment="Perform scripted actions on windows as they are created" \
>> --set-key="Type" --set-value="Application" \
>> --set-key="Exec" --set-value="devilspie2" \
>> --set-key="X-MATE-Autostart-Delay" --set-value="0" \
>> "$file"
>> desktop-file-validate "$file"
>>
>> * Step 2 to quickly maximize the window[1]: Add this to ~/.emacs: (add-to-list 'default-frame-alist '(fullscreen . maximized))
>> * Log out and then log back into your desktop environment
>> * Every time you open `emacs`, regardless how you are opening it, it will open the window equally fast as `emacs --maximize`
>>
>> [1]: Workaround to bug: maximize* commands don't work for Emacs -https://savannah.nongnu.org/bugs/index.php?63979
>>
>>
>>
>> The above steps can of course be rewritten and described for general use to make it useful for any GNU/Linux distro.
> Thanks for figuring all this out!
>
> Corwin
>
[-- Attachment #2: Type: text/html, Size: 6534 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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
` (2 more replies)
2023-09-28 23:26 ` Björn Bidar
1 sibling, 3 replies; 41+ messages in thread
From: chad @ 2023-09-28 20:05 UTC (permalink / raw)
To: David Hedlund; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 1368 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* 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
2023-09-28 20:05 ` chad
@ 2023-09-28 22:39 ` David Hedlund
2023-09-29 17:18 ` 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
2 siblings, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-28 22:39 UTC (permalink / raw)
To: emacs-devel, corwin
[-- Attachment #1: Type: text/plain, Size: 2632 bytes --]
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.
* ~/.emacs.d/early-init.el prevents the the visually distracting effect
is (add-to-list 'default-frame-alist '(fullscreen . maximized))
* Works for GNU/Linux (X11, Wayland), [Windows], [macOS], [BSD]
[-- Attachment #2: Type: text/html, Size: 4468 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-27 17:29 ` David Hedlund
2023-09-28 20:05 ` chad
@ 2023-09-28 23:26 ` Björn Bidar
2023-09-29 16:09 ` Emanuel Berg
2023-09-29 17:20 ` David Hedlund
1 sibling, 2 replies; 41+ messages in thread
From: Björn Bidar @ 2023-09-28 23:26 UTC (permalink / raw)
To: David Hedlund; +Cc: emacs-devel
David Hedlund <public@beloved.name> writes:
> On 9/27/23 17:10, David Hedlund wrote:
>>
>>
>> On 9/27/23 17:07, David Hedlund wrote:
>>>
>>>
>>> On 9/27/23 15:25, Emanuel Berg wrote:
>>>> David Hedlund wrote:
>>>>
>>>>> sudo apt install -y emacs wmctrl # Just press Enter during the
>>>>> "Postfix Configuration"
>>>>>
>>>>> tee ~/.emacs > /dev/null << 'EOF'
>>>>>
>>>>> (defun switch-full-screen ()
>>>>> (interactive)
>>>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>>>>>
>>>>> EOF
>>>> Yes, do that and then M-x switch-full-screen RET
>>>>
>>>> or just type
>>>>
>>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>>>>
>>>> and do C-x C-e for `eval-last-sexp'.
>>>>
>>>> It doesn't work?
>>>>
>>>
>>> Sorry, it works, I just expected the snippet from Emacs wiki to
>>> work out-of-the-box automatically. But I had to add: (add-hook
>>> 'after-init-hook 'switch-full-screen) . Also, "toggle" is useless
>>> for wmctrl in this situation, so I replaced it with "add", and I
>>> replaced "fullscreen" with "maximized_horz,maximized_vert"
>>>
>>> Here's the final solution for X11 (Trisquel, Ubuntu MATE), but not
>>> for Wayland (Ubuntu):
>>> (defun switch-full-screen ()
>>> (interactive)
>>> (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
>>
>> Sorry, I forgot to add (add-hook 'after-init-hook
>> 'switch-full-screen). Here's everything:
>>
>>
>> (defun switch-full-screen ()
>> (interactive)
>> (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
>> (add-hook 'after-init-hook 'switch-full-screen)
>>
>>
> Sorry, I just found out that even if it's added to the top of
> ~/.emacs, this will not expand the buffer quickly like `emacs -mm` for
> a typical ~/.emacs that need to load a lot of stuff. It will not
> expand the buffer faster than
>
> (add-to-list 'default-frame-alist '(fullscreen . maximized)) -- so
> it's a useless solution since it requires wmctrl
>
> Also, the wmctrl solution requires the package to be installed
>
Same for any other external solution such as your recommended solution devilspie2.
>
> Right now the only way to automaticall and always quickly expand the
> buffer like `emacs -mm`, regardless the size of ~/.emacs, is to use
> devilspie2 solution that I added in the first post in this thread.
Call wmctrl hook in after-make-frame-functions.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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 16:06 ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html David Hedlund
@ 2023-09-29 7:00 ` Eli Zaretskii
2023-09-29 17:12 ` David Hedlund
2 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2023-09-29 7:00 UTC (permalink / raw)
To: David Hedlund; +Cc: Emacs-devel
> Date: Tue, 26 Sep 2023 14:11:07 +0200
> From: David Hedlund <public@beloved.name>
>
> Methods to always maximize `emacs` (for example, from Alt+F2 in MATE), without the slightly
> distracting visual effect when the default frame size is growing to fullscreen. The window will be
> maximized quickly, like "emacs --maximize".
I'm not sure I understand the need for these methods. Doesn't F11 do
this job on all GUI subsystems we support?
And if you are talking about starting with a maximized frame, then why
aren't "emacs --maximize" and/or X resources (and their Registry
emulation on MS-Windows) good enough?
IOW, before describing your suggested solutions, and for the FAQ on
top of that, could you please describe the problem in more details,
specifically for each GUI environment/toolkit where you see a problem?
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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
1 sibling, 1 reply; 41+ messages in thread
From: Emanuel Berg @ 2023-09-29 16:09 UTC (permalink / raw)
To: emacs-devel
Björn Bidar wrote:
>> Also, the wmctrl solution requires the package to be
>> installed
>
> Same for any other external solution such as your
> recommended solution devilspie2.
Of course, for the external solution to work you need the
external solution.
A solution that is external but maybe feels more integrated is
to have the window manager maximize the window, should be just
up its alley.
One can also have the window manager execute external
commands for that matter. Here is an example for
openbsd-cwm(1) which I use on Debian
https://dataswamp.org/~incal/conf/.cwmrc
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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
0 siblings, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-29 17:12 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]
On 9/29/23 09:00, Eli Zaretskii wrote:
>> Date: Tue, 26 Sep 2023 14:11:07 +0200
>> From: David Hedlund<public@beloved.name>
>>
>> Methods to always maximize `emacs` (for example, from Alt+F2 in MATE), without the slightly
>> distracting visual effect when the default frame size is growing to fullscreen. The window will be
>> maximized quickly, like "emacs --maximize".
> I'm not sure I understand the need for these methods. Doesn't F11 do
> this job on all GUI subsystems we support?
>
> And if you are talking about starting with a maximized frame, then why
> aren't "emacs --maximize" and/or X resources (and their Registry
> emulation on MS-Windows) good enough?
>
> IOW, before describing your suggested solutions, and for the FAQ on
> top of that, could you please describe the problem in more details,
> specifically for each GUI environment/toolkit where you see a problem?
>
Please read the mail in this thread with 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" to
understand, so I don't need to re-send it.
[-- Attachment #2: Type: text/html, Size: 1734 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* 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
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
0 siblings, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-29 17:18 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 3098 bytes --]
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]
>
>
[-- Attachment #2: Type: text/html, Size: 5705 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-28 23:26 ` Björn Bidar
2023-09-29 16:09 ` Emanuel Berg
@ 2023-09-29 17:20 ` David Hedlund
1 sibling, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-29 17:20 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 2876 bytes --]
On 9/29/23 01:26, Björn Bidar wrote:
> David Hedlund<public@beloved.name> writes:
>
>> On 9/27/23 17:10, David Hedlund wrote:
>>>
>>> On 9/27/23 17:07, David Hedlund wrote:
>>>>
>>>> On 9/27/23 15:25, Emanuel Berg wrote:
>>>>> David Hedlund wrote:
>>>>>
>>>>>> sudo apt install -y emacs wmctrl # Just press Enter during the
>>>>>> "Postfix Configuration"
>>>>>>
>>>>>> tee ~/.emacs > /dev/null << 'EOF'
>>>>>>
>>>>>> (defun switch-full-screen ()
>>>>>> (interactive)
>>>>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>>>>>>
>>>>>> EOF
>>>>> Yes, do that and then M-x switch-full-screen RET
>>>>>
>>>>> or just type
>>>>>
>>>>> (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>>>>>
>>>>> and do C-x C-e for `eval-last-sexp'.
>>>>>
>>>>> It doesn't work?
>>>>>
>>>> Sorry, it works, I just expected the snippet from Emacs wiki to
>>>> work out-of-the-box automatically. But I had to add: (add-hook
>>>> 'after-init-hook 'switch-full-screen) . Also, "toggle" is useless
>>>> for wmctrl in this situation, so I replaced it with "add", and I
>>>> replaced "fullscreen" with "maximized_horz,maximized_vert"
>>>>
>>>> Here's the final solution for X11 (Trisquel, Ubuntu MATE), but not
>>>> for Wayland (Ubuntu):
>>>> (defun switch-full-screen ()
>>>> (interactive)
>>>> (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
>>> Sorry, I forgot to add (add-hook 'after-init-hook
>>> 'switch-full-screen). Here's everything:
>>>
>>>
>>> (defun switch-full-screen ()
>>> (interactive)
>>> (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
>>> (add-hook 'after-init-hook 'switch-full-screen)
>>>
>>>
>> Sorry, I just found out that even if it's added to the top of
>> ~/.emacs, this will not expand the buffer quickly like `emacs -mm` for
>> a typical ~/.emacs that need to load a lot of stuff. It will not
>> expand the buffer faster than
>>
>> (add-to-list 'default-frame-alist '(fullscreen . maximized)) -- so
>> it's a useless solution since it requires wmctrl
>>
>> Also, the wmctrl solution requires the package to be installed
>>
> Same for any other external solution such as your recommended solution devilspie2.
I'm happy to inform that Chat just solved it without external programs,
see the mail with 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"
>> Right now the only way to automaticall and always quickly expand the
>> buffer like `emacs -mm`, regardless the size of ~/.emacs, is to use
>> devilspie2 solution that I added in the first post in this thread.
> Call wmctrl hook in after-make-frame-functions.
>
I don't know Lisp. Can you please send the full Emacs Lisp code for that?
[-- Attachment #2: Type: text/html, Size: 4296 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-29 17:12 ` David Hedlund
@ 2023-09-29 17:35 ` Eli Zaretskii
2023-09-29 20:57 ` David Hedlund
0 siblings, 1 reply; 41+ messages in thread
From: Eli Zaretskii @ 2023-09-29 17:35 UTC (permalink / raw)
To: David Hedlund; +Cc: emacs-devel
> Date: Fri, 29 Sep 2023 19:12:15 +0200
> From: David Hedlund <public@beloved.name>
>
> I'm not sure I understand the need for these methods. Doesn't F11 do
> this job on all GUI subsystems we support?
>
> And if you are talking about starting with a maximized frame, then why
> aren't "emacs --maximize" and/or X resources (and their Registry
> emulation on MS-Windows) good enough?
>
> IOW, before describing your suggested solutions, and for the FAQ on
> top of that, could you please describe the problem in more details,
> specifically for each GUI environment/toolkit where you see a problem?
>
> Please read the mail in this thread with 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" to understand, so I don't need to re-send it.
I always read everything on this list. I read those messages as well.
You don't need to repeat them. But if the suggestions proposed here
didn't solve the problems you had in mind, my question still stands.
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-29 16:09 ` Emanuel Berg
@ 2023-09-29 17:46 ` David Hedlund
0 siblings, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-29 17:46 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 944 bytes --]
On 9/29/23 18:09, Emanuel Berg wrote:
> Björn Bidar wrote:
>
>>> Also, the wmctrl solution requires the package to be
>>> installed
>> Same for any other external solution such as your
>> recommended solution devilspie2.
> Of course, for the external solution to work you need the
> external solution.
>
> A solution that is external but maybe feels more integrated is
> to have the window manager maximize the window, should be just
> up its alley.
>
> One can also have the window manager execute external
> commands for that matter. Here is an example for
> openbsd-cwm(1) which I use on Debian
>
> https://dataswamp.org/~incal/conf/.cwmrc
>
As I told Björn earlier:
I'm happy to inform that Chat just solved it without external
programs, see the mail with 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"
[-- Attachment #2: Type: text/html, Size: 1712 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* 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
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
0 siblings, 2 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-29 17:54 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 3823 bytes --]
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
>>
>> * 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.
>> * 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: 7674 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* 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
2023-09-29 17:54 ` David Hedlund
@ 2023-09-29 19:46 ` Emanuel Berg
2023-09-30 15:50 ` David Hedlund
1 sibling, 0 replies; 41+ messages in thread
From: Emanuel Berg @ 2023-09-29 19:46 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
> * 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.
Previously in this thread I was confused, now I can't
think straight.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
2023-09-29 17:35 ` Eli Zaretskii
@ 2023-09-29 20:57 ` David Hedlund
0 siblings, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-29 20:57 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 3909 bytes --]
On 9/29/23 19:35, Eli Zaretskii wrote:
>> Date: Fri, 29 Sep 2023 19:12:15 +0200
>> From: David Hedlund<public@beloved.name>
>>
>> I'm not sure I understand the need for these methods. Doesn't F11 do
>> this job on all GUI subsystems we support?
>>
>> And if you are talking about starting with a maximized frame, then why
>> aren't "emacs --maximize" and/or X resources (and their Registry
>> emulation on MS-Windows) good enough?
>>
>> IOW, before describing your suggested solutions, and for the FAQ on
>> top of that, could you please describe the problem in more details,
>> specifically for each GUI environment/toolkit where you see a problem?
>>
>> Please read the mail in this thread with 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" to understand, so I don't need to re-send it.
> I always read everything on this list. I read those messages as well.
> You don't need to repeat them. But if the suggestions proposed here
> didn't solve the problems you had in mind, my question still stands.
>
-------------------------------------------------------8<------------------------------------------------------------------
From
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-MS_002dWindows.html
5.48 How can I start Emacs in fullscreen mode on MS-Windows?
Beginning with Emacs 24.4 either run Emacs with the ‘--maximized’
command-line option or put the following form in your init file (see How
do I set up an init file properly?
<https://www.gnu.org/software/emacs/manual/html_mono/efaq.html#Setting-up-a-customization-file>):
(add-hook 'emacs-startup-hook 'toggle-frame-maximized)
With older versions use the function |w32-send-sys-command|. For
example, you can put the following in your init file:
(add-hook 'emacs-startup-hook
(lambda () (w32-send-sys-command ?\xF030)))
To avoid the slightly distracting visual effect of Emacs starting with
its default frame size and then growing to fullscreen, you can add an
‘Emacs.Geometry’ entry to the Windows Registry settings. See X Resources
<https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#X-Resources>
in The GNU Emacs Manual. To compute the correct values for width and
height you use in the Registry settings, first maximize the Emacs frame
and then evaluate |(frame-height)| and |(frame-width)| with M-:.
Alternatively, you can avoid the visual effect of Emacs changing its
frame size entirely in your init file (i.e., without using the
Registry), like this:
(setq frame-resize-pixelwise t)
(set-frame-position nil 0 0)
(set-frame-size nil (display-pixel-width) (display-pixel-height) t)
------------------------------------------------------->8------------------------------------------------------------------
-------------------------------------------------------8<------------------------------------------------------------------
Proposed new page
https://www.gnu.org/software/emacs/manual/html_node/efaq/*Maximized*-mode-on-GNU-Linux.html
How can I start Emacs in maximized mode on GNU/Linux?
Beginning with Emacs 24.4 either run Emacs with the ‘--maximized’
command-line option or put the following form in your init file (see How
do I set up an init file properly?
<https://www.gnu.org/software/emacs/manual/html_mono/efaq.html#Setting-up-a-customization-file>):
(add-hook 'emacs-startup-hook 'toggle-frame-maximized)
To avoid the slightly distracting visual effect of Emacs starting with
its default frame size and then being *maximized*, you can add an add
this to ~/.emacs.d/early-init.el:
(push '(fullscreen . maximized) default-frame-alist)
------------------------------------------------------->8------------------------------------------------------------------
[-- Attachment #2: Type: text/html, Size: 6189 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* 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
2023-09-29 17:54 ` David Hedlund
2023-09-29 19:46 ` Emanuel Berg
@ 2023-09-30 15:50 ` David Hedlund
2023-10-05 4:01 ` David Hedlund
1 sibling, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-09-30 15:50 UTC (permalink / raw)
To: emacs-devel
[-- 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 --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* 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
2023-09-30 15:50 ` David Hedlund
@ 2023-10-05 4:01 ` David Hedlund
2023-10-05 4:19 ` Emanuel Berg
0 siblings, 1 reply; 41+ messages in thread
From: David Hedlund @ 2023-10-05 4:01 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 6458 bytes --]
On 9/30/23 17:50, David Hedlund wrote:
>
>
> 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]
>>>>
>>>>
EmacsWiki Full Screen, section Configuring fullscreen mode -
https://www.emacswiki.org/emacs/FullScreen#h5o-2
Probably the simplest way to configure fullscreen or maximized mode is
to customize |initial-frame-alist|
(custom-set-variables
'(initial-frame-alist (quote ((fullscreen . maximized)))))
----------------Text that I added
----------------------8<---------------------
To avoid the slightly distracting visual effect of Emacs
starting with its default frame size and then growing to fullscreen, you
can add an the above lines to .emacs.d/early-init.el instead of .emacs
(thanks Chad). This has been successfully tested in GNU/Linux (both X11,
and Wayland), and Windows. -----------------End text that I added
----------------------8<-----------------------------
[-- Attachment #2: Type: text/html, Size: 12697 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* 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
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
0 siblings, 1 reply; 41+ messages in thread
From: Emanuel Berg @ 2023-10-05 4:19 UTC (permalink / raw)
To: emacs-devel
David Hedlund wrote:
> To avoid the slightly distracting visual effect of Emacs
> starting with its default frame size and then growing to
> fullscreen, you can add an the above lines to
> .emacs.d/early-init.el instead of .emacs (thanks Chad).
> This has been successfully tested in GNU/Linux (both X11,
> and Wayland), and Windows.
Another option is to not kill Emacs, then you don't have to
start it all the time.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux -- Lisp code for `emacs --maximize`
2023-10-05 4:19 ` Emanuel Berg
@ 2023-10-19 13:57 ` David Hedlund
0 siblings, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-10-19 13:57 UTC (permalink / raw)
To: emacs-devel, Eli Zaretskii
[-- Attachment #1: Type: text/plain, Size: 480 bytes --]
I like Chad's solution to |.emacs.d/early-init.el: |(push '(fullscreen .
maximized) default-frame-alist)
However, I'd like to compare it with the Lisp code that is executed by
`emacs --maximize`, can someone please help with find it?
If it's better than Chad's solution, then I'm willing to update "To
avoid the slightly distracting visual effect"
(https://www.emacswiki.org/emacs/FullScreen#h5o-3) with code and a
comment to the source file where this code is found.
||
[-- Attachment #2: Type: text/html, Size: 935 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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-10-27 2:19 ` David Hedlund
2023-11-10 11:04 ` David Hedlund
2 siblings, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-10-27 2:19 UTC (permalink / raw)
To: chad, Stefan Kangas, Eli Zaretskii; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1531 bytes --]
On 2023-09-28 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
>
Wouldn't it be useful to write some lisp that could automatically
generate ~/.emacs.d/early-init.el from .emacs?:
* Check if ~/.emacs.d/early-init.el contains:
(push '(fullscreen . maximized) default-frame-alist)
* If ~/.emacs.d/early-init.el does
* not exist
* exist but does not contain the above code
then:
* add the above code to ~/.emacs.d/early-init.el
* restart emacs or send a message to the minibuffer that it must be
restarted in order for the setting to take effect.
[-- Attachment #2: Type: text/html, Size: 2871 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
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-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
2 siblings, 0 replies; 41+ messages in thread
From: David Hedlund @ 2023-11-10 11:04 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]
On 2023-09-28 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
>
"
...pushed the patch to master.
[1: 0e59541fa20]: 2023-11-04 14:56:36 +0100
Make FAQ on starting Emacs maximized portable
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0e59541fa203d7ecb6afcf0ce7805e87d41bdc65
" -https://lists.gnu.org/archive/html/emacs-devel/2023-11/msg00171.html
[-- Attachment #2: Type: text/html, Size: 2889 bytes --]
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2023-11-10 11:04 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.