emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 526abad: Fix fallback use of write-file in ido-mode


From: Lars Ingebrigtsen
Subject: master 526abad: Fix fallback use of write-file in ido-mode
Date: Thu, 17 Dec 2020 06:32:42 -0500 (EST)

branch: master
commit 526abadd071e8c2cd67b91c2e282b44e01917fdb
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/ido.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 5758d3f..99241ce 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."
              (read-file-name-function nil))
          (setq this-command (or ido-fallback fallback 'find-file))
          (run-hook-with-args 'ido-before-fallback-functions this-command)
-         (call-interactively this-command)))
+          (if (eq this-command 'write-file)
+              (write-file (read-file-name
+                           "Write file: "
+                           default-directory
+                           (and buffer-file-name
+                                (expand-file-name
+                                 (file-name-nondirectory buffer-file-name)
+                                 default-directory)))
+                          t)
+           (call-interactively this-command))))
 
        ((eq ido-exit 'switch-to-buffer)
        (ido-buffer-internal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]