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 18:14:31 +0300 Message-ID: <83y60eoz6w.fsf@gnu.org> References: <87ei28f4re.fsf@gmail.com> <8362njqtv8.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1309794690 11274 80.91.229.12 (4 Jul 2011 15:51:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2011 15:51:30 +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 17:51:21 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 1QdlQe-0003Bb-L1 for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2011 17:51:20 +0200 Original-Received: from localhost ([::1]:48101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdlQd-0001KQ-AV for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2011 11:51:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:44295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdkt6-0000YK-Uc for emacs-devel@gnu.org; Mon, 04 Jul 2011 11:16:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qdkt5-00075x-96 for emacs-devel@gnu.org; Mon, 04 Jul 2011 11:16:40 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:48577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdkt4-00075i-QU for emacs-devel@gnu.org; Mon, 04 Jul 2011 11:16:39 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LNT00M00E2VN100@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Mon, 04 Jul 2011 18:16:36 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.8.216]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LNT00MPNEFLIN50@a-mtaout20.012.net.il>; Mon, 04 Jul 2011 18:16:34 +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.166 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:141534 Archived-At: > From: Stefan Monnier > Cc: dmitry.kurochkin@gmail.com, emacs-devel@gnu.org > Date: Mon, 04 Jul 2011 10:01:10 -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) ? Also, since we show cursor on the character after point, which is invisible, what exactly do we mean to achieve in this case by adjust_point_for_property? Finally, what do you think of this: (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?