From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: How to get a window Lisp_Object from struct window *w? Date: Mon, 17 Sep 2018 17:57:45 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1537232201 32652 195.159.176.226 (18 Sep 2018 00:56:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2018 00:56:41 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 18 02:56:37 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 1g24Jg-0008NH-34 for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2018 02:56:36 +0200 Original-Received: from localhost ([::1]:37949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g24Lm-0006j3-JQ for ged-emacs-devel@m.gmane.org; Mon, 17 Sep 2018 20:58:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g24LA-0006ix-BB for emacs-devel@gnu.org; Mon, 17 Sep 2018 20:58:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g24L2-0000Nm-LI for emacs-devel@gnu.org; Mon, 17 Sep 2018 20:58:06 -0400 Original-Received: from gateway22.websitewelcome.com ([192.185.47.163]:11741) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g24L2-0000DY-Ar for emacs-devel@gnu.org; Mon, 17 Sep 2018 20:58:00 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 3C0E61DF8E for ; Mon, 17 Sep 2018 19:57:47 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 24KogOcwCaSey24Kpgoy85; Mon, 17 Sep 2018 19:57:47 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=DH13i/YM9/uTsQaHjStSiW7HqyC+J7hcT6ypiS40OGs=; b=L3kR4O9XHzJObUWqs1BhXulZJX 9n5ro4gXdeICNVEt7D9T/sP/paGCQoGll4Otequz3kSDt5Qzo8n2AeyE96bDO0wU3UN/GqvxLf/fs cgrQaUuISJgIxYavFmSUDU4wXdbC/vyNB4yX2QmFIur3aeO9T10SBVGv+lw8S6rq2W3hEzczQ+Pl7 0G8oM8sArM/qrJKH1p8STYnSGq6cf5W7dXMEhHXt9qcm+zm+BRdira1BuzhNEWbPrUGxc/5wdq9s0 mwII+a7HKAGlWugf7VhV5GnSMIRE08nf0JeL4rwiZHv9hrBOvJKVCvx2HVUl2qYMxz9yYUsBn6dLO Zg2b5MuQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54263 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1g24Ko-001Cq3-Iz for emacs-devel@gnu.org; Mon, 17 Sep 2018 19:57:46 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1g24Ko-001Cq3-Iz X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54263 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.47.163 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:229927 Archived-At: I am chiseling away at feature requests #17684 (crosshairs) and #22873 (multiple fake cursors). In this particular example, redisplay gives us the w (struct window *w) as it goes through each window. I am recording the window Lisp_Object in a cache (also a Lisp_Object) and am later checking that cache to see if w == XWINDOW (window). There is no guarantee that the window that I am interested in is the selected_window, and the functions giving me the w do not provide the window as an incoming argument. I see that I can use: Lisp_Object window = window_from_coordinates (f, opoint_x, opoint_y, &part, true); get-buffer-window/w->contents is not helpful because there may be more than one window on the frame displaying the same buffer. I was wondering if there is a more efficient way to derive window from a struct window *w? Thanks, Keith