GNU bug report logs - #13930
Emacs doesn't cope well if it can't access/create .emacs.d

Previous Next

Package: emacs;

Reported by: Robert Prije <rprije <at> janestreet.com>

Date: Tue, 12 Mar 2013 01:47:01 UTC

Severity: normal

Merged with 16154

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #38 received at 13930 <at> debbugs.gnu.org (full text, mbox):

From: Robert Prije <rprije <at> janestreet.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 13930 <at> debbugs.gnu.org
Subject: Re: bug#13930: Emacs doesn't cope well if it can't access/create
	.emacs.d
Date: Tue, 14 May 2013 16:46:16 +0800
[Message part 1 (text/plain, inline)]
This is much better. I now get a separate window with the following error:

"Warning (initialization): Unable to create `user-emacs-directory'
(~/.emacs.d/).
Any data that would normally be written there may be lost!
If you never want to see this message again,
customize the variable `user-emacs-directory-warning'."

but the file I attempt to open still opens and I can edit it as usual. It
appears the patch works as intended. Which release is it likely to make it
to?

Thanks a bunch Glenn.



On Tue, May 14, 2013 at 3:30 PM, Glenn Morris <rgm <at> gnu.org> wrote:

>
> Does this patch work for you?
>
> *** lisp/subr.el        2013-04-27 21:12:17 +0000
> --- lisp/subr.el        2013-05-14 07:27:31 +0000
> ***************
> *** 2643,2648 ****
> --- 2643,2655 ----
>   Note that this should end with a directory separator.
>   See also `locate-user-emacs-file'.")
>
> + (custom-declare-variable-early 'user-emacs-directory-warning t
> +   "Non-nil means warn if cannot access `user-emacs-directory'.
> + Set this to nil at your own risk..."
> +   :type 'boolean
> +   :group 'initialization
> +   :version "24.4")
> +
>   (defun locate-user-emacs-file (new-name &optional old-name)
>     "Return an absolute per-user Emacs-specific file name.
>   If NEW-NAME exists in `user-emacs-directory', return it.
> ***************
> *** 2658,2674 ****
>                 (file-readable-p at-home))
>          at-home
>          ;; Make sure `user-emacs-directory' exists,
> !        ;; unless we're in batch mode or dumping Emacs
>          (or noninteractive
>            purify-flag
> !          (file-accessible-directory-p
> !           (directory-file-name user-emacs-directory))
>            (let ((umask (default-file-modes)))
>              (unwind-protect
>                  (progn
>                    (set-default-file-modes ?\700)
> !                  (make-directory user-emacs-directory))
>                (set-default-file-modes umask))))
>          bestname))))
>
>   ;;;; Misc. useful functions.
> --- 2665,2697 ----
>                 (file-readable-p at-home))
>          at-home
>          ;; Make sure `user-emacs-directory' exists,
> !        ;; unless we're in batch mode or dumping Emacs.
>          (or noninteractive
>            purify-flag
> !          (let (errtype)
> !            (if (file-directory-p user-emacs-directory)
> !                (or (file-accessible-directory-p user-emacs-directory)
> !                    (setq errtype "access"))
>                (let ((umask (default-file-modes)))
>                  (unwind-protect
>                      (progn
>                        (set-default-file-modes ?\700)
> !                      (condition-case nil
> !                          (make-directory user-emacs-directory)
> !                        (error (setq errtype "create"))))
>                    (set-default-file-modes umask))))
> +            (when (and errtype
> +                       user-emacs-directory-warning
> +                       (not (get 'user-emacs-directory-warning
> 'this-session)))
> +              ;; Only warn once per Emacs session.
> +              (put 'user-emacs-directory-warning 'this-session t)
> +              (display-warning 'initialization
> +                               (format "\
> + Unable to %s `user-emacs-directory' (%s).
> + Any data that would normally be written there may be lost!
> + If you never want to see this message again,
> + customize the variable `user-emacs-directory-warning'."
> +                                       errtype user-emacs-directory)))))
>          bestname))))
>
>   ;;;; Misc. useful functions.
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.