Neue Funktion: Autosave in .org- und .md-Dateien

This commit is contained in:
handi
2026-04-03 22:31:51 +02:00
parent 52e2d868b4
commit ee451f78fd
4 changed files with 89 additions and 2 deletions

View File

@@ -23,7 +23,9 @@
(setq kept-new-versions 6) ;; wie viele neue behalten
(setq kept-old-versions 2) ;; wie viele alte behalten
;; Autosave-Files in den auto-save-list Ordner
(setq auto-save-file-name-transforms
`((".*" "~/.emacs.d/auto-save-list/" t)))
;; Maus im Terminal
(unless (display-graphic-p)
@@ -52,6 +54,9 @@
(set-face-background 'fringe "#1e1e1e")
(set-face-background 'region "#3a3a3a")
;; WRITING
;; Schreiblayout für Textmodi
(defun my/text-indentation-setup ()
"Angenehme Einrückung und Umbrüche für Text."
@@ -64,3 +69,11 @@
(add-hook 'text-mode-hook #'my/text-indentation-setup)
(provide 'init-ui)
;; Automatisches Speichern wenn Buffer geändert wurde (.org + .md)
(defun my/auto-save-if-modified ()
(when (and (buffer-modified-p)
(derived-mode-p 'org-mode 'markdown-mode))
(save-buffer)))
(run-with-idle-timer 2 t #'my/auto-save-if-modified)