From xemacs-m  Sun Jul  6 12:20:07 1997
Received: from portofix.ida.liu.se (portofix.ida.liu.se [130.236.177.25])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id MAA26627
	for <xemacs-beta@xemacs.org>; Sun, 6 Jul 1997 12:20:06 -0500 (CDT)
Received: from sen23.ida.liu.se (sen23.ida.liu.se [130.236.176.133])
	by portofix.ida.liu.se (8.8.5/8.8.5) with SMTP id TAA19092
	for <xemacs-beta@xemacs.org>; Sun, 6 Jul 1997 19:20:07 +0200 (MET DST)
Received: by sen23.ida.liu.se (SMI-8.6/ida.slave-V1.0b6d6S2)
	id TAA21050; Sun, 6 Jul 1997 19:20:07 +0200
Date: Sun, 6 Jul 1997 19:20:07 +0200
Message-Id: <199707061720.TAA21050@sen23.ida.liu.se>
From: David Byers <davby@ida.liu.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: xemacs-beta@xemacs.org
Subject: Insertion of zero-length extents
X-Mailer: VM 6.29 under 20.2 XEmacs Lucid (beta3)
X-Face: (@~#v$c[GP"T}a;|MU<%Dpm5*6yv"NR|7k;uk8MAISFxdZ(Og$C{u(j"9X7v$qonp}SKfhT
 g|5[Pu~/3F7XQEk70gK'4z%1R%%gg7]}=>/jD`qcBeHDgo&HS,^S!&.zoTSxh<>-O6EB?SSy96&m37

In XEmacs 20.2 (gcc, Solaris 2.5), when I create a zero-length
duplicable extent in a buffer, copy it with buffer-substring and then
insert the copied string with insert, the zero-length extent is not
inserted. Similarly, if I use concat to concatenate a string with a
zero-length extent, the extent is lost.

Is there a good reason for this?


You can try something like this:

    (set-buffer (get-buffer-create "1"))
    (insert "FOO")
    (setq e (make-extent 2 2))
    (set-extent-property e 'duplicable t)
    (setq foo (buffer-string))
    (set-buffer (get-buffer-create "2"))
    (insert foo)
    ;;
    ;; The following should be non-nil, and is
    ;;
    (extent-list foo)
    ;;
    ;; The following is nil, but I think that's wrong.
    ;; If the extent end is bumped to three, the extent
    ;; is copied to the buffer and to the concatenated  
    ;; string.
    ;;
    (extent-list)
    (extent-list (concat foo "BAR"))

I apologise if this is an old issue.

--
David Byers.

PS. If this is a bug (possibly) and if there are no issues I am not
    aware of (which there probably are), the fix appears to be easy.
    Just change the relevant <= checks in extents.c to < checks.

