From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: Patch: Syntax and Hard Newlines Date: Wed, 15 Nov 2006 16:47:28 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1163605704 9638 80.91.229.2 (15 Nov 2006 15:48:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Nov 2006 15:48:24 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 15 16:48:22 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GkMzt-0002uJ-1Z for ged-emacs-devel@m.gmane.org; Wed, 15 Nov 2006 16:48:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GkMzs-000899-BJ for ged-emacs-devel@m.gmane.org; Wed, 15 Nov 2006 10:48:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GkMzb-000870-I2 for emacs-devel@gnu.org; Wed, 15 Nov 2006 10:48:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GkMzX-00084y-OF for emacs-devel@gnu.org; Wed, 15 Nov 2006 10:48:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GkMzX-00084o-22 for emacs-devel@gnu.org; Wed, 15 Nov 2006 10:47:59 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GkMzX-0005mO-B8 for emacs-devel@gnu.org; Wed, 15 Nov 2006 10:47:59 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GkMzK-0002pJ-N8 for emacs-devel@gnu.org; Wed, 15 Nov 2006 16:47:46 +0100 Original-Received: from gamma02.me.chalmers.se ([129.16.50.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Nov 2006 16:47:46 +0100 Original-Received: from bojohan+news by gamma02.me.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Nov 2006 16:47:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-To: emacs-devel@gnu.org Original-Lines: 76 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: gamma02.me.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.90 (gnu/linux) Cancel-Lock: sha1:HzT2mKa0zBOYR8dxwq+LKwLoR/4= 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:62339 Archived-At: Stefan Monnier writes: > or change byte-opt.el to mark the `propertize' function with > `byte-optimize-pure-func' rather than with `side-effect-free'. But then byte-compilation would change the semantics of `propertize'. -- Function: propertize string &rest properties This function returns a copy of STRING [...] ^^^^ Actually, that is already the case for (at least) `concat': (progn (defun f () (concat "a" "b" "c")) (aset (f) 0 ?X) (f)) => "abc" (progn (defun f () (concat "a" "b" "c")) (byte-compile 'f) (aset (f) 0 ?X) (f)) => "Xbc" -- Function: concat &rest sequences This function returns a new string [...] The `concat' function always constructs a new string that is not `eq' to any existing string. [...] While playing with this I found another bug. This change revision 2.143 date: 2004-03-12 11:09:59 +0100; author: rms; state: Exp; lines: +3 -2 (byte-compile-get-constant): For strings, do compare text properties. was made to fix a bug (http://lists.gnu.org/archive/html/bug-gnu-emacs/2004-03/msg00080.html), but it accidentally broke constant folding for strings entirely. It replaced (assoc ,const byte-compile-constants) with (assoc-default ,const byte-compile-constants 'equal-including-properties nil) However, unlike `assoc' which returns the matching cons, `assoc-default' returns the cdr. In the code in question it is always nil. (assoc-default "foo" '(("foo")) 'equal-including-properties nil) => nil (assoc "foo" '(("foo"))) => ("foo") (This should be trivial to fix.) -- Johan Bockgård