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.bugs Subject: bug#22873: Can we support multiple cursors? Date: Sun, 13 Aug 2017 11:19:30 -0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1502648413 19857 195.159.176.226 (13 Aug 2017 18:20:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 13 Aug 2017 18:20:13 +0000 (UTC) Cc: John Wiegley , Marcin Borkowski , 22873@debbugs.gnu.org, Richard Stallman To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 13 20:20:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dgxUd-0004mF-FB for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Aug 2017 20:20:08 +0200 Original-Received: from localhost ([::1]:48206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgxUj-0007nM-TY for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Aug 2017 14:20:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgxUc-0007l1-6s for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 14:20:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgxUZ-00049y-1r for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 14:20:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgxUY-00049p-U8 for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 14:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dgxUY-0007XK-IH for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 14:20:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Aug 2017 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22873-submit@debbugs.gnu.org id=B22873.150264837428959 (code B ref 22873); Sun, 13 Aug 2017 18:20:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 13 Aug 2017 18:19:34 +0000 Original-Received: from localhost ([127.0.0.1]:60392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgxU6-0007X1-El for submit@debbugs.gnu.org; Sun, 13 Aug 2017 14:19:34 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.50.119]:23591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgxU4-0007Wv-O6 for 22873@debbugs.gnu.org; Sun, 13 Aug 2017 14:19:33 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 38447129E8 for <22873@debbugs.gnu.org>; Sun, 13 Aug 2017 13:19:32 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id gxTvdNI5uRtUXgxTvdnoC2; Sun, 13 Aug 2017 13:19:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To: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=okTRj42cTIANA8TwwkrXx4Qb7rhheWSojFk58Svj3MI=; b=TXU1J9P54pimCgHz1CQBVdyhSF nChrPkQE1OKakBBLczWHxqRRWUzySVv4g00nHQyNRADAPELSl0Ewt1vwEn6Vh/NfqhOzfMr/urgDM LciiuMrZaaawUgqTsrbK38fsOTW4y2z86fCmY6psSo5V4sCTp6k70ps/roibASvaPPHMIHofn1MAV OCmxciijAsDwgui51kvwIzW+2srX/PnZyR+I3zi443BzZccTNDGSiCTcQkRVm7xByY1/RMNuhKm3T 3p6JHAA7NBcDxu8QGyfungvu/40Yy2tHj5PcRIqWW06zr9xk3+RgLJau+EYcE6jpkWfvXSCDBkEk3 5cTpsoVw==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50923 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dgxU3-003tmT-9D; Sun, 13 Aug 2017 13:19:31 -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 - debbugs.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-Exim-ID: 1dgxU3-003tmT-9D 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]:50923 X-Source-Auth: lawlist X-Email-Count: 4 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes 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: 208.118.235.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:135732 Archived-At: Dear Eli: I could use some help/guidance, please. I have encountered a situation where the Y and VPOS coordinates returned by `move_it_to` are sometimes out of bounds, and MATRIX_ROW crashes Emacs when drawing fake cursors that are out of bounds. The solution appears to be a test for whether Y and VPOS are out of bounds. I would like to use `window_box_height` to give me essentially the same value as `window-body-height` with a non-nil PIXELWISE argument. In my case, I have 998 pixels for the window body height as depicted in the diagram of the Emacs manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html The last Y that I am interested in is at 1000 pixels because my `frame-char-height` -- aka `FRAME_LINE_HEIGHT (XFRAME (w->frame))` -- is 20. Two pixels are hidden by the mode-line, so the line of text is partially visible. `count-screen-lines` is not a viable option because using `vertical-motion` is too slow. The last VPOS that I am interested in is 50 -- again, same thing, partially visible wit h two pixels hidden underneath the mode-line. Testing and limiting the drawing of fake cursors with `y <= window_box_height (w)` gives me mixed results; i.e., sometimes fake cursors are drawn/erased only up to line 49, but sometimes it works up to line 50 (partially visible). I think I want to test for whether Y is less than or equal to 1000 and if VPOS is less than or equal to 50 -- if the test is true, then go ahead and draw fake cursors up to and including that location. However, I can foresee situations where there might be mixed line heights on the visible window, and relying upon the frame character height and window body height will not be reliable. In a simple case, we can take 1000 divided by 20 and know that the VPOS is 50. Is there a more reliable test for the last partially visible Y and VPOS within the window body height? Should I be using pos_visible_p in some capacity here? Thanks, Keith