From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Hedlund Newsgroups: gmane.emacs.devel Subject: Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux Date: Tue, 26 Sep 2023 17:57:36 +0200 Message-ID: References: <19e53542-bfb0-4e48-8845-01fd34d93dbb@beloved.name> <87zg19ja6k.fsf@thaodan.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------etcWJ8iT0a5aYwBfssR0dMUb" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36219"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 26 17:58:56 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qlASd-0009DO-Jv for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Sep 2023 17:58:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlARd-0007Hy-Dp; Tue, 26 Sep 2023 11:57:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlARX-0007D0-6m for emacs-devel@gnu.org; Tue, 26 Sep 2023 11:57:49 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlARR-0007TJ-Jp for emacs-devel@gnu.org; Tue, 26 Sep 2023 11:57:44 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id BF0B920007 for ; Tue, 26 Sep 2023 15:57:37 +0000 (UTC) Content-Language: en-US In-Reply-To: <87zg19ja6k.fsf@thaodan.de> X-GND-Sasl: public@beloved.name Received-SPF: pass client-ip=217.70.183.200; envelope-from=public@beloved.name; helo=relay7-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311088 Archived-At: This is a multi-part message in MIME format. --------------etcWJ8iT0a5aYwBfssR0dMUb Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/26/23 16:12, Björn Bidar wrote: > David Hedlund 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. --------------etcWJ8iT0a5aYwBfssR0dMUb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


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.


--------------etcWJ8iT0a5aYwBfssR0dMUb--