From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Retrieve front-advance from make-overlay Date: Mon, 15 Jan 2007 10:59:44 +0100 Message-ID: <86mz4kbofj.fsf@lola.quinscape.zz> References: <45AA9AEC.1050800@gmail.com> <45AAD917.30400@gmail.com> <864pqsdadi.fsf@lola.quinscape.zz> <45AB4702.6070908@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168884905 2234 80.91.229.12 (15 Jan 2007 18:15:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Jan 2007 18:15:05 +0000 (UTC) Cc: Stefan Monnier , Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 15 19:15:03 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H6VbC-00032F-Fz for ged-emacs-devel@m.gmane.org; Mon, 15 Jan 2007 18:26:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6OdM-0001vo-EE for ged-emacs-devel@m.gmane.org; Mon, 15 Jan 2007 05:00:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H6Od5-0001vF-76 for emacs-devel@gnu.org; Mon, 15 Jan 2007 04:59:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H6Od3-0001uZ-5m for emacs-devel@gnu.org; Mon, 15 Jan 2007 04:59:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H6Od2-0001uV-Q8 for emacs-devel@gnu.org; Mon, 15 Jan 2007 04:59:48 -0500 Original-Received: from [62.67.228.11] (helo=pc3.berlin.powerweb.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H6Od2-0008Bd-9i for emacs-devel@gnu.org; Mon, 15 Jan 2007 04:59:48 -0500 Original-Received: from quinscape.de (pd95b0fdb.dip0.t-ipconnect.de [217.91.15.219]) by pc3.berlin.powerweb.de (8.9.3p3/8.9.3) with ESMTP id KAA18749 for ; Mon, 15 Jan 2007 10:59:44 +0100 X-Delivered-To: Original-Received: (qmail 16616 invoked from network); 15 Jan 2007 09:59:46 -0000 Original-Received: from unknown (HELO lola.quinscape.zz) ([10.0.3.43]) (envelope-sender ) by ns.quinscape.de (qmail-ldap-1.03) with SMTP for ; 15 Jan 2007 09:59:46 -0000 Original-Received: by lola.quinscape.zz (Postfix, from userid 1001) id AA85524B4D; Mon, 15 Jan 2007 10:59:44 +0100 (CET) Original-To: "Lennart Borgman \(gmail\)" In-Reply-To: <45AB4702.6070908@gmail.com> (Lennart Borgman's message of "Mon\, 15 Jan 2007 10\:18\:58 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:65202 Archived-At: "Lennart Borgman (gmail)" writes: > David Kastrup wrote: >> "Lennart Borgman (gmail)" writes: >> >>> Stefan Monnier wrote: >>>>> Is it possible to retrieve from an overlay the parameters front-advance and >>>>> rear-advance that was given to make-overlay? >>>>> Without that it is not possible to make a new copy of an overlay AFAICS. >>>> The source code of `copy-overlay' answers this question. >>> Thanks. Indeed it does ;-) -- BTW copy-overlay is not mentioned in Info. >> >> (defun overlay-polarities (ov) >> (let ((buf (overlay-buffer ov)) >> (start (overlay-start ov)) >> (end (overlay-end ov))) >> (unwind-protect >> (with-temp-buffer >> (move-overlay ov 1 1) >> (insert " ") >> (list (> (overlay-start ov) 1) >> (> (overlay-end ov) 1))) >> (move-overlay ov buf start end)))) >> >> This at least has the advantage of not touching the original buffer. >> But it is tasteless nevertheless. > > > Thanks David, I did not that one. I will try it. It was untested, and naturally, it is wrong. Both calls to move-overlay. You have to use (move-overlay ov 1 1 (current-buffer)) and (move-overlay ov start end buf) instead, respectively. There are probably more errors: I still did not test it. It is basically just a sketch, but should be close to working. -- David Kastrup