From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#30074: 26.0; Add function(s) for current monitor info Date: Sun, 14 Jul 2019 22:49:23 +0300 Organization: LINKOV.NET Message-ID: <87muhgtn0c.fsf@mail.linkov.net> References: <17da2391-a30c-4d5f-9ffd-1758b18c34f3@default> <87k1cky0e5.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="240895"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 30074@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 21:53:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmkYY-0010Yg-M3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 21:53:11 +0200 Original-Received: from localhost ([::1]:33888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmkYX-0000mX-Ox for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 15:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44126) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmkYR-0000Yq-Uy for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:53:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmkYR-0002rm-2x for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:53:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmkYQ-0002re-TP for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmkYQ-0006Ds-RC for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2019 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30074 X-GNU-PR-Package: emacs Original-Received: via spool by 30074-submit@debbugs.gnu.org id=B30074.156313393823856 (code B ref 30074); Sun, 14 Jul 2019 19:53:02 +0000 Original-Received: (at 30074) by debbugs.gnu.org; 14 Jul 2019 19:52:18 +0000 Original-Received: from localhost ([127.0.0.1]:46011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmkXi-0006Ci-9D for submit@debbugs.gnu.org; Sun, 14 Jul 2019 15:52:18 -0400 Original-Received: from dog.birch.relay.mailchannels.net ([23.83.209.48]:62841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmkXg-0006CZ-JJ for 30074@debbugs.gnu.org; Sun, 14 Jul 2019 15:52:17 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 26176212F1; Sun, 14 Jul 2019 19:52:15 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a64.g.dreamhost.com (100-96-14-124.trex.outbound.svc.cluster.local [100.96.14.124]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id AB2B8202DD; Sun, 14 Jul 2019 19:52:14 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a64.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.3); Sun, 14 Jul 2019 19:52:15 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Drop-Suffer: 2c38c4723e561894_1563133934973_653506747 X-MC-Loop-Signature: 1563133934973:1274744681 X-MC-Ingress-Time: 1563133934973 Original-Received: from pdx1-sub0-mail-a64.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a64.g.dreamhost.com (Postfix) with ESMTP id 609F67F5B4; Sun, 14 Jul 2019 12:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=IZUIXLAsbrmZgEbtjltfvlBOnsY=; b= 0zzu26o7MbXPTo/mHb4Dis6Lk3I6oYYOARijdmwlEIp82ydHEEEGwuiXbInyqQy0 pVASrk3Fxdpf1GXG3Y+f5roGxQUHtvTb2R4V2r51UYamYdOcjoEyWwfdlLnYk3nj 7eK89axdeO/O+oZbEE/2l/4MitSpflr3HajFjAR/24A= Original-Received: from mail.jurta.org (m91-129-103-134.cust.tele2.ee [91.129.103.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a64.g.dreamhost.com (Postfix) with ESMTPSA id 59D8C7F5F3; Sun, 14 Jul 2019 12:52:06 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a64 In-Reply-To: <87k1cky0e5.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Sun, 14 Jul 2019 19:46:42 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrheehgddugeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdefrddufeegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtfedrudefgedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehlrghrshhisehgnhhushdrohhrghenucevlhhushhtvghrufhiiigvpedu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163032 Archived-At: >> Please consider adding a function that returns the info describing the >> monitor that dominates a frame (default: selected frame). In >> particular, the size of the monitor. This can be useful, for example, >> for positioning a frame when there are multiple monitors. >> >> I've been using this, but you might have a better implementation in >> mind: >> >> (defun current-monitor (&optional frame) >> "Attributes of monitor that dominates FRAME (default: `selected-frame')." >> (catch 'current-monitor >> (dolist (atts (display-monitor-attributes-list frame)) >> (when (member (or frame (selected-frame)) (cdr (assq 'frames atts))) >> (throw 'current-monitor atts))) >> nil)) ; Should never happen (?) > > I guess it's possible for a frame to be on several monitors? (Half on > one and half on another.) What would this function return in that case? There is already `frame-monitor-attributes' added in Emacs 24 (see NEWS.24), e.g. (frame-monitor-attributes (selected-frame))