GNU bug report logs -
#25163
26.0.50; Unable to access `user-emacs-directory' (~/.emacs.d/)
Previous Next
Reported by: emacs18 <at> gmail.com
Date: Sun, 11 Dec 2016 03:37:01 UTC
Severity: minor
Found in version 26.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
npostavs <at> users.sourceforge.net writes:
> I see the same in Emacs 25, 24.5, and 24.4; 24.3 just prints a "File
> exists" message. Looks like the problem is that locate-user-emacs-file
> (and thus the check for the warning) is called before any customizations
> (or --eval args) are executed.
> Perhaps the warning could be delayed until after init time?
Following patch delay the warning until al command line arguments have
being processed.
What do you think?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 8d715d63eeda6e7814a86203f59ce6ee239aa65d Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sun, 11 Dec 2016 17:32:18 +0900
Subject: [PATCH] Fix Bug#25162
* lisp/startup.el (command-line): If user-emacs-directory is not
accessible, delay to show a warning until all command line args
are processed.
---
lisp/startup.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/lisp/startup.el b/lisp/startup.el
index 4a04f9c..dc59d9c 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1094,11 +1094,12 @@ command-line
;; Re-evaluate predefined variables whose initial value depends on
;; the runtime context.
- (mapc 'custom-reevaluate-setting
- ;; Initialize them in the same order they were loaded, in case there
- ;; are dependencies between them.
- (prog1 (nreverse custom-delayed-init-variables)
- (setq custom-delayed-init-variables nil)))
+ (let (user-emacs-directory-warning) ; Delay showing this warning (Bug#25162).
+ (mapc 'custom-reevaluate-setting
+ ;; Initialize them in the same order they were loaded, in case there
+ ;; are dependencies between them.
+ (prog1 (nreverse custom-delayed-init-variables)
+ (setq custom-delayed-init-variables nil))))
(normal-erase-is-backspace-setup-frame)
@@ -1365,6 +1366,11 @@ command-line
;; Process the remaining args.
(command-line-1 (cdr command-line-args))
+ ;; Check if `user-emacs-directory' is accessible (Bug#25162).
+ (when (and user-emacs-directory-warning
+ (not (file-accessible-directory-p user-emacs-directory)))
+ (locate-user-emacs-file ""))
+
;; This is a problem because, e.g. if emacs.d/gnus.el exists,
;; trying to load gnus could load the wrong file.
;; OK, it would not matter if .emacs.d were at the end of load-path.
--
2.10.2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.4)
of 2016-12-11
Repository revision: 595a4d6bfd5aad79fb3ab681ae06f0739a4a5701
This bug report was last modified 3 years and 109 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.