Skip to content

Commit 3d3d61e

Browse files
committed
Add safer method to remove hywiki-folder
1 parent 85fcec4 commit 3d3d61e

File tree

3 files changed

+167
-135
lines changed

3 files changed

+167
-135
lines changed

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2025-10-18 Mats Lidell <[email protected]>
2+
3+
* test/hywiki-tests.el (hywiki-tests--edit): Added cleanup of
4+
hywiki-directory after test.
5+
(hywiki-tests--only-file-in-dir-p)
6+
(hywiki-tests--delete-hywiki-cache)
7+
(hywiki-tests--delete-hywiki-dir-and-buffer): Add safer delete of
8+
hywiki-directory so removal of a live hywiki-directory is less
9+
likely. The dir must be empty and cache is only removed if it is the
10+
last file remaining in the dir. Moved these into hywiki-tests since
11+
they are only used with managing hywiki-directory in test cleanup and
12+
use it through out the hywiki-directory tests.
13+
114
2025-10-13 Mats Lidell <[email protected]>
215

316
* hycontrol.el (hycontrol-frame-zoom, hycontrol-frame-zoom-reset): For

test/hy-test-helpers.el

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Mats Lidell <[email protected]>
44
;;
55
;; Orig-Date: 30-Jan-21 at 12:00:00
6-
;; Last-Mod: 5-Oct-25 at 23:56:44 by Mats Lidell
6+
;; Last-Mod: 18-Oct-25 at 00:31:06 by Mats Lidell
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -110,16 +110,9 @@ Checks ACTYPE, ARGS, LOC, LBL-KEY and NAME."
110110

111111
(defun hy-delete-dir-and-buffer (dir)
112112
"Delete DIR and buffer visiting directory."
113-
(let ((buf (find-buffer-visiting dir))
114-
(hywiki-cache (when (featurep 'hywiki)
115-
(expand-file-name hywiki-cache-default-file
116-
dir))))
113+
(let ((buf (find-buffer-visiting dir)))
117114
(when buf
118115
(kill-buffer buf))
119-
(when (and hywiki-cache
120-
(file-readable-p hywiki-cache)
121-
(file-writable-p hywiki-cache))
122-
(delete-file hywiki-cache))
123116
(delete-directory dir)))
124117

125118
(defun hy-make-random-wikiword (&optional length word-length)

0 commit comments

Comments
 (0)