unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: moasenwood--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to make most functions don't modify X CLIPBOARD?
Date: Sat, 16 Jan 2021 22:06:17 +0100	[thread overview]
Message-ID: <87a6t8wq0m.fsf@zoho.eu> (raw)
In-Reply-To: 87turgwxkn.fsf@gmail.com

doltes wrote:

> Thanks to the information provided by Emanuel Berg

Heh, my pleasure...

> I was able to accomplish what I'm requestion by doing.
> If any of you have some feedback, I would appreciate it.
>
> (setq select-enable-clipboard nil)
>
> (defun my/kill-ring-save ()
>   (interactive)
>   (let ((select-enable-clipboard t))
>     (call-interactively 'kill-ring-save)))
>
> (global-set-key (kbd "M-w") 'my/kill-ring-save)

I don't know if it makes sense trying to set up an identical
interface so it can (hopefully) be used transparently?

Perhaps something like this

(setq select-enable-clipboard nil)

(defun kill-ring-save-x (beg end &optional region)
  (interactive (list (mark) (point)
                     (prefix-numeric-value current-prefix-arg) ))
  (let ((select-enable-clipboard t))
    (if (called-interactively-p 'interactive)
        (call-interactively #'kill-ring-save)
      (kill-ring-save beg end region) )))

(global-set-key "\M-w" #'kill-ring-save-x)

?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




  parent reply	other threads:[~2021-01-16 21:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 22:31 How to make most functions don't modify X CLIPBOARD? doltes
2021-01-15 23:13 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-01-16  7:13 ` Eli Zaretskii
2021-01-16 13:59   ` Stefan Monnier
2021-01-16 18:23     ` doltes
2021-01-16 18:32       ` Eli Zaretskii
2021-01-16 21:06       ` moasenwood--- via Users list for the GNU Emacs text editor [this message]
2021-01-16 21:10         ` name change (was: Re: How to make most functions don't modify X CLIPBOARD?) moasenwood--- via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6t8wq0m.fsf@zoho.eu \
    --to=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).