emacs-devel
[Top][All Lists]
Advanced

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

Re: About desktop file


From: Eli Zaretskii
Subject: Re: About desktop file
Date: Sun, 11 Sep 2016 19:34:26 +0300

> From: Angelo Graziosi <address@hidden>
> Date: Sun, 11 Sep 2016 10:31:41 +0200
> 
> The 'desktop' file is very useful but sometimes it remembers too many 
> things..
> 
> Suppose I am using "foo" font in my init.el file:
> 
> (set-face-attribute 'default nil :font "foo 13" )
> (set-frame-font "foo 13" nil t)
> 
> and that I am working with many buffers. Now suppose I change the font 
> to use 'bar' font:
> 
> (set-face-attribute 'default nil :font "bar13" )
> (set-frame-font "bar 13" nil t)
> 
> When I restart Emacs, it loads the buffers with the old 'foo' font. 

I don't think I can reproduce this.  But since you didn't show the
full recipe, I cannot be sure I did what you did.

Are you saying that the old font was recorded in the desktop file, but
the new one isn't?  How is that possible?  Why would the old font end
up being recorded in the desktop file, but not the new one?

Maybe you changed the font outside the Emacs session, just by editing
the init.el file?  In that case, you should change the font inside the
session, and then save the desktop, then the information in the
desktop file will be updated for the next restart.

> Is there a way to do this differently?

Yes.  First, you could change the font inside the session and save
desktop.

Another possibility is to disable restoring frames (a font is an
attribute of a frame, not of a buffer).

There's also a possibility to control which variables get saved and
restored, but I'm not sure it will help in this case.

> My opinion is that desktop file should remember cursor position, working 
> buffers, their visiting modes, searched word, frame geometry-position 
> etc. not the font how buffers are displayed and similar.

If you choose to restore frames, Emacs assumes you want them exactly
as they were the last time.  Otherwise, why use desktop at all to save
frame configuration?

Of course, if someone wants to extend desktop.el to provide even more
control on what aspects of frames are restored, such patches will be
welcome, I'm sure.



reply via email to

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