From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: `vertical-motion', `goto-line' set point to invisible text Date: Mon, 04 Jul 2011 23:06:44 +0300 Message-ID: <83oc19q08b.fsf@gnu.org> References: <87ei28f4re.fsf@gmail.com> <8362njqtv8.fsf@gnu.org> <83y60eoz6w.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1309810366 5903 80.91.229.12 (4 Jul 2011 20:12:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2011 20:12:46 +0000 (UTC) Cc: dmitry.kurochkin@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 04 22:12:41 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdpVZ-0002ar-Ck for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2011 22:12:41 +0200 Original-Received: from localhost ([::1]:34894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdpVX-0000T9-9Y for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2011 16:12:39 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdpRq-0008Ic-JK for emacs-devel@gnu.org; Mon, 04 Jul 2011 16:08:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdpRp-0003UA-3h for emacs-devel@gnu.org; Mon, 04 Jul 2011 16:08:50 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:59152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdpRo-0003U3-Nf for emacs-devel@gnu.org; Mon, 04 Jul 2011 16:08:48 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LNT00200RR1NW00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Mon, 04 Jul 2011 23:08:47 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.8.216]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LNT002EHRYMKS60@a-mtaout22.012.net.il>; Mon, 04 Jul 2011 23:08:47 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141555 Archived-At: > From: Stefan Monnier > Cc: dmitry.kurochkin@gmail.com, emacs-devel@gnu.org > Date: Mon, 04 Jul 2011 14:10:11 -0400 > > >> >> AFAIK none of those positions are *inside* invisible text > >> > Try "M-x describe-text-properties RET", and you will see this isn't > >> > true. > >> AFAIK, describe-text-properties describes the properties of the char > >> *after* point, so if you're at the beginning of invisible text (yet not > >> inside it), describe-text-properties will show the `invisible' property. > > > So how many character positions are invisible after this: > > (insert "line1\nline2\nline3\n") > > (goto-line 2) > > (put-text-property (line-beginning-position) > > (line-beginning-position 2) > > 'invisible 'invis1) > > ? > > Without running the code, I'd say 6 ("line2\n"). Why? Because with your reasoning it's only 5. > > (progn (switch-to-buffer "test") > > (insert "aline1\nbline2\ncline3\n") > > (goto-line 2) > > (put-text-property (line-beginning-position) > > (line-beginning-position 2) > > 'invisible 'invis1) > > (add-to-invisibility-spec 'invis1) > > (goto-char (point-max))) > > > Eval this in *scratch*, then type "C-p C-x =". You will see that > > Emacs reports that point is position 8 and the character at point is > > `b', whereas what is shown (correctly) under the cursor is `c' whose > > buffer position is 15. Do you think this is correct behavior? > > In this area, I don't think there's a clear cut definition of what is > correct and what is not. ??? How could having a cursor on `c' and reporting it on `b' be "correct" by any measure? > If point is anywhere between "bline2\n" the display will be identical, > so the fact that the cursor is drawn over the "c" that follows it does > not necessarily imply that point should be "at the end of "bline2\n", > since the cursor is also drawn right after the "aline1\n" and by that > logic point should be at the beginning of "bline2\n". But what about the fact that you cannot have point at position 15, which is outside the invisible portion? How can that be anything but a bug?