diff options
author | Benjamin Orthen <benjamin@orthen.net> | 2020-02-17 01:55:16 +0100 |
---|---|---|
committer | Benjamin Orthen <benjamin@orthen.net> | 2020-02-17 01:55:16 +0100 |
commit | 6a6b608826d2c47e47cbeacbea9ac5ae31d05646 (patch) | |
tree | 9498cb2d336d4883ccaa85e31dd40cafdd03c484 | |
parent | 7c5d910162ea33197b7e3656355f9b2eb2f538f2 (diff) |
Respect that emacs config-folder can now be in $XDG_CONFIG_HOME
* Make use of locate-user-emacs-file
* Change Makefile to check first if $(XDG_CONFIG_HOME)/emacs/elpa or
~/.config/emacs/elpa exists and if not, fall back to ~/.emacs.d/elpa
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | emacs-helm.sh | 2 | ||||
-rw-r--r-- | helm-adaptive.el | 2 | ||||
-rw-r--r-- | helm-files.el | 2 |
4 files changed, 8 insertions, 4 deletions
@@ -34,7 +34,11 @@ PKGDIR := . # Additional emacs loadpath LOADPATH := -L $(PKGDIR) -ELPA_DIR = $(HOME)/.emacs.d/elpa + +# Prefer emacs config folder in XDG_CONFIG_HOME to ~/.emacs.d +XDG_ELPA_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME)/emacs/elpa, $(HOME)/.config/emacs/elpa) +ELPA_DIR := $(if $(shell test -d $(XDG_ELPA_DIR)), $(HOME)/.emacs.d/elpa, $(XDG_ELPA_DIR)) + ASYNC_ELPA_DIR = $(shell \ test -d $(ELPA_DIR) && \ find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/async-[.0-9]*' 2> /dev/null | \ diff --git a/emacs-helm.sh b/emacs-helm.sh index 848a72c6..568048b9 100755 --- a/emacs-helm.sh +++ b/emacs-helm.sh @@ -179,7 +179,7 @@ cat > $CONF_FILE <<EOF ;; User may be using a non standard \`package-user-dir'. ;; Modify \`package-directory-list' instead of \`package-user-dir' ;; in case the user starts Helm from a non-ELPA installation. -(unless (file-equal-p package-user-dir "~/.emacs.d/elpa") +(unless (file-equal-p package-user-dir (locate-user-emacs-file "elpa")) (add-to-list 'package-directory-list (directory-file-name (file-name-directory (directory-file-name default-directory))))) diff --git a/helm-adaptive.el b/helm-adaptive.el index 13b6f638..5be22283 100644 --- a/helm-adaptive.el +++ b/helm-adaptive.el @@ -29,7 +29,7 @@ :group 'helm) (defcustom helm-adaptive-history-file - "~/.emacs.d/helm-adaptive-history" + (locate-user-emacs-file "helm-adaptive-history") "Path of file where history information is stored. When nil history is not saved nor restored after emacs restart unless you save/restore `helm-adaptive-history' with something else like diff --git a/helm-files.el b/helm-files.el index 21ef4c1d..fa80f220 100644 --- a/helm-files.el +++ b/helm-files.el @@ -4263,7 +4263,7 @@ inversed." ;; ;; (defvar helm-ff-delete-log-file - (expand-file-name "helm-delete-file.log" user-emacs-directory) + (locate-user-emacs-file "helm-delete-file.log") "The file use to communicate with emacs child when deleting files async.") (defvar helm-ff--trash-flag nil) |