0

In Windows 7 / Emacs 24.5

  1. Copy text e.g. "example" in the kill-ring
  2. M-x
  3. C-y (yank)
  4. Success show text "example" in the minibuffer

But if turn on CUA-mode, the text "example" not yank (paste) by 'C-v' in the minibuffer.

Alexei
  • 14,350
  • 37
  • 121
  • 240

1 Answers1

0

CUA mode makes C-v the yank/paste command.

If you start Emacs with :

emacs -Q

Then turn on CUA mode (M-x cua-mode) you'll see that C-v works as you expect.

Without knowing your setup it's difficult to be sure but it's likely you're using a package which modifies the behavior of M-x (E.g. smex, Ido, ivy, etc.)

It's likely CUA mode won't really have anything to do with this problem. You can verify this by trying to do C-y to yank in the minibuffer too.

Packages which enhance M-x may provide a way to allow you to drop out temporarily, so you can yank text in-place.

Update

From your comments we know you are using Helm, which overrides some bindings in the minibuffer, including C-v which is bound to page down.

Because bindings are applied at different mode (context) scopes, the minibuffer modemap (list of key bindings) will override anything that's applied at a more general context (such as cua mode)

To work around this you'd need to add a binding specifically for cua-paste in the affected mode map. It would need to be applied after Helm has loaded.

ocodo
  • 29,401
  • 18
  • 105
  • 117
  • My apologies I misread your original key command as `C-y` (both would work BTW). I've updated my answer for you. – ocodo Jan 29 '17 at 01:16
  • my binding: (global-set-key (kbd "M-x") 'helm-M-x) – Alexei Jan 29 '17 at 12:54
  • That's why you have a problem, `Helm-M-x` overrides the cua-mode binding of `C-v`, and rebinds it to page down. You'll have to use `C-y` or modify the helm key map. – ocodo Jan 29 '17 at 15:24