emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `ema


From: David Hedlund
Subject: Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
Date: Fri, 29 Sep 2023 19:20:39 +0200
User-agent: Mozilla Thunderbird


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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]