aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-12-17 12:32:29 +0100
committerLars Ingebrigtsen2020-12-17 12:32:36 +0100
commit526abadd071e8c2cd67b91c2e282b44e01917fdb (patch)
treec36bb95b8d91431a5373e3429abc84e4293dae24
parent7fad9591142f9d9d0bfce37dd8c65a847dbe8aa9 (diff)
downloademacs-526abadd071e8c2cd67b91c2e282b44e01917fdb.tar.gz
emacs-526abadd071e8c2cd67b91c2e282b44e01917fdb.zip
Fix fallback use of write-file in ido-mode
* lisp/ido.el (ido-file-internal): Make `write-file' respect the directory we've navigated to (bug#28513).
-rw-r--r--lisp/ido.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index 5758d3fdeac..99241ce1a3a 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2367,7 +2367,16 @@ If cursor is not at the end of the user input, move to end of input."
2367 (read-file-name-function nil)) 2367 (read-file-name-function nil))
2368 (setq this-command (or ido-fallback fallback 'find-file)) 2368 (setq this-command (or ido-fallback fallback 'find-file))
2369 (run-hook-with-args 'ido-before-fallback-functions this-command) 2369 (run-hook-with-args 'ido-before-fallback-functions this-command)
2370 (call-interactively this-command))) 2370 (if (eq this-command 'write-file)
2371 (write-file (read-file-name
2372 "Write file: "
2373 default-directory
2374 (and buffer-file-name
2375 (expand-file-name
2376 (file-name-nondirectory buffer-file-name)
2377 default-directory)))
2378 t)
2379 (call-interactively this-command))))
2371 2380
2372 ((eq ido-exit 'switch-to-buffer) 2381 ((eq ido-exit 'switch-to-buffer)
2373 (ido-buffer-internal 2382 (ido-buffer-internal