Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove temp files /tmp/fineDiff* for kill-emacs without quit ediff #16765

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions core/core-versions.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,15 @@
(defconst spacemacs-version "0.999.0" "Spacemacs version.")
(defconst spacemacs-emacs-min-version "28.2" "Minimal version of Emacs.")

(defmacro spacemacs/block-before-emacs-min-version (version msg &rest body)
"Apply the BODY if `spacemacs-emacs-min-version' < VERSION, otherwise
warn the MSG."
(declare (indent 1))
`(if (version< spacemacs-emacs-min-version ,version)
(progn ,@body)
(apply 'warn
(if ,msg '("%s" ,msg)
'("Minimum emacs version %s is newer than supported version %s"
,version spacemacs-emacs-min-version)))))

(provide 'core-versions)
11 changes: 11 additions & 0 deletions layers/+spacemacs/spacemacs-defaults/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,17 @@ variable."
(ediff-files (dotspacemacs/location)
(concat dotspacemacs-template-directory ".spacemacs.template")))

(spacemacs/block-before-emacs-min-version "31.0.50"
"Use builtin `ediff--delete-temp-files-on-kill-emacs' first"

(defun spacemacs//ediff-delete-temp-files ()
"Delete the temp-files associated with the ediff buffers."
(let ((inhibit-interaction t))
(dolist (b ediff-session-registry)
(ignore-errors
(with-current-buffer b
(ediff-delete-temp-files)))))))

(defun spacemacs/new-empty-buffer (&optional split)
"Create a new buffer called: \"untitled\".

Expand Down
4 changes: 3 additions & 1 deletion layers/+spacemacs/spacemacs-defaults/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@
(require 'outline)
(add-hook 'ediff-prepare-buffer-hook #'show-all)
;; restore window layout when done
(add-hook 'ediff-quit-hook #'winner-undo)))
(add-hook 'ediff-quit-hook #'winner-undo)
(when (fboundp 'spacemacs//ediff-delete-temp-files)
(add-hook 'kill-emacs-hook #'spacemacs//ediff-delete-temp-files))))

(defun spacemacs-defaults/init-eldoc ()
(use-package eldoc
Expand Down
Loading