From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Can't close Emacs+org-mode if /tmp and /home on different partitions Date: Wed, 08 Dec 2010 10:13:45 +0000 Message-ID: <87oc8w4lnq.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=56246 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQH22-0006Jo-W7 for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 05:13:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQH21-0003mP-0d for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 05:13:54 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:32937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQH20-0003lt-Pz for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 05:13:52 -0500 In-Reply-To: (Antti Kaihola's message of "Thu, 2 Dec 2010 10:33:28 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Antti Kaihola Cc: emacs-orgmode Antti Kaihola writes: > I have /tmp on my root partition and a separate partition for /home. > When trying to close an Emacs session which is using org-mode, I get > this error: > > move-file-to-trash: Non-regular file: Is a directory, /tmp/babel-XXXXXXX > > (where XXXXXXX are random characters). > > I tracked down the problem to org-babel-remove-temporary-directory > which ob.el adds to kill-emacs-hook. It tries to remove the temporary > directory using delete-directory, which in turn tries to move the > directory (by renaming) into trash, which is in my home directory. I've just added some exception handling which should allows Emacs to close down (without removing the temporary directory) in this situation. Thanks for the clear report. Dan > Here's the debugger traceback: > > Debugger entered--Lisp error: (file-error "Non-regular file" "Is a > directory" "/tmp/babel-4893rR1") > rename-file("/tmp/babel-4893rR1" > "/home/akaihola/.local/share/Trash/files/babel-4893rR1_4893HqQ") > move-file-to-trash("/tmp/babel-4893rR1") > delete-directory("/tmp/babel-4893rR1") > (progn (mapc (lambda ... ...) (directory-files > org-babel-temporary-directory ... > "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")) (delete-directory > org-babel-temporary-directory)) > (if (and (boundp ...) (file-exists-p org-babel-temporary-directory)) > (progn (mapc ... ...) (delete-directory > org-babel-temporary-directory))) > (when (and (boundp ...) (file-exists-p > org-babel-temporary-directory)) (mapc (lambda ... ...) > (directory-files org-babel-temporary-directory ... > "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")) (delete-directory > org-babel-temporary-directory)) > org-babel-remove-temporary-directory() > eval((org-babel-remove-temporary-directory)) > eval-last-sexp-1(nil) > eval-last-sexp(nil) > call-interactively(eval-last-sexp nil nil) > > I added this to my ~/.emacs.d/init.el: > > (custom-set-variables '(temporary-file-directory "/home/akaihola/tmp/")) > > and closing Emacs works correctly again. However, since my init.el is > part of emacs-starter-kit which I update frequently, I'd prefer not to > modify that file. Unfortunately the customization hook > emacs-starter-kit provides (~/.emacs.d/custom.el) is loaded too late > to affect the temporary directory. > > I'm running emacs-snapshot 1:20090909-1 in Ubuntu 10.10. Looks like > this is really an Emacs bug and is already fixed: > http://groups.google.com/group/gnu.emacs.bug/browse_thread/thread/0446b8684a8ef504 > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode