[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115319: * lisp/startup.el (command-line): Warn if ~
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] trunk r115319: * lisp/startup.el (command-line): Warn if ~/emacs.d is in load-path. |
Date: |
Sun, 01 Dec 2013 02:04:53 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115319
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2013-11-30 18:04:46 -0800
message:
* lisp/startup.el (command-line): Warn if ~/emacs.d is in load-path.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/startup.el startup.el-20091113204419-o5vbwnq5f7feedwu-260
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-11-30 19:12:21 +0000
+++ b/lisp/ChangeLog 2013-12-01 02:04:46 +0000
@@ -1,3 +1,7 @@
+2013-12-01 Glenn Morris <address@hidden>
+
+ * startup.el (command-line): Warn if ~/emacs.d is in load-path.
+
2013-11-30 Eli Zaretskii <address@hidden>
* startup.el (fancy-splash-frame): On MS-Windows, trigger
=== modified file 'lisp/startup.el'
--- a/lisp/startup.el 2013-11-30 19:11:00 +0000
+++ b/lisp/startup.el 2013-12-01 02:04:46 +0000
@@ -1289,6 +1289,29 @@
;; Process the remaining args.
(command-line-1 (cdr command-line-args))
+ ;; 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.
+ ;; but for the sake of simplicity, we discourage it full-stop.
+ ;; Ref eg http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00056.html
+ ;;
+ ;; A bad element could come from user-emacs-file, the command line,
+ ;; or EMACSLOADPATH, so we basically always have to check.
+ (let (warned)
+ (dolist (dir load-path)
+ (and (not warned)
+ (string-match-p "/[._]emacs\\.d/?\\'" dir)
+ (string-equal (file-name-as-directory (expand-file-name dir))
+ (expand-file-name user-emacs-directory))
+ (setq warned t)
+ (display-warning 'initialization
+ (format "Your `load-path' seems to contain
+your `.emacs.d' directory: %s\n\
+This is likely to cause problems...\n\
+Consider using a subdirectory instead, e.g.: %s" dir
+(expand-file-name "lisp" user-emacs-directory))
+ :warning))))
+
;; If -batch, terminate after processing the command options.
(if noninteractive (kill-emacs t))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115319: * lisp/startup.el (command-line): Warn if ~/emacs.d is in load-path.,
Glenn Morris <=