#!/bin/bash

EMACS=${EMACS:-/usr/local/bin/emacs}
#LOAD_LIBS_EL=load-core-history.el
PROVIDE_FEATURES_EL=provide-post-init-features-28.2.el
LOAD_LIBS_EL=redump-loadup-core-28.2.el
INSTALL_HOOKS_EL=install-init-hooks-28.2.el
DUMP_FILE=${1:-emacs-core.pdmp}
touch dump.start
$EMACS -Q -batch \
       -l "$PROVIDE_FEATURES_EL" \
       -l "$LOAD_LIBS_EL" \
       -l "$INSTALL_HOOKS_EL" \
       --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)"



       
