help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Saving the Messages buffer


From: Emanuel Berg
Subject: Re: Saving the Messages buffer
Date: Wed, 22 Jan 2014 18:30:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:

>> (let ((buffer "*Messages*")) (with-current-buffer
>> buffer (set-visited-file-name buffer t)
>> (auto-save-mode) ))
>
> The first arg to set-visited-file-name is FILENAME,
> not BUFFER.

Yes, but in that piece of code, "buffer" is not a
buffer, but a *string*, which works both to identify
the buffer (in `with-current-buffer') *and* to specify
a path (in `set-visited-file-name').

If you go to the *Messages* buffer, you will see that
its default-directory is the user home path (if that's
form where Emacs is started), so there is where the
file should go.

The reason the filename is the same as the buffer is
that

> Change name of file visited in current buffer to
> FILENAME.  This also renames the buffer to correspond
> to the new file.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


reply via email to

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