emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Can't close Emacs+org-mode if /tmp and /home on different partitions
@ 2010-12-02  8:33 Antti Kaihola
  2010-12-08 10:13 ` Dan Davison
  0 siblings, 1 reply; 2+ messages in thread
From: Antti Kaihola @ 2010-12-02  8:33 UTC (permalink / raw)
  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Can't close Emacs+org-mode if /tmp and /home on different partitions
  2010-12-02  8:33 Can't close Emacs+org-mode if /tmp and /home on different partitions Antti Kaihola
@ 2010-12-08 10:13 ` Dan Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Davison @ 2010-12-08 10:13 UTC (permalink / raw)
  To: Antti Kaihola; +Cc: emacs-orgmode

Antti Kaihola <akaihola@gmail.com> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-08 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-02  8:33 Can't close Emacs+org-mode if /tmp and /home on different partitions Antti Kaihola
2010-12-08 10:13 ` Dan Davison

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).