emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buffer names are sometimes read-only objects in daemonized emacs


From: Johan Bockgård
Subject: Re: Buffer names are sometimes read-only objects in daemonized emacs
Date: Fri, 30 Jul 2010 19:46:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Tassilo Horn <address@hidden> 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.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]