diff options
| author | Stephen Berman | 2023-02-24 16:43:35 +0100 |
|---|---|---|
| committer | Stephen Berman | 2023-02-24 16:43:35 +0100 |
| commit | 925724a4b54a6780bfa342bc3a6440a6ad0a6ecc (patch) | |
| tree | dc919ea7fef06e5d685393fbb580c514ecc07555 /test | |
| parent | 55d29c9bacb6227bc8b3a6c0dd52c7085fe63aaf (diff) | |
| download | emacs-925724a4b54a6780bfa342bc3a6440a6ad0a6ecc.tar.gz emacs-925724a4b54a6780bfa342bc3a6440a6ad0a6ecc.zip | |
Restore invisibility of symlink target on exiting wdired-mode
* lisp/wdired.el (wdired-change-to-dired-mode): Invoke
dired-hide-details-update-invisibility-spec (bug#61510).
* test/lisp/wdired-tests.el (wdired-test-bug61510): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/wdired-tests.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el index 74c2449076f..897c6cd69a8 100644 --- a/test/lisp/wdired-tests.el +++ b/test/lisp/wdired-tests.el | |||
| @@ -189,5 +189,28 @@ wdired-get-filename before and after editing." | |||
| 189 | (wdired-finish-edit)) | 189 | (wdired-finish-edit)) |
| 190 | (if buf (kill-buffer buf))))))) | 190 | (if buf (kill-buffer buf))))))) |
| 191 | 191 | ||
| 192 | (ert-deftest wdired-test-bug61510 () | ||
| 193 | "Test visibility of symlink target on leaving wdired-mode. | ||
| 194 | When dired-hide-details-mode is enabled and | ||
| 195 | dired-hide-details-hide-symlink-targets is non-nil (the default), | ||
| 196 | the link target becomes invisible. When wdired-mode is enabled | ||
| 197 | the target becomes visible, but on returning to dired-mode, it | ||
| 198 | should be invisible again." | ||
| 199 | (ert-with-temp-directory test-dir | ||
| 200 | (let ((buf (find-file-noselect test-dir)) | ||
| 201 | ;; Default value is t, but set it anyway, to be sure. | ||
| 202 | (dired-hide-details-hide-symlink-targets t)) | ||
| 203 | (unwind-protect | ||
| 204 | (with-current-buffer buf | ||
| 205 | (make-symbolic-link "bar" "foo") | ||
| 206 | (dired-hide-details-mode) | ||
| 207 | (should (memq 'dired-hide-details-link buffer-invisibility-spec)) | ||
| 208 | (dired-toggle-read-only) | ||
| 209 | (should-not (memq 'dired-hide-details-link | ||
| 210 | buffer-invisibility-spec)) | ||
| 211 | (wdired-finish-edit) | ||
| 212 | (should (memq 'dired-hide-details-link buffer-invisibility-spec))) | ||
| 213 | (if buf (kill-buffer buf)))))) | ||
| 214 | |||
| 192 | (provide 'wdired-tests) | 215 | (provide 'wdired-tests) |
| 193 | ;;; wdired-tests.el ends here | 216 | ;;; wdired-tests.el ends here |