From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#19200: Point adjustemnt moves *into* invisible text Date: Mon, 21 Mar 2016 08:08:59 -0400 Message-ID: References: <87mvpskb84.fsf@web.de> <87io0gbmpl.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1458562229 8780 80.91.229.3 (21 Mar 2016 12:10:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Mar 2016 12:10:29 +0000 (UTC) Cc: 19200@debbugs.gnu.org, Jonas Bernoulli To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 21 13:10:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ahyf1-0002cg-5S for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Mar 2016 13:10:15 +0100 Original-Received: from localhost ([::1]:57406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahyf0-0001Gh-CW for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Mar 2016 08:10:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahyes-00018u-6N for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 08:10:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahyen-0006AU-Tg for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 08:10:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahyen-0006AK-RL for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 08:10:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ahyen-0002jg-Of for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 08:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2016 12:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19200 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19200-submit@debbugs.gnu.org id=B19200.145856214810452 (code B ref 19200); Mon, 21 Mar 2016 12:10:01 +0000 Original-Received: (at 19200) by debbugs.gnu.org; 21 Mar 2016 12:09:08 +0000 Original-Received: from localhost ([127.0.0.1]:56320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahydv-0002iW-Rq for submit@debbugs.gnu.org; Mon, 21 Mar 2016 08:09:08 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:64544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahydt-0002i1-Nk for 19200@debbugs.gnu.org; Mon, 21 Mar 2016 08:09:06 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AyFgA731xV/3D5d0tcgxCEAoVVu0CHSwQCAoE8OhMBAQEBAQEBgQpBBYNdAQEDAScvIwULCzQSFBgNJIg3CM8jAQEBAQYBAQEBHos6hQUHhC0Fsz+BRSOBZoIuIoJ4AQEB X-IPAS-Result: A0AyFgA731xV/3D5d0tcgxCEAoVVu0CHSwQCAoE8OhMBAQEBAQEBgQpBBYNdAQEDAScvIwULCzQSFBgNJIg3CM8jAQEBAQYBAQEBHos6hQUHhC0Fsz+BRSOBZoIuIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="197391328" Original-Received: from 75-119-249-112.dsl.teksavvy.com (HELO pastel.home) ([75.119.249.112]) by ironport2-out.teksavvy.com with ESMTP; 21 Mar 2016 08:08:59 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 06D9B5FED1; Mon, 21 Mar 2016 08:09:00 -0400 (EDT) In-Reply-To: <87io0gbmpl.fsf@web.de> (Michael Heerdegen's message of "Mon, 21 Mar 2016 03:15:34 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115222 Archived-At: >> Are you sure you're hitting exactly this same bug? >> IOW can you circumvent the bug by adding M-: (point) RET ? > First question: no, I'm not, it's similar, but maybe not exactly the > same. But second question: yes! OK, if M-: (point) RET "fixes" the problem, then it's probably hitting the same bug. > The issue in Magit seems to be dependent to the setting > goal-column -> 0. I don't think that's very surprising: if goal-column is non-zero, then point doesn't end in an invisible region since you only have invisible text in column 0, IIUC. > And I found that when I replace > (if (zerop col) > (beginning-of-line) > (move-to-column col)) > > in the definition of line-move-to-column (at the beginning) with just > > (move-to-column col) > > the Magit issue is fixed. I have no clue why, however. move-to-column moves forward from BOL, whereas beginning-of-line moves only backward, so the two probably end up at opposite ends of the invisible region. BTW, regardless of fixing this bug, I think you have a problem: if the exact position within the invisible text is so important that it can end up selecting a different line, then fixing bug#19200 won't do you much good: there are many cases where point-adjustment won't do what you want (e.g. it won't move point at all, even though it's somewhere in the middle of the invisible region) and hence it will end up "at the wrong place". The way point-adjustment is defined is too conservative for that. So I suggest you try and make you code more robust w.r.t the position of point within an invisible region in any case. Stefan