summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCharles A. Roelli <charles@aurox.ch>2026-05-28 13:28:53 +0000
committerCharles A. Roelli <charles@aurox.ch>2026-06-04 12:26:15 +0200
commita2e7b68764381e0880d55f71ef1d39cff73f950c (patch)
treefaf22629e1188b91132e9ecd140dd43447a1eb13 /test
parentaa6acc69edb64eb962beb074c065c7b44c194da7 (diff)
Use `confirm-nonexistent-file-or-buffer' in ffapdevmain
* test/lisp/ffap-tests.el (ffap-respects-confirm-nonexistent-file-or-buffer): New test. * lisp/ffap.el (ffap-read-file-or-url): Respect `confirm-nonexistent-file-or-buffer'.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/ffap-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el
index 825ed8ba139..6860ac28c45 100644
--- a/test/lisp/ffap-tests.el
+++ b/test/lisp/ffap-tests.el
@@ -311,6 +311,19 @@ End of search list.
(delete-file test-file)
(should (equal (ffap-file-at-point) default-directory)))))
+(ert-deftest ffap-respects-confirm-nonexistent-file-or-buffer ()
+ (let ((default-directory temporary-file-directory)
+ (file1 (make-temp-file "ffap-test-foo1"))
+ (file2 (make-temp-file "ffap-test-foo2")))
+ (minibuffer-with-setup-hook
+ (lambda ()
+ (execute-kbd-macro (kbd "ffap- TAB RET"))
+ (should (equal (expand-file-name "ffap-test-foo") (minibuffer-contents)))
+ (should (equal major-mode 'minibuffer-mode))
+ (delete-file file1)
+ (delete-file file2))
+ (let ((executing-kbd-macro t)) (find-file-at-point)))))
+
(provide 'ffap-tests)
;;; ffap-tests.el ends here