summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2022-07-14 22:12:27 -0400
committerJohn Turner <jturner.usa@gmail.com>2022-07-22 22:48:08 -0400
commit04f350f889db7e2c73e7be48797a5ba83b891dc7 (patch)
tree0d2a99a6e4e6ea97b1758d8aad2c9cdd5a352083
parentc0ef72c62089457092653324070a785ed514d80c (diff)
downloademacs.d-04f350f889db7e2c73e7be48797a5ba83b891dc7.tar.gz
removed backup-before-save
-rw-r--r--lisp/backup-before-save/backup-before-save.el54
-rw-r--r--load-local-lisp.el3
2 files changed, 0 insertions, 57 deletions
diff --git a/lisp/backup-before-save/backup-before-save.el b/lisp/backup-before-save/backup-before-save.el
deleted file mode 100644
index 5277fff..0000000
--- a/lisp/backup-before-save/backup-before-save.el
+++ /dev/null
@@ -1,54 +0,0 @@
-(defvar backup-before-save-directory (file-name-concat user-emacs-directory "backups"))
-
-(unless (file-exists-p backup-before-save-directory)
- (mkdir backup-before-save-directory))
-
-(defun backup-before-save-format-path (path number)
- (format "%s.~%s~" path number))
-
-(defun backup-before-save-extension (path)
- (let* ((i (string-search "." (reverse path)))
- (extension (substring path (- (length path) i))))
- extension))
-
-(defun backup-before-save-no-extension (path)
- (let* ((i (string-search "." (reverse path)))
- (no-extension (substring path 0 (- (length path) (+ i 1)))))
- no-extension))
-
-(defun backup-before-save-number (path)
- (let* ((extension (backup-before-save-extension path))
- (extracted (substring extension 1 (- (length extension) 1)))
- (as-number (unless (zerop (length extracted))
- (string-to-number extracted))))
- as-number))
-
-(defun backup-before-save-shift-path (path)
- (let* ((without-extension (backup-before-save-no-extension path))
- (number (backup-before-save-number path))
- (next-number (+ number 1))
- (shifted-path (backup-before-save-format-path
- without-extension
- next-number)))
- shifted-path))
-
-(defun backup-before-save-shift-backup (path)
- (let ((next-path (backup-before-save-shift-path path)))
- (when (file-exists-p next-path)
- (backup-before-save-shift-backup next-path))
- (rename-file path next-path)))
-
-(defun backup-before-save-function ()
- (unless backup-inhibited
- (let* ((full-path (buffer-file-name))
- (base-path (file-name-nondirectory full-path))
- (backup-full-path (file-name-concat backup-before-save-directory base-path))
- (backup-full-path-numbered (backup-before-save-format-path backup-full-path 0)))
- (when (file-exists-p full-path)
- (when (file-exists-p backup-full-path-numbered)
- (backup-before-save-shift-backup backup-full-path-numbered))
- (copy-file full-path backup-full-path-numbered)))))
-
-(add-hook 'before-save-hook 'backup-before-save-function)
-
-(provide 'backup-before-save)
diff --git a/load-local-lisp.el b/load-local-lisp.el
index 28ed25d..bfad1ad 100644
--- a/load-local-lisp.el
+++ b/load-local-lisp.el
@@ -1,7 +1,4 @@
(let ((local-lisp-directory (file-name-concat user-emacs-directory "lisp")))
- (add-to-list 'load-path (file-name-concat local-lisp-directory "backup-before-save"))
(add-to-list 'load-path (file-name-concat local-lisp-directory "man-wrapper")))
-(require 'backup-before-save)
(require 'man-wrapper)
-