<commit_before>ZIT_MODULES_PATH="${HOME}" ZIT_DISABLE_UPGRADE=1 \
  zit-in "https://github.com/hlissner/doom-emacs#develop" ".emacs.d"

path=(
  ~/.emacs.d/bin
  ${path}
)

if [[ -n "${EMACS}" ]]; then
  export VISUAL="emacsclient"
  export EDITOR="${VISUAL}"
  export GIT_EDITOR="${EDITOR}"
  # Disable RPROMPT in Emacs term
  export RPROMPT=""
fi

alias em="GDK_BACKEND=x11 run-bg emacs"
alias et="TERM=xterm-24bit emacs -nw"
alias ec="GDK_BACKEND=x11 close-fd emacsclient -a '' -nqc"

EMACS_PATH="${HOME}/.emacs.d"
DOOM_SNAPHOST_HASH_PATH="${HOME}/.doom-snapshot-hash"

doom-snapshot-and-upgrade() {
  git --git-dir "${EMACS_PATH}/.git" rev-parse HEAD >! "${DOOM_SNAPHOST_HASH_PATH}"
  emacs -f straight-freeze-versions -f kill-emacs
  doom -y upgrade
}

doom-restore() {
  if [[ -f "${DOOM_SNAPHOST_HASH_PATH}" ]]; then
    git --git-dir "${EMACS_PATH}/.git" reset $(cat "${DOOM_SNAPHOST_HASH_PATH}")
  fi
  if [[ -f "${EMACS_PATH}/.local/straight/versions/default.el" ]]; then
    emacs -f straight-thaw-versions -f kill-emacs
  fi
  doom -y refresh
  doom rebuild -f
}

UPGRADE_CMDS+="doom-snapshot-and-upgrade"<commit_msg>doom: Fix upgrade command<commit_after>ZIT_MODULES_PATH="${HOME}" ZIT_DISABLE_UPGRADE=1 \
  zit-in "https://github.com/hlissner/doom-emacs#develop" ".emacs.d"

path=(
  ~/.emacs.d/bin
  ${path}
)

if [[ -n "${EMACS}" ]]; then
  export VISUAL="emacsclient"
  export EDITOR="${VISUAL}"
  export GIT_EDITOR="${EDITOR}"
  # Disable RPROMPT in Emacs term
  export RPROMPT=""
fi

alias em="GDK_BACKEND=x11 run-bg emacs"
alias et="TERM=xterm-24bit emacs -nw"
alias ec="GDK_BACKEND=x11 close-fd emacsclient -a '' -nqc"

EMACS_PATH="${HOME}/.emacs.d"
DOOM_SNAPHOST_HASH_PATH="${HOME}/.doom-snapshot-hash"

doom-snapshot-and-upgrade() {
  git --git-dir "${EMACS_PATH}/.git" rev-parse HEAD >! "${DOOM_SNAPHOST_HASH_PATH}"
  emacs -f straight-freeze-versions -f kill-emacs
  doom upgrade -f
}

doom-restore() {
  if [[ -f "${DOOM_SNAPHOST_HASH_PATH}" ]]; then
    git --git-dir "${EMACS_PATH}/.git" reset $(cat "${DOOM_SNAPHOST_HASH_PATH}")
  fi
  if [[ -f "${EMACS_PATH}/.local/straight/versions/default.el" ]]; then
    emacs -f straight-thaw-versions -f kill-emacs
  fi
  doom -y refresh
  doom rebuild -f
}

UPGRADE_CMDS+="doom-snapshot-and-upgrade"
{'fraction_non_alphanumeric': 0.17841409691629956, 'fraction_numerical': 0.006167400881057269, 'mean_word_length': 4.208715596330276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2463031', 'n_tokens_mistral': 978, 'n_tokens_neox': 961, 'n_words': 174}