From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Johan_Bockg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Buffer names are sometimes read-only objects in daemonized emacs Date: Fri, 30 Jul 2010 19:46:28 +0200 Message-ID: <87ocdoyia3.fsf@gnu.org> References: <201007292230.58883.tassilo@member.fsf.org> <201007300854.31902.tassilo@member.fsf.org> <87vd7xxjss.fsf@gnu.org> <201007301623.44249.tassilo@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1280512002 30022 80.91.229.12 (30 Jul 2010 17:46:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Jul 2010 17:46:42 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 30 19:46:40 2010 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.69) (envelope-from ) id 1OetfK-0001ma-HC for ged-emacs-devel@m.gmane.org; Fri, 30 Jul 2010 19:46:38 +0200 Original-Received: from localhost ([127.0.0.1]:41161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OetfK-0006cc-1K for ged-emacs-devel@m.gmane.org; Fri, 30 Jul 2010 13:46:38 -0400 Original-Received: from [140.186.70.92] (port=48077 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OetfE-0006bm-I0 for emacs-devel@gnu.org; Fri, 30 Jul 2010 13:46:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OetfD-000294-ED for emacs-devel@gnu.org; Fri, 30 Jul 2010 13:46:32 -0400 Original-Received: from smtprelay-h32.telenor.se ([213.150.131.5]:43201) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OetfD-00028w-8a for emacs-devel@gnu.org; Fri, 30 Jul 2010 13:46:31 -0400 Original-Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h32.telenor.se (Postfix) with ESMTP id 2887EE9888 for ; Fri, 30 Jul 2010 19:46:30 +0200 (CEST) X-SENDER-IP: [85.228.205.229] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArtQAD+sUkxV5M3lPGdsb2JhbACHZotcjFcMAQEBATUtwVqFOQQ X-IronPort-AV: E=Sophos;i="4.55,288,1278280800"; d="scan'208";a="112813705" Original-Received: from c-e5cde455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.205.229]) by ipb1.telenor.se with ESMTP; 30 Jul 2010 19:46:30 +0200 Original-Received: by muon.localdomain (Postfix, from userid 1000) id E9953484155; Fri, 30 Jul 2010 19:46:28 +0200 (CEST) Mail-Copies-To: never In-Reply-To: <201007301623.44249.tassilo@member.fsf.org> (Tassilo Horn's message of "Fri, 30 Jul 2010 16:23:43 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:128024 Archived-At: Tassilo Horn writes: > And, even in a daemonized emacs, I can eval > > (lusty-propertize-path "*GNU Emacs*") This is obviously a fresh string. > So it looks like the string "*GNU Emacs*" passed to that defsubst is > somehow read-only. Grepping the emacs sources the error seems to be > triggered by having that string in pure storage. Yes. > But even this does work in a daemonized emacs, even when I put it at the > front of my .emacs and then start it with emacs --daemon: > > (dolist (b (buffer-list)) > (let ((n (buffer-name (get-buffer b)))) > (put-text-property 0 (length n) 'face font-lock-string-face n))) But this list does not contain "*GNU Emacs*", does it? ("*GNU Emacs*" is the splash screen buffer. It is created after loading the init files.) The daemon creates the splash screen via `normal-splash-screen' (instead of `fancy-startup-screen'). It contains a call to `(rename-buffer "*GNU Emacs*" t)'. Unlike `get-buffer-create', `rename-buffer' does not make a copy of the provided string. This is how the pure string ends up in `buffer-name', AFAICT. (Modifying a string returned by `buffer-name' is still evil, as it does not promise to return a fresh string.)