emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `vertical-motion', `goto-line' set point to invisible text


From: Eli Zaretskii
Subject: Re: `vertical-motion', `goto-line' set point to invisible text
Date: Mon, 04 Jul 2011 18:14:31 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden,  address@hidden
> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]