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: Wed, 27 Sep 2023 19:29:23 +0200
User-agent: Mozilla Thunderbird


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.



reply via email to

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