[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28513: 25.1; ido insists on guessing the wrong directory
From: |
Lars Ingebrigtsen |
Subject: |
bug#28513: 25.1; ido insists on guessing the wrong directory |
Date: |
Sun, 13 Dec 2020 14:12:01 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 12.12.2020 14:10, Lars Ingebrigtsen wrote:
>> I don't use ido-mode for files normally -- are there any ido users here
>> that do? If so, does this seem like expected behaviour to you?
>
> Looks like a bug, yes.
>
> The scenario looks pretty specific, though, that's probably why it
> hasn't come up before.
I have a slightly simpler reproduction case:
emacs -Q -f ido-mode lisp/abbrev.el
C-x C-w RET C-f RET
This should write the file to calc/abbrev.el, but prompts for
overwriting.
Here's the backtrace with debug-on-quit:
Debugger entered--Lisp error: (quit)
read-from-minibuffer("File ‘~/src/emacs/trunk/lisp/abbrev.el’ exists; ov.
y-or-n-p("File ‘~/src/emacs/trunk/lisp/abbrev.el’ exists; ov...")
write-file("~/src/emacs/trunk/lisp/abbrev.el" t)
funcall-interactively(write-file "~/src/emacs/trunk/lisp/abbrev.el" t)
call-interactively(write-file)
ido-file-internal(write write-file nil "Write file: " nil nil ignore)
ido-write-file()
I was momentarily puzzled about why that call-interactively to
write-file didn't re-prompt about the location, but:
((eq ido-exit 'fallback)
;; Need to guard setting of default-directory here, since
;; we don't want to change directory of current buffer.
(let ((default-directory ido-current-directory)
(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)))
So hitting `C-f' makes ido go into `fallback' mode? Yes!
(define-key map "\C-f" 'ido-magic-forward-char)
(defun ido-magic-forward-char (arg)
"Move forward in user input or perform magic action.
If no user input is present, or at end of input, perform magic actions:
C-x C-b ... C-f switch to `ido-find-file'.
C-x C-f ... C-f fallback to non-Ido `find-file'.
C-x C-d ... C-f fallback to non-Ido brief `dired'.
C-x d ... C-f fallback to non-Ido `dired'."
(interactive "P")
(cond
((or arg (not (eobp)))
(forward-char (min (prefix-numeric-value arg)
(- (point-max) (point)))))
((memq ido-cur-item '(file dir))
(ido-fallback-command))
So... this is apparently a feature? Hitting `C-f' disables ido and
calls the fallback command, which is `write-region' in this case.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#28513: 25.1; ido insists on guessing the wrong directory, Lars Ingebrigtsen, 2020/12/12
- bug#28513: 25.1; ido insists on guessing the wrong directory, Dmitry Gutov, 2020/12/12
- bug#28513: 25.1; ido insists on guessing the wrong directory,
Lars Ingebrigtsen <=
- bug#28513: 25.1; ido insists on guessing the wrong directory, Dmitry Gutov, 2020/12/13
- bug#28513: 25.1; ido insists on guessing the wrong directory, Lars Ingebrigtsen, 2020/12/14
- bug#28513: 25.1; ido insists on guessing the wrong directory, Dmitry Gutov, 2020/12/14
- bug#28513: 25.1; ido insists on guessing the wrong directory, Lars Ingebrigtsen, 2020/12/15
- bug#28513: 25.1; ido insists on guessing the wrong directory, Lars Ingebrigtsen, 2020/12/17
- bug#28513: 25.1; ido insists on guessing the wrong directory, Dmitry Gutov, 2020/12/17