From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: doltes Newsgroups: gmane.emacs.help Subject: Re: How to make most functions don't modify X CLIPBOARD? Date: Sat, 16 Jan 2021 13:23:04 -0500 Message-ID: <87turgwxkn.fsf@gmail.com> References: <87im7xkf2q.fsf@gmail.com> <83czy59wwd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34685"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.14; emacs 27.1 Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 16 19:27:34 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0qIP-0008w2-V2 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 16 Jan 2021 19:27:33 +0100 Original-Received: from localhost ([::1]:34446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0qIP-0001VW-1M for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 16 Jan 2021 13:27:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0qHx-0001Tl-S5 for help-gnu-emacs@gnu.org; Sat, 16 Jan 2021 13:27:05 -0500 Original-Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:37615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0qHw-0003SY-7v for help-gnu-emacs@gnu.org; Sat, 16 Jan 2021 13:27:05 -0500 Original-Received: by mail-qk1-x72e.google.com with SMTP id h4so15065575qkk.4 for ; Sat, 16 Jan 2021 10:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=w5I5mzXjpaDaw+Ye0PPHXqhSDglPIMeQcfs0RDjnAX8=; b=Ld7IsVNR9Tu1hSFLMYi1UrDUX3hJ4X7XzOPvPQCuulno640tCM5pwjuMggxZWKh0u5 rJHcLOBaxajLqgWHme41gdMPlTKeNtsHnqM/fblkCdjF/McZlaNSC4L97PZ0ajMwjZIe PUNF8qV6W1Y8BTpDpedtzTYM2jksNjToS2xll6xaWRESMza3E4IYOHRdd/6EPMptjsO/ kvDPR2ofCaeLtrLRF2BJenwW4Lsyh0Wgz9mD7eTnwRiozEj5MYKWkH+gUqEbpyHIBHgd nPSfLKNQXFw5dxpGuFM1NiRh3zJyB4KHNVKkrbRHZlCnTu4PA3WWJrH7dxbfJbpXPrt7 akfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=w5I5mzXjpaDaw+Ye0PPHXqhSDglPIMeQcfs0RDjnAX8=; b=grKwtIZra3lOSRNfjitSOL60wA4t511MBqTW58FqSc0SENaAv5tmyq8ip7JrYDZi96 VTnwuZ5eCE8yjZKpRpN73qXvDyW2BE9rkRnuvjzk0yMhvwkBmdtsks7eOKlkM6iQKZBy 52tt0cKVhaxGIr3Rbm8ryzTP0QtUW5NlwzEi8WasHtJ1yvACtK+r/vEi7FmjpZxjXznu zBF7q3L7IXCzvtditizDU9UyCLXJgEqR8AcjxqM3/5SNWE13adMUPfdZPZpqABYxe5S5 uEL9FDXURx2ik7II2zaSwnqqo0uAd2LjqV6v4NmYKiaAQbzz7vvkATPxHgS2wkdnrgUW oHgQ== X-Gm-Message-State: AOAM533nh9W02CM7u2bMDEhRyc/92b52oEUGAFV8iaUWuVwmZhzQtwvu 8OHeKvkH+E0oZhGV4+LgMsV1ckIM6gg= X-Google-Smtp-Source: ABdhPJzA5iCevfeTNNtuMZO4Miw0qpGi9VJVCXe1+t2l8Mjv+1yrHjF8sKyqYjb/5nkKZsMtLCfLjw== X-Received: by 2002:a37:597:: with SMTP id 145mr18107509qkf.386.1610821623019; Sat, 16 Jan 2021 10:27:03 -0800 (PST) Original-Received: from r1 ([190.239.232.181]) by smtp.gmail.com with ESMTPSA id k7sm7031404qtg.65.2021.01.16.10.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 10:27:02 -0800 (PST) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=doltes512@gmail.com; helo=mail-qk1-x72e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127277 Archived-At: Stefan Monnier writes: >> You want to avoid copying only to the X clipboard, or also to the X >> selection? >> >> Depending on the answer, either change the value of >> select-enable-clipboard or of interprogram-cut-function. > > Or `select-enable-primary`, of course. > > > Stefan I tried setting "select-enable-clipboard" to "t". However, that made all the mentioned functions, even "kill-ring-save" (M-w), not to modify the X CLIPBOARD (i.e. a.k.a. "XA_CLIPBOARD" in the "xclip" manual page). Note that what I'm requesting is that the only function I want to be able to modify the X CLIPBOARD is "kill-ring-save" (M-w). Thanks to the information provided by Emanuel Berg, 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) ``` Regarding the other variables mentioned, I looked into them but they didn't help because + "interprogram-cut-function" only defines the function which is called for cutting. + "select-enable-primary" only defines whether the killed content should be inserted into the PRIMARY clipboard. Thanks for the help, everyone!