From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pedro Andres Aranda Gutierrez Newsgroups: gmane.emacs.devel Subject: Re: Re: Re: make-frame-command with multiple munitors Date: Tue, 20 Sep 2022 11:35:34 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005e058005e9188ec2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2623"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 20 12:11:45 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 1oaaED-0000Wm-Od for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Sep 2022 12:11:45 +0200 Original-Received: from localhost ([::1]:56004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaaEC-0002zq-Lh for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Sep 2022 06:11:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaZfi-0002Es-7R for emacs-devel@gnu.org; Tue, 20 Sep 2022 05:36:10 -0400 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:36398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaZfg-0003C8-FD for emacs-devel@gnu.org; Tue, 20 Sep 2022 05:36:05 -0400 Original-Received: by mail-ej1-x635.google.com with SMTP id 13so4748680ejn.3 for ; Tue, 20 Sep 2022 02:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=Hp7FxcfUNbUsTSOIddyfo/i/7GJvOY+vRcFEy9s8tAQ=; b=LdESIBreFR8xfueNcKn+WAYeQO1IhjMvhBAtAj3Avm6FLXb8Xh5PhmMIMxBuLXLngv UuXFA3lKwN2wBt2HF3LSYrYPV2tFhX+w6g0ZN3bnHz1UMx5U2JniqP7t1o4cffMDX8MV DFiv7iSfH3izDkfbcAVQ6AUhnHbYgp3NPA0aGKgLu+YuvISdaIPgeCuxJUzdE/3Aav6Q TmADNxwP/sWP9kQHRk50MG1smOCwvRLk5l3+LxiDSewBtvWrmhckxhvg65wEYuRdckOq WyQA9JRY0W4QSudcC1nj5aRdJwd+aYy8Y8RQlpCK33JAo9jDG27KTXwpwYjmF2tlgMTX 9zzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=Hp7FxcfUNbUsTSOIddyfo/i/7GJvOY+vRcFEy9s8tAQ=; b=0VldYp3U0Qqay1Yb0SxfE8TGhQkDlcPQVmlMTEQC5AMQQMMUzU8cqF8hN2gVtKETlB 17FSZOK7/HQ6U/hv/jl/UDjIPf9AMoyAInDuCUQnwSzOarWaPssH16zcMiRvY7YnzzJT iHxVmZalUWRGb9uzXLtyEfsKI8ZEILo0UCuSVziaCHsODwXAwQlIXqV/fTUrSrnsf/53 VeJVvTuAG5GVQiKP3CwDq4e+Sk6Di46h2LGaK/e95tsnKvG0tUdj598SUxVrVpsZryru Vo/UWNA+s2X2dJ8dPbsWZ3GroBVJk1j1rfA1v4SXnTWRSAAFxwF4SmArqMCOGQe4LfRM rutg== X-Gm-Message-State: ACrzQf2H8JU+2OCbrcnuMyiEPDFyeE7JhxBaOXEDLr55DAqcrm9FC6jX /t17IRRydL1AMgyYU9cOPvjztO0WxrXgfTziHLtbZt+TKUA= X-Google-Smtp-Source: AMsMyM7UzdQLJwnUI4s03+uehJV2pb+qF97HHrpCX3COnB6N8HRcWgFHJ24Z5++nQig8JUD7IF4qCGz9KEGOdgDSeYM= X-Received: by 2002:a17:906:4fd2:b0:781:320f:b779 with SMTP id i18-20020a1709064fd200b00781320fb779mr8313324ejw.59.1663666560565; Tue, 20 Sep 2022 02:36:00 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=paaguti@gmail.com; helo=mail-ej1-x635.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-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:295793 Archived-At: --0000000000005e058005e9188ec2 Content-Type: text/plain; charset="UTF-8" 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 ;-) //PA PS: tested on X and mac -- Fragen sind nicht da um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet --0000000000005e058005e9188ec2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Christopher Dimech <dimech@gmx.com> writes:

> Emacs has the capability of placing a= frame at some position.=C2=A0 It is then
> logical for emacs = to look into the monitor configuration to determine the
> curr= ent monitor (then placing at corners or center oy monitor).=C2=A0 It would<= /div>
> 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)&qu= ot; (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 #'afte= r-init-hook #'reposition-after-init)

Thi= s works when you do NOT specify (left or top) in the default-frame-alist or= initial-frame-alist=C2=A0

It would be nice to hav= e a (current-monitor . t) in the default-frame-alist or initial-frame-alist= to do this ;-)

//PA

PS: = tested on X and mac
--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
=
Headaches with a Juju log:
unit-basic-16: 09:17:36= WARNING juju.worker.uniter.operation we should run a leader-deposed hook h= ere, but we can't yet

=
--0000000000005e058005e9188ec2--