From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Duncan Findlay Newsgroups: gmane.emacs.devel Subject: Re: Set X primary selection with Emacs in xterm Date: Thu, 9 Jun 2022 22:49:18 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3490"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 10 08:49:41 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nzYSg-0000e3-R6 for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Jun 2022 08:49:38 +0200 Original-Received: from localhost ([::1]:37468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzYSf-0000iR-5l for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Jun 2022 02:49:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzXX9-000661-M2 for emacs-devel@gnu.org; Fri, 10 Jun 2022 01:50:11 -0400 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:46915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzXX6-0003rW-18 for emacs-devel@gnu.org; Fri, 10 Jun 2022 01:50:11 -0400 Original-Received: by mail-wm1-x329.google.com with SMTP id r123-20020a1c2b81000000b0039c1439c33cso529603wmr.5 for ; Thu, 09 Jun 2022 22:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=f69LhX6Zx3M7iav4p0GJIMVJzSfco9zc+aVfIFe98oA=; b=lhd7wiyro9KImQmuZouPWEFT5DGcsrdnLNtef86a7NhfkDak590jpkaH75+ZX03XAA nQ0qdQAgXEBbfT3XV+xPWdTeCnnY32Sp8h8/R/Xu+FSTcdWe8Cg//sWl5IFml9g1n8Zg 8mHjZaAGfe7DcdsVpCv8a31l8UK5ZFCgXOJD9Y3geNGE+8WnBJzN1CB9goCzsVUj0yuC bNOQJZtVyHEywGJ4wQfCxlSZeg2ViHJ4gU5RLiu1FhQNvzhyGK2/19Jk7sgwuylFjwXt M820k2izHZX6uziNrJDMIHzsPr1RxZBW6sehoJey2NdGD7ZRNOT7+RK9uZEXfE7lCVMF VbpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=f69LhX6Zx3M7iav4p0GJIMVJzSfco9zc+aVfIFe98oA=; b=ob+iYogCoBrBKip4R//Ds7AVlr2lbnWymkXWO/RVZ2mDKBtI5nfH0plloOGnKPJmxS 3p3bL2AXX3/nKa4D9OEJIRv1mZD10Xvu06XH3bvvxHEbsB3a+pOo12e4TvrdckZLHht4 1wDExbpd5HcvIFsIhetzjinMxzYpxPSySrr4/6dZIJu1qsFlQAxpbMoYGi/kguaNhgGl Rq04ufmd+4OBfR4xGHdbIAXzfBXC73VNX4n7lU5DZXhGOx/KWHrHs1B/F+nvn/1leLld vUi1HOFAdz5+xPyyAVWDopjcSTEaiFPlcC3rqe7pXgniDaTkaYr2Fe+PyvFgpIZkXQFy C2/Q== X-Gm-Message-State: AOAM530VS/JUHb6mAShG6CVjzF1ktBusb9YFN423BUSMAfjb2J0ImcGI JGE+K3cnosWIEOwLNkBh8uTyCk0h3y/+xCILelKFz9dfuQU= X-Google-Smtp-Source: ABdhPJz1ZJyv1D7Qiclr4+kGs7gir+IsmMAs3zcFe78/PqD5lMHr8Yz8Os1OaRcyE3ugqGXGFBZ5DTAz2q0UN0oxgAk= X-Received: by 2002:a7b:cd16:0:b0:39c:4fff:88cc with SMTP id f22-20020a7bcd16000000b0039c4fff88ccmr6736473wmj.122.1654840197473; Thu, 09 Jun 2022 22:49:57 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=duncf@google.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 10 Jun 2022 02:42:05 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290988 Archived-At: On Mon, Jun 6, 2022 at 7:39 AM Jean Louis wrote: > > * Duncan Findlay [2022-06-03 08:24]: > > I frequently use Emacs over ssh and I'd really like to get both > > primary and clipboard selections to work as close as possible to > > running Emacs on X natively. I'd like to kill text in Emacs and have > > that show up in my system clipboard so I can paste into other > > applications. > > I have these settings and it works for me exactly how you explained > above. > > (setq select-enable-clipboard t) > (setq select-enable-primary t) As I understand it, this configuration will cause killed text to be put in both your clipboard and primary selection buffers. I suppose that technically meets the criteria I outlined above -- it should work identically over ssh and on X natively, but it's not quite what I meant. > > Similarly, if I select text with mark and keyboard (or mouse with > > xterm-mouse-mode), I'd like it to update my local X's primary > > selection so I can middle-click to paste it elsewhere. I have two > > patches attached that got this working for me. > > For me your explained situation works without patches. I have the > above settings. But I may miss something as you mention > xterm-mouse-mode which I am not even using it ever. On my side it > works. Sorry, I should have been more precise. I would like the primary selection to be updated with the contents of the region, as described here: https://www.gnu.org/software/emacs/manual/html_node/emacs/Primary-Selection.html This requires `select-active-regions' to be non-nil. Do you have this set in your configuration? Thanks Duncan