From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#9642: move-overlay creates an empty overlay with the evaporate property Date: Sat, 01 Oct 2011 22:38:24 -0700 Organization: UCLA Computer Science Department Message-ID: <4E87F8D0.5090105@cs.ucla.edu> References: <4E8648C6.5050905@cs.ucla.edu> <4E86C25D.5010108@cs.ucla.edu> <83hb3tce8w.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1317533940 30963 80.91.229.12 (2 Oct 2011 05:39:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 Oct 2011 05:39:00 +0000 (UTC) Cc: 9642@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 02 07:38:53 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RAElJ-0007HS-4d for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Oct 2011 07:38:53 +0200 Original-Received: from localhost ([::1]:51290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAElI-0007YS-BE for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Oct 2011 01:38:52 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:34602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAElF-0007YN-6j for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2011 01:38:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAElE-0007S9-36 for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2011 01:38:49 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAElE-0007S3-0O for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2011 01:38:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RAEmQ-0004io-Qv for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2011 01:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Oct 2011 05:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9642 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 9642-submit@debbugs.gnu.org id=B9642.131753398718126 (code B ref 9642); Sun, 02 Oct 2011 05:40:02 +0000 Original-Received: (at 9642) by debbugs.gnu.org; 2 Oct 2011 05:39:47 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RAEmB-0004iJ-BF for submit@debbugs.gnu.org; Sun, 02 Oct 2011 01:39:47 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RAEm6-0004i8-Jt for 9642@debbugs.gnu.org; Sun, 02 Oct 2011 01:39:44 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 6E91EA60039; Sat, 1 Oct 2011 22:38:25 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WZbKwJmP-v-M; Sat, 1 Oct 2011 22:38:25 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id F16B4A60002; Sat, 1 Oct 2011 22:38:24 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 In-Reply-To: <83hb3tce8w.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 02 Oct 2011 01:40:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52062 Archived-At: 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.