From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.devel Subject: Re: A few questions about desktop.el Date: Thu, 09 Feb 2006 22:11:17 +0100 Message-ID: <43EBAFF5.40101@soem.dk> References: <42F9CDEA.3070302@soem.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1139525338 10240 80.91.229.2 (9 Feb 2006 22:48:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2006 22:48:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 09 23:48:55 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F7Kai-0003hu-64 for ged-emacs-devel@m.gmane.org; Thu, 09 Feb 2006 23:48:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F7KTh-0005MY-Bi for ged-emacs-devel@m.gmane.org; Thu, 09 Feb 2006 17:41:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F7J4X-0004Ip-1S for emacs-devel@gnu.org; Thu, 09 Feb 2006 16:11:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F7J4S-0004HV-HJ for emacs-devel@gnu.org; Thu, 09 Feb 2006 16:11:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F7J4S-0004HN-6V for emacs-devel@gnu.org; Thu, 09 Feb 2006 16:11:20 -0500 Original-Received: from [212.99.225.245] (helo=odin.broadcom.dk) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F7J84-0006Bu-KC for emacs-devel@gnu.org; Thu, 09 Feb 2006 16:15:04 -0500 Original-Received: from pppoe3-ves.broadcom.dk ([212.99.255.42] helo=[10.17.0.44]) by odin.broadcom.dk with esmtp (Exim 4.24; FreeBSD) id 1F7J4N-0002Zq-Mt; Thu, 09 Feb 2006 22:11:15 +0100 User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en Original-To: Juanma Barranquero In-Reply-To: X-Enigmail-Version: 0.91.0.0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50276 Archived-At: >About seven months ago, I said: > > > >>You got my vote. I've been testing it and everything seems >>to work, even the corner cases of `highlight-changes-mode'. >> >> > >Now, either I was mistaken then or something's changed in between, >because h-c-m and desktop.el *do* have a problem. > >With a simple .emacs.el like this: > >;--------- .emacs.el ----------- >(setq desktop-save t) >(desktop-save-mode 1) >(setq highlight-changes-global-initial-state 'passive) >(global-highlight-changes 'passive) >;------------------------------- > >The steps to reproduce the problem: > > - Start Emacs. > - Load a file (for example, .emacs.el). => It is in "-Chg" mode, >i.e., passive. > - Exit Emacs. > - Start Emacs. => .emacs.el is loaded, in "+Chg" mode (active) > - M-x hilight-changes-mode RET => .emacs.el is in "-Chg" mode. > - Exit Emacs. > - Start Emacs. => .emacs.el is loaded, in "-Chg" mode (finally). > >-- > /L/e/k/t/u > > I believe the problem should be fixed by now. Here is the explanation: highlight-changes-mode must be added to desktop-locals-to-save in order to be saved in the desktop file. To do this I originally placed (add-to-list 'desktop-locals-to-save 'highlight-changes-mode) inside the function highlight-changes-mode. Therefore things worked when this function was called, but not when global-highlight-changes was called. Now I have moved the line out of highlight-changes-mode and placed it at top level so it is executed at load.