2

Recently at work (a small academic department, absolutely no Emacs support) we upgraded from Emacs version 21.3.1 to 24.3.

In version 21 marking a region with the mouse will put the highlighted text into the kill-ring. Highlighting another region and yanking would insert the previously highlighted text while saving the recent highlight to the kill-ring. You could continue this "alternating replacing" indefinitely.

I cannot recreate this behavior in version 24 even by changing the .emacs like done in this page: https://www.emacswiki.org/emacs/CopyAndPaste

(setq x-select-enable-primary t)
(setq x-select-enable-clipboard nil)
(delete-selection-mode)

Highlighting the text in version 24 with the mouse seems to just put it into the primary selection but not into the kill-ring until I yank, but then it doesn't produce the inserting alternating text behavior as in version 21, which is desired.

I have also looked into this page https://www.emacswiki.org/emacs/Comments_on_CopyAndPaste but there are many proposed solution and I haven't had the time to see which one would approximate the above mentioned behavior.

Many thanks for your help.

  • 3
    Have you looked at the etc/NEWS file (i.e. C-h N) which describes this change (along with sample code to try and reproduce the previous behavior)? – Stefan Sep 12 '16 at 20:12
  • Hi @Stefan, I checked the news as you told me and there was much more detail on how to change to a previous behavior than the Emacs Wiki pages, so thank you so much for that!! Highlighting text with mouse will now put it in the kill-ring, ready to be yanked. There is small issue. I can mimic the described behavior by highlighting a word, highlighting another word then doing C-y (yank) followed by M-y (yank-pop). So one more keystroke. The original behavior would do either yank or yank-pop on just C-y depending if there was a region marked or not. Clues how to do this in the new version? – Jorge T Leon Sep 13 '16 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.