unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: dmitry.kurochkin@gmail.com, emacs-devel@gnu.org
Subject: Re: `vertical-motion', `goto-line' set point to invisible text
Date: Mon, 04 Jul 2011 23:06:44 +0300	[thread overview]
Message-ID: <83oc19q08b.fsf@gnu.org> (raw)
In-Reply-To: <jwvaacu7wqg.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> 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?



  parent reply	other threads:[~2011-07-04 20:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-03  2:59 `vertical-motion', `goto-line' set point to invisible text Dmitry Kurochkin
2011-07-03  6:55 ` Eli Zaretskii
2011-07-03  7:31   ` Dmitry Kurochkin
2011-07-03 13:33     ` Eli Zaretskii
2011-07-04  2:08       ` Dmitry Kurochkin
2011-07-03 14:50 ` Stefan Monnier
2011-07-03 15:14   ` Eli Zaretskii
2011-07-04 14:01     ` Stefan Monnier
2011-07-04 15:14       ` Eli Zaretskii
2011-07-04 18:10         ` Stefan Monnier
2011-07-04 20:06           ` Eli Zaretskii
2011-07-04 20:06           ` Eli Zaretskii [this message]
2011-07-05  2:22           ` Dmitry Kurochkin
2011-07-05  2:55             ` Eli Zaretskii
2011-07-05  3:52             ` Dmitry Kurochkin
2011-07-05  7:56               ` Eli Zaretskii
2011-07-09 13:13                 ` Dmitry Kurochkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83oc19q08b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dmitry.kurochkin@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).