all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Masatake YAMATO <jet@gyve.org>
Subject: overlay-start > overlay-end
Date: Mon, 22 Mar 2004 17:00:35 +0900 (JST)	[thread overview]
Message-ID: <20040322.170035.233401763.jet@gyve.org> (raw)
In-Reply-To: <E1B5Hvh-00078e-U3@fencepost.gnu.org>

>     I have seen emacs's strange behaviors twice; Emacs returned an overlay whose start is
>     greater than its end. I cannot find the way to reproduce it.
> 
> That is a bug.  It should never happen.
> 

I've just found the way to reproduce this:

(save-excursion
  (let (o)
    (goto-char (point-min))
    (delete-region (line-beginning-position) (line-end-position))
    (make-overlay (point) (point) (current-buffer) t)
    (insert ?x)
    (overlay-lists)))
=> ((#<overlay from 2 to 1 in *scratch*>))

I've tried to fix the problem. See the patch attached to this mail.
However, I have no confidence. 

Regards,
Masatake YAMATO

cvs diff: warning: unrecognized response `access control disabled, clients can connect from any host' from cvs server
Index: src/buffer.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/buffer.c,v
retrieving revision 1.445
diff -u -r1.445 buffer.c
--- src/buffer.c	4 Mar 2004 17:15:13 -0000	1.445
+++ src/buffer.c	22 Mar 2004 07:59:04 -0000
@@ -3465,6 +3465,19 @@
       tail = tail->next;
     }
 
+  /* Canonicalize the order of start and end. */
+  if (tail)
+    {
+      EMACS_INT   start = OVERLAY_POSITION (OVERLAY_START (tem));
+      Lisp_Object start_lobj;
+      if (start > end)
+	{
+	  start_lobj  = tail->start;
+	  tail->start = tail->end;
+	  tail->end   = start_lobj;
+	}
+    }
+	  
   /* If we don't find such an overlay,
      or the found one ends before PREV,
      or the found one is the last one in the list,

  reply	other threads:[~2004-03-22  8:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-18 10:33 Using overlay in register Masatake YAMATO
2004-03-20  4:49 ` Richard Stallman
2004-03-21 14:03   ` Masatake YAMATO
2004-03-22  5:24     ` Richard Stallman
2004-03-22  5:24     ` Richard Stallman
2004-03-22  8:00       ` Masatake YAMATO [this message]
2004-03-23  3:04         ` overlay-start > overlay-end Richard Stallman
2004-03-23  8:45           ` Masatake YAMATO
2004-03-23 14:18             ` Stefan Monnier
2004-03-24  5:34             ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=20040322.170035.233401763.jet@gyve.org \
    --to=jet@gyve.org \
    /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 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.