Implement emacs-stuff-dir function.