all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 9642@debbugs.gnu.org
Subject: bug#9642: move-overlay creates an empty overlay with the evaporate property
Date: Sat, 01 Oct 2011 22:38:24 -0700	[thread overview]
Message-ID: <4E87F8D0.5090105@cs.ucla.edu> (raw)
In-Reply-To: <83hb3tce8w.fsf@gnu.org>

On 10/01/11 01:22, Eli Zaretskii wrote:
> doing this invokes undefined behavior

No, everywhere else the overlay code consistently defines
the behavior: out-of-range values are treated as if they were
the nearest in-range values.  For example,

(make-overlay 0 (1+ (point-max)))

is treated exactly as if it were

(make-overlay 1 (point-max))

This is almost always true for move-overlay, too: for example,
in a nonempty buffer:

(move-overlay foo 0 (1+ (point-max)))

is exactly equivalent to

(move-overlay foo 1 (point-max))

This behavior is a longstanding Emacs tradition, in many functions,
e.g., (goto-char 0) is exactly equivalent to (goto-char 1).

I suppose it might make sense for the overlay code to consistently treat
out-of-range values as errors, and throw exceptions instead.
But what doesn't make sense is for the overlay behavior to be inconsistent,
where all the primitives follow goto-char's lead
except that in some (but not all) cases move-overlay screws up
and silently returns a bogus zero-length evaporating overlay.





  reply	other threads:[~2011-10-02  5:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 22:55 bug#9642: move-overlay creates an empty overlay with the evaporate property Paul Eggert
2011-10-01  3:09 ` Stefan Monnier
2011-10-01  4:01   ` Stefan Monnier
2011-10-01  7:33     ` Paul Eggert
2011-10-01  8:22       ` Eli Zaretskii
2011-10-02  5:38         ` Paul Eggert [this message]
2011-10-02  6:56           ` Eli Zaretskii
2011-10-03  1:09             ` Paul Eggert
2011-10-03  3:56               ` Eli Zaretskii
2011-10-03  4:21                 ` Paul Eggert
2011-10-03  3:15   ` Stefan Monnier
2011-10-03  5:36     ` Eli Zaretskii
2011-10-03 13:21       ` Stefan Monnier
2012-04-23 22:48 ` Paul Eggert
     [not found] ` <handler.9642.D9642.133522137028631.notifdone@debbugs.gnu.org>
2012-04-26 15:30   ` bug#9642: closed (Re: bug#9642: move-overlay creates an empty overlay with the evaporate property) Tassilo Horn
2012-04-27 16:27     ` Tassilo Horn
2012-04-27 18:38       ` Tassilo Horn
2012-04-28  7:34         ` Eli Zaretskii
2012-04-28 13:17           ` Stefan Monnier
2012-04-28 22:20         ` Paul Eggert
2012-04-29  7:57           ` Tassilo Horn
2012-04-29 19:41             ` Paul Eggert
2012-04-30  9:40             ` Troels Nielsen
2012-05-14  5:46               ` Stefan Monnier
2012-05-27 22:09                 ` Troels Nielsen
2012-05-29 16:16                   ` Paul Eggert

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=4E87F8D0.5090105@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=9642@debbugs.gnu.org \
    --cc=eliz@gnu.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.