[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-commit] [commit][emacs22] Figure out where user-specific Emacs sett
From: |
mwolson |
Subject: |
[Erc-commit] [commit][emacs22] Figure out where user-specific Emacs settings are stored |
Date: |
Sun, 14 Oct 2007 00:49:02 -0400 |
commit d9be86aa2fd083021eb9448baf8a45afc3c13bd7
Author: Michael Olson <address@hidden>
Date: Wed May 30 00:58:37 2007 +0000
Figure out where user-specific Emacs settings are stored
2007-05-30 Michael Olson <address@hidden>
* erc-compat.el (erc-user-emacs-directory): New variable that
determines where to find user-specific Emacs settings. For Emacs,
this is usually ~/.emacs.d, and for XEmacs this is usually
~/.xemacs.
* erc.el (erc-startup-file-list): Use erc-user-emacs-directory.
git-archimport-id: address@hidden/erc--main--0--patch-146
diff --git a/ChangeLog b/ChangeLog
index 4869e92..ebe438a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-05-30 Michael Olson <address@hidden>
+
+ * erc-compat.el (erc-user-emacs-directory): New variable that
+ determines where to find user-specific Emacs settings. For Emacs,
+ this is usually ~/.emacs.d, and for XEmacs this is usually
+ ~/.xemacs.
+
+ * erc.el (erc-startup-file-list): Use erc-user-emacs-directory.
+
2007-05-28 Michael Olson <address@hidden>
* erc-button.el (erc-button-url-regexp): Recognize parentheses as
diff --git a/erc-compat.el b/erc-compat.el
index bc4af3d..dc36820 100644
--- a/erc-compat.el
+++ b/erc-compat.el
@@ -209,6 +209,18 @@ one is kept."
(format-time-string "%Y-%m-%d" emacs-build-time))
"Time at which Emacs was dumped out.")
+;; Emacs 21 and XEmacs do not have user-emacs-directory, but XEmacs
+;; has user-init-directory.
+(defvar erc-user-emacs-directory
+ (cond ((boundp 'user-emacs-directory)
+ user-emacs-directory)
+ ((boundp 'user-init-directory)
+ user-init-directory)
+ (t "~/.emacs.d/"))
+ "Directory beneath which additional per-user Emacs-specific files
+are placed.
+Note that this should end with a directory separator.")
+
;; XEmacs' `replace-match' does not replace matching subexpressions in strings.
(defun erc-replace-match-subexpression-in-string
(newtext string match subexp start &optional fixedcase literal)
diff --git a/erc.el b/erc.el
index d0d84d0..fce4b9a 100644
--- a/erc.el
+++ b/erc.el
@@ -836,8 +836,9 @@ See `erc-server-flood-margin' for other flood-related
parameters.")
;; Script parameters
(defcustom erc-startup-file-list
- '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc"
- "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
+ (list (concat erc-user-emacs-directory ".ercrc.el")
+ (concat erc-user-emacs-directory ".ercrc")
+ "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
"List of files to try for a startup script.
The first existent and readable one will get executed.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erc-commit] [commit][emacs22] Figure out where user-specific Emacs settings are stored,
mwolson <=