diff options
| author | Charles A. Roelli <charles@aurox.ch> | 2026-05-28 13:28:53 +0000 |
|---|---|---|
| committer | Charles A. Roelli <charles@aurox.ch> | 2026-06-04 12:26:15 +0200 |
| commit | a2e7b68764381e0880d55f71ef1d39cff73f950c (patch) | |
| tree | faf22629e1188b91132e9ecd140dd43447a1eb13 /lisp/ffap.el | |
| parent | aa6acc69edb64eb962beb074c065c7b44c194da7 (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 'lisp/ffap.el')
| -rw-r--r-- | lisp/ffap.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el index 2e88adfaf4a..7e716f7be2b 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1618,7 +1618,8 @@ which may actually result in an URL rather than a filename." ;; allows you to switch back to reading a file name, ;; while other prompters, like ido, really expect a ;; file, and don't allow you to edit it if it's an URL. - (funcall #'read-file-name-default prompt guess guess) + (funcall #'read-file-name-default prompt guess guess + (confirm-nonexistent-file-or-buffer)) (unless guess (setq guess default-directory)) (unless (ffap-file-remote-p guess) @@ -1629,7 +1630,9 @@ which may actually result in an URL rather than a filename." #'read-directory-name #'read-file-name) prompt - (file-name-directory guess) nil nil + (file-name-directory guess) + nil + (confirm-nonexistent-file-or-buffer) (file-name-nondirectory guess)))) ;; Remove the special handler manually. We used to just let-bind ;; file-name-handler-alist to preserve its value, but that caused |
