From: Miles Bader <miles@lsi.nec.co.jp>
Cc: emacs-devel@gnu.org
Subject: Re: Behavior of evaporate
Date: 26 Sep 2003 18:05:15 +0900 [thread overview]
Message-ID: <buooex7zzqs.fsf@mcspd15.ucom.lsi.nec.co.jp> (raw)
In-Reply-To: <20030926.175343.232772863.jet@gyve.org>
Masatake YAMATO <jet@gyve.org> 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.'
next prev parent reply other threads:[~2003-09-26 9:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-10 12:16 popup menu support for smerge-mode Masatake YAMATO
2003-01-11 19:41 ` Stefan Monnier
2003-08-24 6:03 ` Masatake YAMATO
2003-08-24 14:42 ` Stefan Monnier
2003-09-18 8:54 ` Masatake YAMATO
2003-09-18 15:27 ` Stefan Monnier
2003-09-19 9:25 ` Masatake YAMATO
2003-09-19 15:57 ` Stefan Monnier
2003-09-26 7:58 ` Masatake YAMATO
2003-09-26 8:44 ` Miles Bader
2003-09-26 8:53 ` Behavior of evaporate Masatake YAMATO
2003-09-26 9:05 ` Miles Bader [this message]
2003-09-26 9:17 ` David Kastrup
2003-09-26 15:59 ` Stefan Monnier
2003-09-27 2:31 ` Richard Stallman
2003-09-30 20:56 ` Alex Schroeder
2003-10-20 21:23 ` popup menu support for smerge-mode Stefan Monnier
2004-03-10 4:32 ` Masatake YAMATO
2004-03-11 7:00 ` Masatake YAMATO
2003-10-14 3:59 ` Masatake YAMATO
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=buooex7zzqs.fsf@mcspd15.ucom.lsi.nec.co.jp \
--to=miles@lsi.nec.co.jp \
--cc=emacs-devel@gnu.org \
--cc=miles@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.