all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: How to get a window Lisp_Object from struct window *w?
Date: Mon, 17 Sep 2018 17:57:45 -0700	[thread overview]
Message-ID: <m2va73hbau.wl%esq@lawlist.com> (raw)

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



             reply	other threads:[~2018-09-18  0:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  0:57 Keith David Bershatsky [this message]
2018-09-18  2:19 ` How to get a window Lisp_Object from struct window *w? Stefan Monnier
2018-09-18  8:24 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2018-09-18 16:29 Keith David Bershatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2va73hbau.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.