From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: BUG: Newest org-mode interferes with desktop save Date: Wed, 15 Jun 2011 18:40:58 -0400 Message-ID: <8809.1308177658@alphaville.americas.hpqcorp.net> References: <87y613uj2x.fsf@gmail.com> <87sjrbt093.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWyli-0003pc-3h for emacs-orgmode@gnu.org; Wed, 15 Jun 2011 18:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWylg-0002Mz-C6 for emacs-orgmode@gnu.org; Wed, 15 Jun 2011 18:41:01 -0400 Received: from g6t0184.atlanta.hp.com ([15.193.32.61]:28477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWylg-0002Mi-5U for emacs-orgmode@gnu.org; Wed, 15 Jun 2011 18:41:00 -0400 In-Reply-To: Message from Rainer M Krug of "Wed\, 15 Jun 2011 20\:59\:01 +0200." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer M Krug Cc: nicholas.dokos@hp.com, emacs-orgmode Rainer M Krug wrote: > I created the attached init.el file. In my setup,=C2=A0~/.emacs.d/org-mode > is a symbolic link. If I set it to org-7.7, everything works as > expected desktop is loaded and saved without question), but when > linking it to the git version, the desktop is loaded, but when closing > it giveas me the above mentioned question: >=20 > "Current desktop was not loaded from a file. Overwrite this desktop file?" >=20 > As I said, the desktop *is* loaded. >=20 > Hope you can reproduce it with this setup, >=20 Here's a caution: when desktop.el is loaded, it adds to after-init-hook a function that reads the desktop file. However, after-init-hook gets called "at the end of initialization": if you try to reproduce using something like emacs -q -l init.el it's not going to work - after-init-hook gets runs "between the -q and -l" so to speak, whereas desktop.el does not get loaded until init.el is loaded: that initializes the hook too late to do any good. Probably the best way to do it is to create a dummy user "foo", copy init.el to /home/foo/.emacs and then invoke emacs as emacs -u foo Using this method, I cannot reproduce the problem with or without org in the init file: here's the one that I used which also sets a couple of desktop hooks that make some noise which is recorded in the *Messages* buffer - that helps to verify that things work according to expectations: --8<---------------cut here---------------start------------->8--- ;;; -*- mode: emacs-lisp -*- (setq debug-on-error t) (require 'desktop) (desktop-save-mode 1) (add-to-list 'desktop-after-read-hook (function (lambda () (message "got a = desktop file")))) (add-to-list 'desktop-no-desktop-file-hook (function (lambda () (message "n= o desktop file read")))) ;;; I tried with and without the following five lines ;;; I also tried with them placed *before* the desktop stuff (add-to-list 'load-path (expand-file-name "~nick/src/emacs/org/org-mode/lis= p")) (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-m= ode)) (require 'org-install) (global-set-key "\C-cl" 'org-store-link) (global-set-key "\C-ca" 'org-agenda) --8<---------------cut here---------------end--------------->8--- Nick