From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#9642: move-overlay creates an empty overlay with the evaporate property Date: Mon, 03 Oct 2011 01:36:11 -0400 Message-ID: References: <4E8648C6.5050905@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1317620209 19569 80.91.229.12 (3 Oct 2011 05:36:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2011 05:36:49 +0000 (UTC) Cc: eggert@cs.ucla.edu, 9642@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 03 07:36:44 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 1RAbCm-0006Eh-Mn for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Oct 2011 07:36:44 +0200 Original-Received: from localhost ([::1]:55203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAbCm-0000a1-4j for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Oct 2011 01:36:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAbCj-0000Y4-LI for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2011 01:36:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAbCi-0001Au-Hr for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2011 01:36:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAbCi-0001Aq-FE for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2011 01:36:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RAbE1-0005KJ-Jg for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2011 01:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Oct 2011 05:38:01 +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.131762025720445 (code B ref 9642); Mon, 03 Oct 2011 05:38:01 +0000 Original-Received: (at 9642) by debbugs.gnu.org; 3 Oct 2011 05:37:37 +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 1RAbDc-0005Jh-QN for submit@debbugs.gnu.org; Mon, 03 Oct 2011 01:37:37 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RAbDa-0005JZ-IC for 9642@debbugs.gnu.org; Mon, 03 Oct 2011 01:37:35 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RAbCF-0004Xt-NN; Mon, 03 Oct 2011 01:36:11 -0400 In-reply-to: (message from Stefan Monnier on Sun, 02 Oct 2011 23:15:56 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 03 Oct 2011 01:38:01 -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:52098 Archived-At: > From: Stefan Monnier > Date: Sun, 02 Oct 2011 23:15:56 -0400 > Cc: 9642@debbugs.gnu.org > > >> In a nonempty buffer, the following: > >> (let ((o (make-overlay 1 2))) > >> (overlay-put o 'evaporate t) > >> (move-overlay o 0 1)) > > >> returns an empty overlay that has the evaporate property. > >> But this is not supposed to happen: when an overlay with that > >> property becomes empty, it's supposed to be deleted. > > > OTOH if the user goes through the trouble to do the above, he probably > > doesn't want this overlay to disappear right away. So I'm not sure we > > want to second guess the user here. > > I see I was confused: I didn't realize that your example's use of > out-of-bounds position was important, and I thought your change also > affected (move-overlay OL A A). So, I now think your patch is > perfectly fine, thank you. If we are going to support this misbehavior (the fact that BEG can be zero or negative), please add comments in the code to that effect, and maybe also document it in the doc string. Without comments, the intent of the "tricksy" code with Fset_marker is entirely unclear. FWIW, I think clipping of positions inside set-marker is for the case of narrowed buffer, not for being able to handle positions outside the valid range of values. But I guess I will be ignored.