From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antti Kaihola Subject: Can't close Emacs+org-mode if /tmp and /home on different partitions Date: Thu, 2 Dec 2010 10:33:28 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from [140.186.70.92] (port=55697 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PO4bl-0002PV-ET for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 03:33:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PO4bZ-0001gD-Pv for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 03:33:40 -0500 Received: from mail-iw0-f169.google.com ([209.85.214.169]:62915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PO4bZ-0001fd-Mq for emacs-orgmode@gnu.org; Thu, 02 Dec 2010 03:33:29 -0500 Received: by iwn41 with SMTP id 41so1094073iwn.0 for ; Thu, 02 Dec 2010 00:33:29 -0800 (PST) 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: emacs-orgmode 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. 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