From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Is this a bug in overlay property list handling? Date: Tue, 03 Jun 2008 10:37:06 -0400 Message-ID: References: <484272B3.3020004@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212503887 6893 80.91.229.12 (3 Jun 2008 14:38:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2008 14:38:07 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 03 16:38:48 2008 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 1K3Xep-0007m5-PY for ged-emacs-devel@m.gmane.org; Tue, 03 Jun 2008 16:38:40 +0200 Original-Received: from localhost ([127.0.0.1]:55185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3Xe3-0008Jp-C7 for ged-emacs-devel@m.gmane.org; Tue, 03 Jun 2008 10:37:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3XdT-00085b-KY for emacs-devel@gnu.org; Tue, 03 Jun 2008 10:37:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3XdR-00083r-QB for emacs-devel@gnu.org; Tue, 03 Jun 2008 10:37:15 -0400 Original-Received: from [199.232.76.173] (port=59710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3XdR-00083i-LP for emacs-devel@gnu.org; Tue, 03 Jun 2008 10:37:13 -0400 Original-Received: from 206-248-132-168.dsl.teksavvy.com ([206.248.132.168]:41235 helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3XdS-000724-1W for emacs-devel@gnu.org; Tue, 03 Jun 2008 10:37:14 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0A68FB423C; Tue, 3 Jun 2008 10:37:07 -0400 (EDT) In-Reply-To: <484272B3.3020004@gmail.com> (Lennart Borgman's message of "Sun, 01 Jun 2008 11:58:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:98299 Archived-At: > I am not sure if I have hit a bug or if I am doing something wrong. I do > something like this in my code: > (setq syntax-ppss-last-min > (copy-tree > (cons (1- last-pos) > (if is-main-mode-chunk > (mumamo-with-major-mode-fontification main-major > `(parse-partial-sexp (point-min) last-pos)) > (parse-partial-sexp 1 1))) > )) > (overlay-put chunk-at-pos 'syntax-ppss-last-min syntax-ppss-last-min) > If I test this immediately after with `overlay-get' the value looks ok. > However, later when I read these values with `overlay-get' it seems like the > property list has got corrupted. The car of the value stored in property > syntax-ppss-last-min is nil. > I use copy-tree to try to avoid surprices like this one. The `cons' already makes sure you have the only reference to the object and parse-partial-sexp also returns a fresh value, so the `copy-tree' is not needed. > Maybe I should do something different? Maybe this is a bug in overlay > property list handling? I'd be very surprised if it's a bug in overlay property handling. My guess is that it's a bug elsewhere in your code. Stefan PS: BTW, please avoid using `1' instead of (point-min), or else add a comment explaining why (point-min) is not right. Also the `(parse-partial-sexp (point-min) last-pos) looks odd: you probably forgot a comma before `last-pos'. Maybe mumamo-with-major-mode-fontification should be a macro rather than a function.