From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Angelo Graziosi Newsgroups: gmane.emacs.devel Subject: Re: About desktop file Date: Sun, 11 Sep 2016 22:13:25 +0200 Message-ID: <808928eb-2050-da74-d217-30ad027081ba@alice.it> References: <3fe8a676-ba8c-cb76-2b65-de931073d5ca@alice.it> <834m5mbdkd.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1473624849 2473 195.159.176.226 (11 Sep 2016 20:14:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2016 20:14:09 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 11 22:14:05 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjB8T-0007Gi-Ph for ged-emacs-devel@m.gmane.org; Sun, 11 Sep 2016 22:13:53 +0200 Original-Received: from localhost ([::1]:38933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjB8R-0008HX-T3 for ged-emacs-devel@m.gmane.org; Sun, 11 Sep 2016 16:13:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjB8L-0008HJ-SP for emacs-devel@gnu.org; Sun, 11 Sep 2016 16:13:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjB8H-0005pC-LM for emacs-devel@gnu.org; Sun, 11 Sep 2016 16:13:44 -0400 Original-Received: from smtp204.alice.it ([82.57.200.100]:65130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjB8H-0005p1-9W; Sun, 11 Sep 2016 16:13:41 -0400 Original-Received: from [192.168.1.100] (82.59.177.20) by smtp204.alice.it (8.6.060.43) (authenticated as angelo.graziosi@alice.it) id 57C3F8F402B22ED0; Sun, 11 Sep 2016 22:13:40 +0200 In-Reply-To: <834m5mbdkd.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.100 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207368 Archived-At: Il 11/09/2016 18:34, Eli Zaretskii ha scritto: >> From: Angelo Graziosi >> 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. No no no. I didn't change anything. This is a recipe: Save you current ~/.emacs.d folder then create an empty one: mkdir .emacs.d and put there this init.el file $ cat init.el (set-face-attribute 'default nil :font "Source Code Pro 13" ) (set-frame-font "Source Code Pro 13" nil t) ;; Instead of saving on ~/.emacs.desktop (setq desktop-base-file-name "~/.emacs.d/desktop") ;; Instead of saving on ~/.emacs.desktop.lock (setq desktop-base-lock-name "~/.emacs.d/desktop.lock") ;; Save desktop (desktop-save-mode 1) Now start Emacs and visit, for example, init.el. Quit Emacs saving the desktop. Restart Emacs. It reload init.el and the font used is right, Source Code Pro. This is confirmed in Options | Set default font. Now, in the init.el file, change "Source Code Pro 13" with, for example, "Lucida Console 13". Quit Emacs. Restart Emacs. It reload init.el but displays it with "Source Code Pro" NOT with the font we have set in the init.el file, and Options | Set default font still shows it is using Source Code Pro. I would expect the buffer is rendered with the font we have set in the init.el file. Now if you quit Emacs and rename the desktop file, mv desktop desktop-save the next time you start Emacs, it starts without desktop file and scratch buffer and all the other visited buffers, hereafter, are rendered with Lucida Console, i.e. the font we have set in init.el. Also Options | Set default font confirms the new font is used, now. The desktop file stores the font even if init.el says to use another one, $ grep Source desktop-save (setq desktop-saved-frameset [frameset 1 (22485 45444 720000 0) (desktop . "208") [...] (font-backend uniscribe gdi) (font . "-outline-Source Code Pro-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1") (border-width . 2) (internal-border-width . 0)[...] My opinion is that desktop file should not register this information, the font used should be always what is set in the initialization file.. otherwise why it is called "initialization" file? But this is only my opinion.. Ciao, Angelo.