summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2011-03-16 03:13:31 +0100
committerJuanma Barranquero <lekktu@gmail.com>2011-03-16 03:13:31 +0100
commit8a05b6681ee826c186f533900208b2226d3549a6 (patch)
tree54367eb0aef65a38325e434ec2149e5413d9b4ab
parent5ba5fb816df11ef82326f16c8d9da88169bde721 (diff)
downloademacs-8a05b6681ee826c186f533900208b2226d3549a6.tar.gz
Add warning for obsolete _emacs init file.
* lisp/startup.el (command-line): Warn the user that _emacs is deprecated. * etc/NEWS: Document warning about _emacs.
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/startup.el30
4 files changed, 27 insertions, 13 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 15f613edf8f..cbe46d3a53e 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * NEWS: Document warning about _emacs.
+
2011-03-14 Michael Albinus <michael.albinus@gmx.de>
* NEWS: `shell' prompts for the shell path name, when the default
diff --git a/etc/NEWS b/etc/NEWS
index 7b4bdc46e7a..bb59e0e2a24 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -62,6 +62,8 @@ longer have any effect. (They were declared obsolete in Emacs 23.)
** New command line option `--no-site-lisp' removes site-lisp directories
from load-path. -Q now implies this.
+** On Windows, Emacs now warns when the obsolete _emacs init file is used.
+
* Changes in Emacs 24.1
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 93a6e720a78..9dcc5fb9ca5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
2011-03-16 Juanma Barranquero <lekktu@gmail.com>
+ * startup.el (command-line): Warn the user that _emacs is deprecated.
+
+2011-03-16 Juanma Barranquero <lekktu@gmail.com>
+
* progmodes/delphi.el (delphi-search-path, delphi-indent-level)
(delphi-verbose, delphi-comment-face, delphi-string-face)
(delphi-keyword-face, delphi-ignore-changes, delphi-indent-line)
diff --git a/lisp/startup.el b/lisp/startup.el
index 2bdb6fef505..65b1a013c21 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1006,19 +1006,23 @@ opening the first frame (e.g. open a connection to an X server).")
(if init-file-user
(let ((user-init-file-1
(cond
- ((eq system-type 'ms-dos)
- (concat "~" init-file-user "/_emacs"))
- ((eq system-type 'windows-nt)
- ;; Prefer .emacs on Windows.
- (if (directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$")
- "~/.emacs"
- ;; Also support _emacs for compatibility.
- (if (directory-files "~" nil "^_emacs\\(\\.elc?\\)?$")
- "~/_emacs"
- ;; But default to .emacs if _emacs does not exist.
- "~/.emacs")))
- (t
- (concat "~" init-file-user "/.emacs")))))
+ ((eq system-type 'ms-dos)
+ (concat "~" init-file-user "/_emacs"))
+ ((not (eq system-type 'windows-nt))
+ (concat "~" init-file-user "/.emacs"))
+ ;; Else deal with the Windows situation
+ ((directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$")
+ ;; Prefer .emacs on Windows.
+ "~/.emacs")
+ ((directory-files "~" nil "^_emacs\\(\\.elc?\\)?$")
+ ;; Also support _emacs for compatibility, but warn about it.
+ (display-warning
+ 'initialization
+ "`_emacs' init file is deprecated, please use `.emacs'"
+ :warning)
+ "~/_emacs")
+ (t ;; But default to .emacs if _emacs does not exist.
+ "~/.emacs"))))
;; This tells `load' to store the file name found
;; into user-init-file.
(setq user-init-file t)