From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#31240: 26.1; mouse-save-then-kill does not kill rectangles Date: Mon, 01 Oct 2018 10:33:52 +0200 Message-ID: <5BB1DBF0.5060706@gmx.at> References: <5BADDC88.7010206@gmx.at> <5BB10CCE.4020503@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1538382790 32440 195.159.176.226 (1 Oct 2018 08:33:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2018 08:33:10 +0000 (UTC) Cc: 31240@debbugs.gnu.org, charles@aurox.ch To: Federico Tedin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 10:33:05 2018 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 1g6tdZ-0008Ic-5d for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 10:33:05 +0200 Original-Received: from localhost ([::1]:60114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6tff-0006BB-E6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 04:35:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6tfX-0006Ap-5K for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 04:35:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6tfS-0003HD-5D for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 04:35:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6tfR-0003F2-Uu for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 04:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6tfR-0005i1-Pb for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 04:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Oct 2018 08:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31240 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31240-submit@debbugs.gnu.org id=B31240.153838285121856 (code B ref 31240); Mon, 01 Oct 2018 08:35:01 +0000 Original-Received: (at 31240) by debbugs.gnu.org; 1 Oct 2018 08:34:11 +0000 Original-Received: from localhost ([127.0.0.1]:60637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6tec-0005gS-Ut for submit@debbugs.gnu.org; Mon, 01 Oct 2018 04:34:11 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:35989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6teb-0005gC-2j for 31240@debbugs.gnu.org; Mon, 01 Oct 2018 04:34:09 -0400 Original-Received: from [192.168.1.101] ([46.125.250.27]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lm3H7-1fXHiV3jBx-00Zihr; Mon, 01 Oct 2018 10:33:55 +0200 Original-Received: from [192.168.1.101] ([46.125.250.27]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lm3H7-1fXHiV3jBx-00Zihr; Mon, 01 Oct 2018 10:33:55 +0200 In-Reply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g6EQWMQFyy6yG6tdmrhOU8M4tN52r/Eihl 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:150860 Archived-At: > The problem with using just (count-lines (point-min) position) is that > the return value > is different when the point is on column 0 and when it is on column 1 > or greater. OK. (count-lines (point-min) (point-min)) returns 0 because START and END are equal so let's assume you want to special-case that. Now the problem with your code is that + (line (progn + (forward-line 0) + (count-lines (point-min) position)))) probably doesn't do what you expect: The value of POSITION in the call of 'count-lines' is the _same_ it was before the 'forward-line' call because 'forward-line' only changes the value of point but not that of POSITION. So if you want a possible return value of 0 you have to write + (line (progn + (forward-line 0) + (count-lines (point-min) (point))))) instead. > I > needed to be sure that if the position was anywhere on line N, the > result was N (with > N starting at 0). Agreed, once more. You want to special-case POSITION on the first line of the buffer. But go the ends of the following two forms and type C-x C-e on each: (let ((position 3)) (save-excursion (goto-char position) (forward-line 0) (count-lines (point-min) position))) (let ((position 3)) (save-excursion (goto-char position) (forward-line 0) (count-lines (point-min) (point)))) Here the first evaluation gets me 1 and the second 0. I suppose it's the latter you want. martin