summaryrefslogtreecommitdiff
path: root/emacs-helm.sh
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2019-09-23 20:03:20 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2019-09-23 20:03:20 +0200
commit5ea85dec2b598a2944d1da20299fda392d70be07 (patch)
tree840b371e6669ad9a7fd6b4f6ba1f7fa57733fc91 /emacs-helm.sh
parent6db28059f52699b16bae195cca6762e0b6a08713 (diff)
Add option to load specified packages
in emacs-helm.sh
Diffstat (limited to 'emacs-helm.sh')
-rwxr-xr-xemacs-helm.sh26
1 files changed, 21 insertions, 5 deletions
diff --git a/emacs-helm.sh b/emacs-helm.sh
index cceabafa..10e1b3c7 100755
--- a/emacs-helm.sh
+++ b/emacs-helm.sh
@@ -27,14 +27,16 @@ test -z "$TEMP" && TEMP="/tmp"
CONF_FILE="$TEMP/helm-cfg.el"
EMACS=emacs
TOOLBARS=-1
+LOAD_PACKAGES=
usage () {
cat >&1 <<EOF
Usage: ${0##*/} [-P PATH] [--toolbars] [-h] [EMACS-OPTIONS-OR-FILENAME]
--P --path: Specify path to emacs.
--B --toolbars: Display Menu bar, scroll bar etc...
--h: Display this help and exit.
+-P --path: Specify path to emacs.
+-B --toolbars: Display Menu bar, scroll bar etc...
+--load-packages: Load specified packages (separate with ",").
+-h: Display this help and exit.
Any other Emacs options or filename must come after.
@@ -113,13 +115,18 @@ for a in "$@"; do
case $a in
--path | -P)
shift 1
- EMACS=$1
+ EMACS="$1"
shift 1
;;
--toolbars | -B)
shift 1
TOOLBARS=1
;;
+ --load-packages)
+ shift 1
+ LOAD_PACKAGES="$1"
+ shift 1
+ ;;
-h)
usage
exit 1
@@ -178,7 +185,16 @@ cat > $CONF_FILE <<EOF
(file-name-directory
(directory-file-name default-directory)))))
-(setq package-load-list '((helm-core t) (helm t) (async t) (popup t)))
+(let* ((str-lst "$LOAD_PACKAGES")
+ (load-packages (and str-lst
+ (not (string= str-lst ""))
+ (split-string str-lst ","))))
+ (setq package-load-list
+ (if (equal load-packages '("all"))
+ '(all)
+ (append '((helm-core t) (helm t) (async t) (popup t))
+ (mapcar (lambda (p) (list (intern p) t)) load-packages)))))
+
(package-initialize)
(add-to-list 'load-path (file-name-directory (file-truename "$0")))
(unless (> $TOOLBARS 0)