all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#3003: 23.0.92; Point trapped in overlay
@ 2009-04-15 16:44 Leo
  0 siblings, 0 replies; 3+ messages in thread
From: Leo @ 2009-04-15 16:44 UTC (permalink / raw
  To: emacs-pretest-bug; +Cc: Carsten Dominik

Hi Emacs Developers,

I thought this was an org bug but it turns out an Emacs one. See the
discussion thread in: http://thread.gmane.org/gmane.emacs.orgmode/12885.

Here is how to reproduce.

1. Make an overlay
   Org mode is used only to easily create such an overlay that could
   demonstrate the bug.

   -  In a new buffer in org mode, begin a line with a few spaces and
      then type in http://www.google.com

   -  Move the cursor to be within that url and type 'C-c C-l' and follow
      the minibufer prompt to change the 'description' to 'google'

2. Put the point to the left of the url overlay and try move the cursor
   into the overlay. You can see when it reaches the first character of
   the overlay, it appears stuck.

Daniel Clemente in http://article.gmane.org/gmane.emacs.orgmode/12887
analysed the cause.

Kind regards,
-- 
.: Leo :. [ sdl.web AT gmail.com ] .: I use Emacs :.






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#3003: 23.0.92; Point trapped in overlay
@ 2009-04-15 23:29 Chong Yidong
  2009-04-16  2:15 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Chong Yidong @ 2009-04-15 23:29 UTC (permalink / raw
  To: Stefan Monnier; +Cc: Carsten Dominik, 3003, Leo

Stefan, this is due to your change.  Here is an easier recipe to
reproduce the bug:

(defun foo-test ()
  (interactive)
  (switch-to-buffer "* TEST *")
  (erase-buffer)
  (insert "asdfgh")
  (put-text-property 3 5 'rear-nonsticky '(invisible))
  (put-text-property 3 5 'invisible t)
  (goto-char (point-min)))

Moving point forward now gets point temporarily stuck.  The crucial
factor is the rear-nonsticky property.

2009-02-12  Stefan Monnier  <monnier@iro.umontreal.ca>

  * keyboard.c (adjust_point_for_property): Allow stopping betwen two
  invisible areas.

Here is the relevant code:

   /* Find boundaries `beg' and `end' of the invisible area, if any.  */
   while (end < ZV
          /* Stop if we find a spot between two runs of
             `invisible' where inserted text would be visible.
             This is important when we have two invisible
             boundaries that enclose an area: if the area is
             empty, we need this test in order to make it
             possible to place point in the middle rather than
             skip both boundaries.
             Note that this will stop anywhere in a non-sticky
             text-property, but I don't think there's much we
             can do about that.  */
          && (val = get_pos_property (make_number (end),
                                      Qinvisible, Qnil),
              TEXT_PROP_MEANS_INVISIBLE (val))

Do we really need to do this test?  This corner case seems unimportant,
as opposed to being able to treat non-sticky properties correctly.






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#3003: 23.0.92; Point trapped in overlay
  2009-04-15 23:29 bug#3003: 23.0.92; Point trapped in overlay Chong Yidong
@ 2009-04-16  2:15 ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2009-04-16  2:15 UTC (permalink / raw
  To: Chong Yidong; +Cc: Carsten Dominik, 3003, Leo

> Stefan, this is due to your change.  Here is an easier recipe to
> reproduce the bug:

Yes, I recognized it right away :-(
I think we're just going to have to revert that change for now.

Tho, I think that in reality the "right" fix is to only place the
rear-nonsticky property on the last invisible char since inserting text
in the middle of the invisible "http://www.google.com" shouldn't result
in an invisible "http://www.go" followed by the visible inserted text
and then an invisible "ogle.com".

Or maybe the invisible text should be marked `read-only' and then my
code could be changed to only kick in for writable text.  But this would
require more changes to the handling of read-only (currently read-only
text is usually unbearable because it can't be removed, whereas what is
usually intended is just "don't modify, tho feel free to remove it
altogether").


        Stefan






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-16  2:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-15 23:29 bug#3003: 23.0.92; Point trapped in overlay Chong Yidong
2009-04-16  2:15 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2009-04-15 16:44 Leo

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.