From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: make-frame-command with multiple munitors Date: Tue, 20 Sep 2022 19:07:07 +0800 Message-ID: <875yhil2xw.fsf@yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33776"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: emacs-devel To: Pedro Andres Aranda Gutierrez Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 20 16:34:18 2022 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 1oaeKH-0008YO-Dm for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Sep 2022 16:34:17 +0200 Original-Received: from localhost ([::1]:45188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaeKG-00031a-4n for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Sep 2022 10:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oab65-0006ed-5o for emacs-devel@gnu.org; Tue, 20 Sep 2022 07:07:25 -0400 Original-Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]:35608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oab63-0003Gw-8p for emacs-devel@gnu.org; Tue, 20 Sep 2022 07:07:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1663672038; bh=IuJVs6Kz+eUf7xEyxQU2kwBXji1jbCFpHGzfV5KQrks=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=J9Fgm3eO3ZgfJ5HyT1vZL0xf+lenozinbu5CauYNfdQJvUR3ZhV4E6lOa7QC8oYSO7WgNHy8ISzQuSobGTVEVjRUyc0FVhwIZQlx+TIRTWq0a5RgvC8GE9hWO0yDO7VilpWroQWDQqsstmpSpSP0Fm/wQ4Bl9XNPDGZOai2MagXXSkaucqz9atYyCpgoQv12cf47yt2WhJK5dnIGfbft8oNj8qf7Ic2pgoTcBBMVWOd0S/40Kvq9+2MYrw0u75kUOIj5GOR8eNe4OyWe0m/z20G9qGk6+UU1RrTF55gn63NYjBWBKY75BKIEiDYDp804y1ayAqkI9Q1VieCPIJPnwQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1663672038; bh=sJ0542eYhkuYlyrKMMU55ZELOpKloyxLo/JAGSovM2c=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=cLTbUnglcsXugJxf0ANKmahAVsdieZwqepDeEaySW0rA1f5SQ6pz1n//AW/Y5yzjtLAfbRJ6lBEVS73NJfMMOTjln8aFL9Mrpb+LbeSETbPSlBE6cVvTpTHxyPXk8VzhjeuSImYl0DMnWmGuTF52MeiMdhNUAPfE9eDRnA491AYtcsKzJBnYoSzORjEfiYgVYRVOQ37cnV77qsbkcsBauaHWBUhw6x1M/Xy0ZTfrcvjOq0leOoELE3coOjBSSYebDfoaKC5cXf82KiXW2RP9vg0g8llKpIZkKoaEkUfGzaTwYHz9dTk4ofiLTip/lvdfpjxuF+w5bEGvs/AFQJN/cA== X-YMail-OSG: K7Tj1XwVM1nVi0aGk9Rt9moLTTOdScvge1Xk4Uz.auxy6b.gyiXh2yQFMxderLS frkZ4esdrucBwDCJBsua4PrI8WJHkV.mA4pxCnjpl5hCkeyKKJVt4UTCQHD_1JQ2iZx_3rwj3LHb vGyVVkG8MBLuvySAJXE755kx.h1nPyoCF8BL6BDWZnNyDYMwFmUah5CrL2GOXnq_VLVS8f9a4rCJ u6rs0NlbxTM_c4.smuo6CsO6moKW7cqYzxLKJ9b8J5sz3r5nQXbG48keKU_HinHDmNYTpTqMQogU Cx7xt.pkb3NngcBHQ54at0Tf6mE7jXZGwbkzrFiOC0BsAsxby206FRfCUFBkVdDbTshh0qmNYVMk ckTZNKwKQxfKWx_Cu29GlTe8Y3uKswf9FRCWmKfmxoo3I3zR27ANHT0DTW_4IgneSqy2GTlE.i_h 1LSiX6n8f_cW7BpaKLRBInojBtd48vK3bGYF3WTsAVOF_X3s1Rqs2qRxsJqiu6Z_QJG.mDaxFm.c Slla_NudWIhxUv_iwAwDCUpXyv0qGDmlMKQ8vt.jJCc3YMioLSMOq81tQMIrmHKrjY._.HQr8eu. t57hrSZDuNZCSaDyfH27I6q9V7aiQfsdq1zO4mBi.CEoskLDcynNSAzdtwxfRUCajm1TazpxdivJ aL1GEerZtgZPSmQ7Qk84jpwzTqXikhCcjpm6OIJp9JSbMbx_0Ymm_ZKT2Mi3lElpN5EgdhSeq7q1 mXqawg3UAbz3ZoNPZGIi3aJk2t8Qs9Hqy3PM9l7sLQyjloiwjpqdKWR5bPDCnQLsmELE8RjdngzI ccFndhRdGXSWwrgYn56oXoZpurTTLELzRSh4FbLCYc X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Tue, 20 Sep 2022 11:07:18 +0000 Original-Received: by hermes--canary-production-sg3-6bb8946c47-ts4tq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 28ea3b507e7ef6fcbb302c4f6626bf47; Tue, 20 Sep 2022 11:07:11 +0000 (UTC) In-Reply-To: (Pedro Andres Aranda Gutierrez's message of "Tue, 20 Sep 2022 11:35:34 +0200") X-Mailer: WebService/1.1.20663 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.31; envelope-from=luangruo@yahoo.com; helo=sonic307-56.consmr.mail.ne1.yahoo.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, 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-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" Xref: news.gmane.io gmane.emacs.devel:295803 Archived-At: Pedro Andres Aranda Gutierrez writes: > Christopher Dimech writes: > >> Emacs has the capability of placing a frame at some position. It is then >> logical for emacs to look into the monitor configuration to determine the >> current monitor (then placing at corners or center oy monitor). It would >> a feature very much appreciated if made to happen. > > +1. I'm doing it on my own with: > (defun reposition-after-init () > "Re-position the frame in a display (Only for emacs 29 and above)" > (when (> emacs-major-version 28) > (let* ((monitor-attributes (frame-monitor-attributes)) > (work-area (assq 'workarea monitor-attributes)) > (x-min (nth 1 work-area)) > (y-min (nth 2 work-area)) > (new-x (+ x-min 32)) > (new-y (+ y-min 32))) > (message "work-area: %s -> %d %d" work-area new-x new-y) > (set-frame-position (selected-frame) new-x new-y)))) > Hooked to the startup in > > (add-hook #'after-init-hook #'reposition-after-init) > > This works when you do NOT specify (left or top) in the default-frame-alist or initial-frame-alist > > It would be nice to have a (current-monitor . t) in the default-frame-alist or initial-frame-alist to do this ;-) What window manager are you using?