From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22873: Can we support multiple cursors? Date: Mon, 14 Aug 2017 18:01:07 +0300 Message-ID: <83y3qmgpn0.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1502722946 3825 195.159.176.226 (14 Aug 2017 15:02:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 14 Aug 2017 15:02:26 +0000 (UTC) Cc: jwiegley@gmail.com, mbork@mbork.pl, 22873@debbugs.gnu.org, rms@gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 14 17:02:18 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 1dhGsd-0000Ir-4G for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Aug 2017 17:02:11 +0200 Original-Received: from localhost ([::1]:53642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhGsj-0008Sa-Ht for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Aug 2017 11:02:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhGsa-0008Ra-5n for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 11:02:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhGsU-0003Sg-Rp for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 11:02:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54965) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dhGsU-0003SY-OW for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 11:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dhGsU-0004PS-9P for bug-gnu-emacs@gnu.org; Mon, 14 Aug 2017 11:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Aug 2017 15:02: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.150272290716944 (code B ref 22873); Mon, 14 Aug 2017 15:02:02 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 14 Aug 2017 15:01:47 +0000 Original-Received: from localhost ([127.0.0.1]:35413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhGsE-0004PE-OW for submit@debbugs.gnu.org; Mon, 14 Aug 2017 11:01:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhGsD-0004P8-BE for 22873@debbugs.gnu.org; Mon, 14 Aug 2017 11:01:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhGs7-0003Mr-IR for 22873@debbugs.gnu.org; Mon, 14 Aug 2017 11:01:40 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhGrn-0003Gy-2n; Mon, 14 Aug 2017 11:01:19 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4290 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dhGrg-0007Ws-29; Mon, 14 Aug 2017 11:01:12 -0400 In-reply-to: (message from Keith David Bershatsky on Sun, 13 Aug 2017 20:20:10 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:135742 Archived-At: > Date: Sun, 13 Aug 2017 20:20:10 -0700 > From: Keith David Bershatsky > Cc: 22873@debbugs.gnu.org,John Wiegley ,Marcin Borkowski ,Richard Stallman > > I read through the comments in xdisp.c that immediately precede move_it_to and I also looked at all of it uses within xdisp.c, but I am still unclear how to limit move_it_to the it.last_visible_y. Like this: move_it_to (&it, POS, -1, it.last_visible_y - 1, -1, MOVE_TO_POS | MOVE_TO_Y); where POS is the buffer position. You can find many examples of this in xdisp.c. > I got the impression that if I put it.last_visible_y as an argument of move_it_to, that `it` would move to that location instead of POS if POS cannot be found. It stops when the first condition is satisfied. If it reaches POS before the window end, it stops there; otherwise it stops at the window end. It is then a simple matter of testing IT_CHARPOS(&it) against POS to see which of these conditions caused it to stop.