emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Can't close Emacs+org-mode if /tmp and /home on different part


From: Antti Kaihola
Subject: [Orgmode] Can't close Emacs+org-mode if /tmp and /home on different partitions
Date: Thu, 2 Dec 2010 10:33:28 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]