Last active
October 12, 2020 06:27
-
-
Save shikishima/172ca74fe05a40ace748ccaa7226ae30 to your computer and use it in GitHub Desktop.
バージョン管理下においてもEmacsのバックアップファイルを作成する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; backup file | |
| (setq make-backup-files t) | |
| (setq backup-directory-alist | |
| (cons (cons "\\.*$" (tt/nice-path (concat user-emacs-directory "backup/"))) ; ディレクトリ | |
| backup-directory-alist)) | |
| (setq version-control nil) ; 世代管理はしない | |
| (setq vc-make-backup-files t) ; gitなどのバージョン管理下においてもバックアップは取る https://www.366service.com/jp/qa/a0bf9bef5bc6d7e31b505b32e84acae6 | |
| ;; 特定のメジャーモードではバックアップを取らない | |
| (defconst tt/backup/no-backup-modes '(fundamental-mode git-commit-mode)) | |
| (dolist (mode | |
| tt/backup/no-backup-modes) | |
| (add-hook (intern (concat (symbol-name mode) "-hook")) | |
| (lambda () | |
| (setq-local backup-inhibited t) | |
| ))) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
commit前にgit resetして痛い目にあったため。