3

I updated to 25.1 and found that copy/paste works differently.

For example when I select a word "visit" and try to replace this word with [shift insert], text in clipboard is inserted in the beginning of the selection, instead of replacing it.

enter image description here

When I select visit and type text, visit is replaced as expected.

I have enabled delete selection and transient mark modes, it worked well in 24.5.

Do you know how to fix it?

Stepan S
  • 65
  • 11
  • Works for me on Emacs 25.1 started with `emacs -q -nw` in gnome-terminal on RHEL 7. – nispio Oct 04 '16 at 15:07
  • From the sound of it, there might be a bug. Try to provide a step-by-step recipe, starting with `emacs -Q`, and send it to `M-x report-emacs-bug`. (If you cannot come up with such a recipe from `emacs -Q` then bisect your init file to find out what is causing the problem.) – Drew Oct 04 '16 at 17:16
  • Thanks. I run CentOS 7.2. Has just deleted old emacs, support folder, and init file. Downloaded sources and made emacs from a scratch. Insert still does not replace text. Will try to report bug – Stepan S Oct 05 '16 at 09:27

3 Answers3

3

Finally I found a fix for the problem on emacswiki

(setq x-select-enable-primary t)
(setq select-enable-primary t)
(setq mouse-drag-copy-region t)

Quick tip: if you’re here looking to fix the fact that in Emacs shift-insert no longer pastes that text you highlighted with the mouse in your browser, the 2014 answer is to set x-select-enable-primary to true, and set mouse-drag-copy-region to true to go the other way - I can’t imagine why this excellent default was changed but it’s very hard to find the answer in the verbiage below.

But this works only for emacs installed from sources github/emacs-mirror, not 25.1

I also found that it depends on terminal. xterm fails, while vt100 works good

Stepan S
  • 65
  • 11
0

I had the same problem, and found (setq select-enable-primary t) makes the situation. I have sent it to M-x report-emacs-bug.

0

I just put (delete-selection-mode 1) in my .spacemacs file but I'm sure you can also put it in init.el

Source: https://www.emacswiki.org/emacs/DeleteSelectionMode

Then saved C-x C-s and reloaded/refreshed, on spacemacs that's SPC f e R there are many other ways to do it: https://stackoverflow.com/questions/2580650/how-can-i-reload-emacs-after-changing-it has a long and interesting (to me) discussion, I think M-: would be my favorite answer however it wasn't working for me so I went with my tried and true SPC f e R

Interesting fact: with this delete-selection-mode, to undo, takes 2 actions! I have to C-/ twice to get my original text back.

Very interesting: once you set (delete-selection-mode 1) if you just delete that line in the config and reload, the setting will still be there, you have to (delete-selection-mode 0) to recreate the original behavior.