From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Is there a way to control where frames get created? Date: Sun, 30 Sep 2018 01:37:03 +0000 (UTC) Message-ID: <0aff37d0-70b6-411a-8cb3-fd7195dfc4f3@default> References: <20180929183701.0b49b97d@jabberwock.cb.piermont.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1538271358 19982 195.159.176.226 (30 Sep 2018 01:35:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2018 01:35:58 +0000 (UTC) To: "Perry E. Metzger" , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 30 03:35:53 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6QeG-00053l-Hi for ged-emacs-devel@m.gmane.org; Sun, 30 Sep 2018 03:35:52 +0200 Original-Received: from localhost ([::1]:53225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6QgM-0002Iw-Kd for ged-emacs-devel@m.gmane.org; Sat, 29 Sep 2018 21:38:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Qfh-000269-Lu for emacs-devel@gnu.org; Sat, 29 Sep 2018 21:37:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6QfZ-0006WX-Rn for emacs-devel@gnu.org; Sat, 29 Sep 2018 21:37:18 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:49796) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g6QfX-0006Ul-T7 for emacs-devel@gnu.org; Sat, 29 Sep 2018 21:37:13 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8U1Yo64014166; Sun, 30 Sep 2018 01:37:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=qHNk8fFQPnBGlQSnAQ2sefWyL2thZAUu3mVLrgfeaeU=; b=1IMPtgZw4S8MHCxIbJcXQlPbQcTiS6uVKdd1Qm8uLMgzV08jHPU+e17OvYFzygZTZANC OFBBPZiGxwnJEDF7cZt2IEMVtVUnqQWKTkuSGuesF+/3TQ4GjqeaomRl/z7ywVvuMfZe 1YBBifpgQ8+/it5eQtfcyQt2H1gcubNj3zuQbhWXlW48nHxDGpFdlWB+14UtF8ytZ0I+ xMIUUUYXA2YFHuB8PBfF4ilpVpz60L8CV+06MO4jPSMyFyx9mYodXWKzQRlUWtvm0//I 9qiduAfNGMMsHRdz9yiapqOGySu33tM2s0pE46AEovlXZDSaT+M4Z8bH0WBE4rrNLixe xg== Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2mt21qhxv6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 30 Sep 2018 01:37:09 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8U1b7hl002480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 30 Sep 2018 01:37:08 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8U1b32k021009; Sun, 30 Sep 2018 01:37:04 GMT In-Reply-To: <20180929183701.0b49b97d@jabberwock.cb.piermont.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9031 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809300016 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230158 Archived-At: > I'd like to rig things up so that make-frame-command creates its new > frame adjacent to the existing frame if that's geometrically > possible on the GUI display. To do that, I'd need to both be able to > find out where the existing frame is, and to tell make-frame-command > where to create the new frame. >=20 > Are there any hooks that make this possible? Any advice on how I might > go about doing it? Not sure exactly what you're asking. Adjacent in what direction? What do yo= u mean by "geometrically possible" - do you mean if the display is wide eno= ugh (if adjacent horizontally) or tall enough (if adjacent vertically)? Do = you allow the existing frame to be resized at all - e.g. to tile it and th= e new frame together on the display? Do you allow for multiple monitors - a= nd if so, in what configurations? Anyway, you can get the current frame position and size from its frame para= meters, and you can set the new frame position and size based on some trans= formation of those of the existing frame. The code in frame-cmds.el might help, either directly (e.g. if tiling) or i= ndirectly. See, for example, command `create-frame-tiled-horizontally': Horizontally tile screen with selected frame and a copy. The same character size is used for the new frame. https://www.emacswiki.org/emacs/download/frame-cmds.el