#!/bin/bash

EMACS=/usr/local/bin/emacs
LOAD_LIBS_EL=load-core-history.el
DUMP_FILE=emacs-core.pdmp
#LOAD_NONCORE_EL=load-compiled-package-libraries.el
LOAD_NONCORE_EL=load-elpa-packages.el
DO_NONCORE_LOAD=""
if [ "$LOAD_NONCORE_EL" ]; then
    DO_NONCORE_LOAD="-l $HOME/elpa-load-path -l $LOAD_NONCORE_EL"
fi
touch dump.start
$EMACS -Q -batch \
       -l "$LOAD_LIBS_EL" \
       $DO_NONCORE_LOAD \
       --eval "(dump-emacs-portable \"${DUMP_FILE}\" nil)" \
    |& tee dump-emacs-core.log
touch dump.end
echo "Started: $(stat -c %y dump.start)"
echo "Ended: $(stat -c %y dump.end)"



       
