all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Angelo Graziosi <angelo.graziosi@alice.it>
Cc: emacs-devel@gnu.org
Subject: Re: About desktop file
Date: Sun, 11 Sep 2016 19:34:26 +0300	[thread overview]
Message-ID: <834m5mbdkd.fsf@gnu.org> (raw)
In-Reply-To: <3fe8a676-ba8c-cb76-2b65-de931073d5ca@alice.it> (message from Angelo Graziosi on Sun, 11 Sep 2016 10:31:41 +0200)

> From: Angelo Graziosi <angelo.graziosi@alice.it>
> 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	other threads:[~2016-09-11 16:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11  8:31 About desktop file Angelo Graziosi
2016-09-11 16:34 ` Eli Zaretskii [this message]
2016-09-11 20:13   ` Angelo Graziosi
2016-09-11 21:32     ` Chad Brown
2016-09-11 23:43       ` Angelo Graziosi
2016-09-12 16:47         ` Eli Zaretskii
2016-09-12 16:43     ` Eli Zaretskii
2016-09-12 20:14       ` Angelo Graziosi
2016-09-13 14:20         ` Eli Zaretskii
2016-09-13 21:35           ` Angelo Graziosi
2016-09-14 17:30             ` Eli Zaretskii
2016-09-15 13:25               ` Angelo Graziosi
2016-09-15 14:41                 ` Eli Zaretskii
2016-09-15 18:01                   ` Angelo Graziosi
2016-09-17  9:21                     ` Eli Zaretskii
2016-09-17 13:04                       ` Angelo Graziosi
2016-09-17 13:36                         ` Eli Zaretskii
2016-09-12  6:23 ` martin rudalics
2016-09-12 20:07   ` Angelo Graziosi
2016-09-13 14:22     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834m5mbdkd.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=angelo.graziosi@alice.it \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.