From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Behavior of evaporate Date: 26 Sep 2003 18:05:15 +0900 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20030926.165808.260114910.jet@gyve.org> <20030926.175343.232772863.jet@gyve.org> Reply-To: Miles Bader NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1064567614 17741 80.91.224.253 (26 Sep 2003 09:13:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 26 Sep 2003 09:13:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Sep 26 11:13:32 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A2ofM-00044c-00 for ; Fri, 26 Sep 2003 11:13:32 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A2omu-0005fP-00 for ; Fri, 26 Sep 2003 11:21:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A2oXb-0004vy-6N for emacs-devel@quimby.gnus.org; Fri, 26 Sep 2003 05:05:31 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A2oXV-0004vh-6o for emacs-devel@gnu.org; Fri, 26 Sep 2003 05:05:25 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A2oXT-0004vR-Sb for emacs-devel@gnu.org; Fri, 26 Sep 2003 05:05:24 -0400 Original-Received: from [210.143.35.52] (helo=TYO202.gate.nec.co.jp) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A2oXS-0004uo-3t; Fri, 26 Sep 2003 05:05:22 -0400 Original-Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.192]) by TYO202.gate.nec.co.jp (8.11.7/3.7W01080315) with ESMTP id h8Q95Il17775; Fri, 26 Sep 2003 18:05:19 +0900 (JST) Original-Received: from mailsv3.nec.co.jp (mailgate52.nec.co.jp [10.7.69.191]) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) with ESMTP id h8Q95HU00833; Fri, 26 Sep 2003 18:05:17 +0900 (JST) Original-Received: from edtmg05.lsi.nec.co.jp ([10.26.17.202]) by mailsv3.nec.co.jp (8.11.7/3.7W-MAILSV4-NEC) with ESMTP id h8Q95Gf18460; Fri, 26 Sep 2003 18:05:16 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp (localhost [127.0.0.1]) by edtmg05.lsi.nec.co.jp (8.9.3p2+3.2W/3.7W_EDC_Ver.1.0) with ESMTP id SAA07111; Fri, 26 Sep 2003 18:05:16 +0900 (JST) Original-Received: from mcspd15.ucom.lsi.nec.co.jp (mcspd15 [10.30.114.174]) by mcsss2.ucom.lsi.nec.co.jp (8.12.10/8.12.8/EDcg v2.01-mc/1046780839) with ESMTP id h8Q95FRm022907; Fri, 26 Sep 2003 18:05:15 +0900 (JST) Original-Received: by mcspd15.ucom.lsi.nec.co.jp (Postfix, from userid 31295) id B7DF1372A; Fri, 26 Sep 2003 18:05:15 +0900 (JST) Original-To: Masatake YAMATO System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <20030926.175343.232772863.jet@gyve.org> Original-Lines: 34 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16667 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16667 Masatake YAMATO writes: > (progn (setq xxx 1) > (setq o (make-overlay 0 0)) > (overlay-put o 'modification-hooks (lambda (ov dummy b e l) > (setq xxx 0))) > (overlay-put o 'evaporate t) > xxx) > => 1 > > Result I expected is 0. > So I can know an overlay is dead. I don't think modification hooks are called in this case -- since the overlay had an initial size of 0 (and illegal begin/end values for that matter), it was never really part of the buffer at all. The following works as you expect: (progn (setq xxx 1) (setq o (make-overlay 1 2)) (overlay-put o 'modification-hooks (list (lambda (ov b e l) (setq xxx 0)))) (overlay-put o 'evaporate t) (delete-region 1 2) xxx) => 0 You can also detect whether an overlay's been evaporated or not by seeing if it has a null buffer, e.g., (overlay-buffer o) => nil. -Miles -- `There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.'