syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.56k stars 4.9k forks source link

"dotspacemacs-auto-save-file-location" not triggering "after-save-hook"? #16432

Closed vicmortelmans closed 2 weeks ago

vicmortelmans commented 3 weeks ago

Description :octocat:

I want to sync the files in my project on github using auto-save and git-auto-commit-mode.

My dotspacemacs has:

dotspacemacs-auto-save-file-location 'original

and:

dotspacemacs-additional-packages '(git-auto-commit-mode)

and in user-config:

  (setq-default gac-ask-for-summary-p nil)
  (setq-default gac-automatically-push-p t)
  (setq-default gac-silent-message-p t)

The files I want to sync are in a git repo and contain in the header:

;; -*- eval: (git-auto-commit-mode 1) -*-

When I manually save, it works, but when an open file is auto-saved, no commit is happening.

git-auto-commit-mode relies on the after-save-hook. Can it be that auto-save isn't triggering this hook?

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: File is saved, but not committed.

Expected behaviour: :heart: :smile: File is saved and committed.

System Info :computer:

Backtrace :paw_prints:

fnussbaum commented 3 weeks ago

Thanks for reporting. This seems to be the same issue as https://github.com/ryuslash/git-auto-commit-mode/issues/32, so you could probably solve it in your configuration by using auto-save-visited-mode instead of the dotspacemacs-auto-save-file-location 'original option.

Of course this should also (or rather instead) be addressed in Spacemacs, we should not use the deprecated option auto-save-visited-file-name anymore.

smile13241324 commented 2 weeks ago

I think the root cause is that spacemacs is using an outdated mode for auto saving, lets change this on the Spacemacs level.