From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Karr Newsgroups: gmane.emacs.help Subject: How can I automatically determine the best frame-height? Date: Tue, 20 Apr 2021 14:45:28 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35770"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 20 23:46:22 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1lYyCL-0009C2-Se for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 20 Apr 2021 23:46:21 +0200 Original-Received: from localhost ([::1]:52680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYyCK-0002uf-Tm for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 20 Apr 2021 17:46:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYyBk-0002uG-0c for help-gnu-emacs@gnu.org; Tue, 20 Apr 2021 17:45:44 -0400 Original-Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:46855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYyBi-00058C-Cc for help-gnu-emacs@gnu.org; Tue, 20 Apr 2021 17:45:43 -0400 Original-Received: by mail-pf1-x42c.google.com with SMTP id d124so26591219pfa.13 for ; Tue, 20 Apr 2021 14:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/zAjpR6WH8nXbvtwVaDks1claM/QU+9EPhwgnrq+hJU=; b=ina3fxRd7CAs5eIKZxtPetglJh5reHa76D2prSbTbaruGFR+0TUC4imNovAu0aB+OD sYgGfgnf/yCMJP+ikii116QoCJWykJMsCvoZPo9CucjQRtrj4hjfdcntD9WDBkeFTyiN buQWzLDjb1D+pcOvRwT4aW6ZxUVt+hqXAVBWyhRJ/3VJ8pkPttt7aRPbfzx6Xv4znpmj MOoqrMjVUys7ebhvM3ETlXemBd/XQejBMZ12CQQ461Ox1GGsPvCdyeTXXd62CBOzt1gd ZiMk04IR6jG1MeMb/qbxDC2XIQqk7uh7lggjPUGsB6UugiiESNFCpZNbgvsG52hPBY5e klBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/zAjpR6WH8nXbvtwVaDks1claM/QU+9EPhwgnrq+hJU=; b=JPxNRKvihNEJPFXd/x0c24qXorlKa4h1dSf2iioQQDJrUKN2OgMaoaF2mdZVEoF68+ aGyyzIiqJX0ToxUwaHd+p06T+hfM/kfdHERSesq6xEUMg7iK0PbisWjS0ZlaqlcfRaJX avEHUJXRqWgAZaJMPIWrL1MnvCi81GY2LMR1O8nJHaZcDAGzYYxSjazrSlAEhJELesTW 3IF9kSaayBzs4F1/fjTBf0jJPLKnp6oGsPoYeZQcaA3o0B57I2TAQish6vOoBJpZazzY Y1OLt6/b0A5fRwoyJV1aKKxdaoqG35jO3LZe4ZYqpMX/Ja1qL7ClrcOwKyRrPrnUomsI 1cYA== X-Gm-Message-State: AOAM531KZOfG7SbvAtsJVbcvI1pvnRrFw/5roJtjr9C93GjyNcQD1w9S mny6nEMwjcFTCj6VoMxHw+OT3W1G3NelWxwa/kyuumca9PscdA== X-Google-Smtp-Source: ABdhPJz+UQbDVOkPgq9BNJKQMop8jfGtfmJGPep8ikjMok4haW13R7d/71EKX1cbPpKCxwNoQyFp62umY0IjznwhNDo= X-Received: by 2002:a17:90b:2291:: with SMTP id kx17mr7013454pjb.79.1618955139568; Tue, 20 Apr 2021 14:45:39 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=davidmichaelkarr@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129100 Archived-At: In my .emacs file, I have code like the following at the top: ------------- (set-frame-position (selected-frame) 0 0) (set-frame-height (selected-frame) 68) -------------- I typically run on a Windows 10 laptop, connecting to an external monitor. The frame height of 68 works out to put the status line just above the Windows status bar, when connecting to my usual monitor. Sometimes, I run the laptop without an external monitor. In that case, that startup code is a little annoying, as I then have to shrink and move the window a few times until I get it in the right position. Is there a better way to do this, so it will just automatically size itself so that the top is at the top of the screen, and the bottom is snug against the status bar? I normally run this on Cygwin, but I run the same .emacs file on my Ubuntu VM running on the same laptop.