{{ message }}

# dired-do-flagged-delete confirmation is not shown in minibuffer when using counsel#1660

Closed
opened this issue Jul 10, 2018 · 10 comments
Closed

# dired-do-flagged-delete confirmation is not shown in minibuffer when using counsel#1660

opened this issue Jul 10, 2018 · 10 comments

### bbo2adwuff commented Jul 10, 2018 • edited

 When flagging a file for deletion in dired and call dired-do-flagged-delete then I expect to see the message to confirm the deletion (yes or no). Instead I see following in the minibuffer: I can type just anything (and see the results in the minibuffer appearing) but after clicking ENTER I see in the last line Please answer yes or no. My ivy setup looks like this (ivy-mode t) (setq enable-recursive-minibuffers t) (setq ivy-use-virtual-buffers t) (setq ivy-virtual-abbreviate 'full) (setq ivy-initial-inputs-alist nil) (setq ivy-use-selectable-prompt t) (counsel-mode t) (counsel-projectile-mode t) (setq counsel-find-file-at-point t) (setq counsel-projectile-grep-initial-input (quote (quote (ivy-thing-at-point)))) (define-key global-map [remap find-file] 'counsel-find-file) (define-key global-map [remap isearch-forward] 'swiper) (define-key global-map (kbd "C-c C-f") 'counsel-file-jump) (setq ivy-re-builders-alist '((t . ivy--regex-ignore-order)))  Problem persists when I comment everything out except of (ivy-mode t). The text was updated successfully, but these errors were encountered:

### bbo2adwuff commented Jul 10, 2018

 Just realized when opening emacs without the .emacs.desktop file then the issue is gone. Afterwards when opening emacs with the very same .emacs.desktop file again the issue doesn't appear again. But when working in emacs the issue occurs again and can again be resolved by starting emacs without the desktop file and then start it with the desktop file again. Well, kind of a work around.

### basil-conto commented Jul 10, 2018 • edited

 Can't reproduce here with any version of Emacs between 24-27, but then I don't use desktop.el. I mainly wanted to point out that major and minor mode functions are almost always documented as accepting a single optional argument which is either nil, a number, or the symbol toggle. So I would recommend you write (ivy-mode) or (ivy-mode 1), etc. for enabling, and (ivy-mode 0) or (ivy-mode -1), etc. for disabling, even if it often doesn't make a difference in practice.

### basil-conto commented Jul 10, 2018

 The nested quotes for counsel-projectile-grep-initial-input also seem a bit unusual.

### bbo2adwuff commented Jul 11, 2018 • edited

 Thank you for your quick replies! Oh the nested quote was not on purpose. I didn't even realize that I put two quotes 😖 I use the numbers for the modes now. But as you already expected, it doesn't seem to make a difference in practice. Before I was not sure how to reproduce, but now I found it: Open emacs. Open dired (not in a project though). Select file for deletion. Result: Minibuffer as expected (i.e. confirmation prompt). Switch to buffer with a Rnw file of any project. Switch back to dired buffer. Select file for deletion. Result: Counsel's Switch to buffer in minibuffer. Issue persists restarts when using desktop-save-mode. The only workaround that I found so far is to start without the desktop file, then repeat steps 1-3. As the issue only occurs when opening Rnw files I guess it might be due to ess. When not loading ess and then visiting Rnw files, then the issue does not occur.

### abo-abo commented Jul 11, 2018

 @bbo2adwuff That's quite a lot of custom config to reproduce the bug. I'm not sure I can do it easily on my machine. I suggest you edebug ivy-completing-read and see what is happening.

### bbo2adwuff commented Jul 17, 2018 • edited

 Sorry I was away for some days. edebug ivy-completing-read didn't return anything useful. But I realized that I made it much more complicated than it is. How to reproduce: Open emacs with following init file (depends on your ess and ivy version installed): (add-to-list 'load-path "~/.emacs.d/elpa/ess-20180708.601/") (add-to-list 'load-path "~/.emacs.d/elpa/ivy-20180705.807/") (require 'package) (require 'ess) (require 'ivy) (ivy-mode 1) Open just any Rnw file. (You can, for example, following as text.Rnw and open it in emacs): \documentclass{article} \begin{document} <>= 1 + 1 @ \end{document} Try anything with a dialog in minibuffer. For example, dired-do-flagged-delete, rgrep, etc. Then you don't see the expected dialog in the minibuffer, but the ivy dialog.

### abo-abo commented Jul 17, 2018

 OK, after a long debug session I've traced the bug to ess-noweb-mode: (mapc 'ess-noweb-make-variable-permanent-local '(ess-noweb-mode ess-local-process-name ;; also made permanent in ess-mode, but let it be ess-dialect ess-language after-change-functions before-change-functions ess-noweb-narrowing ess-noweb-chunk-vector post-command-hook isearch-mode-hook isearch-mode-end-hook ess-noweb-doc-mode ess-noweb-code-mode ess-noweb-default-code-mode ess-noweb-last-chunk-index)) So what they do here is modify many built-in variables that weren't meant to be permanent buffer-local. Specifically post-command-hook - this breaks Ivy. I think this is a major bug in ESS since they change the behavior of whole Emacs just for purpose of a major-mode. Since you're a user of ESS, please report the bug there. I'll make a temporary fix in Ivy.

closed this in  6137754  Jul 17, 2018
mentioned this issue Jul 17, 2018

### bbo2adwuff commented Jul 17, 2018

 Perfect! Thanks a lot!

### lionel- commented Jul 17, 2018

 Sorry about that painful debug session @abo-abo. We're slowly modernising the codebase and some parts of ESS no longer have active maintainers unfortunately.

### abo-abo commented Jul 17, 2018

 @lionel- No problem, and good luck.