Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:23:10+00:00 2026-06-05T15:23:10+00:00

I use emacs 24 (OSX) and have a problem with shift-selection. If I select

  • 0

I use emacs 24 (OSX) and have a problem with shift-selection.
If I select a region with my mouse, the text is highlighted and automaticaly saved on to the kill ring (I can yank it immediately).
With shift-selection, the text is highlighted but I have to manualy save the text (M-w) to be able to yank it.
Is there any way that shift-selection hightlights the text AND saves it onto the kill ring ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:23:12+00:00Added an answer on June 5, 2026 at 3:23 pm

    Selecting text with the mouse does not place anything onto the kill ring by default (it copies it to the X clipboard).

    There are various ways in which you can customise how Emacs interacts with the clipboard. See:

    C-hig (emacs) Cut and Paste RET

    Is there any way that shift-selection hightlights the text AND saves it onto the kill ring ?

    I’m not sure that there’s any way to detect that you’ve stopped selecting things, but you could perhaps advise handle-shift-selection to set a temporary post-command-hook to run a custom function to place the region in the clipboard (and remove the post-command-hook).

    Edit: Hang on, what you describe is exactly what happens for me in Emacs 24.1 on Ubuntu.

    If I shift-select some text in Emacs and then middle-click the mouse in any application, I paste the selected text.

    Try testing when running emacs -Q

    Edit 2: Ah, but you didn’t mean the mouse, did you?

    How about this?

    (defvar my-shift-selection-in-progress nil)
    (make-variable-buffer-local 'my-shift-selection-in-progress)
    
    (defadvice handle-shift-selection
      (before my-shift-selection-to-kill-ring-advice)
      "Automatically copy shift-selected text to the kill ring.
    
    If `interprogram-cut-function' is non-nil, also save the text for a window
    system cut and paste.
    
    See `my-shift-selection-to-kill-ring'."
      (when (and shift-select-mode
                 this-command-keys-shift-translated
                 (not my-shift-selection-in-progress))
        (add-hook 'post-command-hook 'my-shift-selection-to-kill-ring nil t)))
    
    (ad-activate 'handle-shift-selection)
    
    (defun my-shift-selection-to-kill-ring ()
      "Post-command callback for my-shift-selection-to-kill-ring-advice."
      (if this-command-keys-shift-translated
          (kill-new (filter-buffer-substring (region-beginning) (region-end))
                    my-shift-selection-in-progress)
        (remove-hook 'post-command-hook 'my-shift-selection-to-kill-ring t))
      (setq my-shift-selection-in-progress this-command-keys-shift-translated))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using OSX snow leopard, for the record. When I use emacs straight from
I'm trying to set up emacs 24 to use with clojure on osx. I've
I'm trying to use emacs in fullscreen mode with a decent font. I have
I have been learning to use Emacs for a little while now. So far
Here's my problem: I use Emacs and get lots of buffers that are pretty
I use emacs for viewing and editing code and other text files. I wanted
I use emacs for text editing and script development. I use both windows and
I would like to use Emacs to edit two columns of text side by
I'm using emacs.app 23.1.1 on OsX and trying to use git within a shell
I use emacs in ubuntu 12.04. i want define some background or foreground in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.