From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephane Chauveau Newsgroups: gmane.emacs.bugs Subject: bug#25145: 25.1; clipboard-yank and associated functions are broken Date: Fri, 9 Dec 2016 14:53:49 +0100 Message-ID: <584AB76D.2080304@nvidia.com> References: <584A6E9D.6080403@nvidia.com> <83pol1gsdm.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481301391 8900 195.159.176.226 (9 Dec 2016 16:36:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Dec 2016 16:36:31 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Cc: 25145@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 09 17:36:23 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFO9l-0000f4-I6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Dec 2016 17:36:21 +0100 Original-Received: from localhost ([::1]:47585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFO9p-0003Ol-HF for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Dec 2016 11:36:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFO5f-0007uO-DK for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 11:32:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFO5a-0007yh-Sh for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 11:32:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFO5a-0007yd-Q2 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 11:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cFO5a-0006Iw-JZ for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 11:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephane Chauveau Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2016 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25145 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25145-submit@debbugs.gnu.org id=B25145.148130107424163 (code B ref 25145); Fri, 09 Dec 2016 16:32:02 +0000 Original-Received: (at 25145) by debbugs.gnu.org; 9 Dec 2016 16:31:14 +0000 Original-Received: from localhost ([127.0.0.1]:36206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFO4m-0006HY-GS for submit@debbugs.gnu.org; Fri, 09 Dec 2016 11:31:12 -0500 Original-Received: from hqemgate16.nvidia.com ([216.228.121.65]:16901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFLe0-0000mS-9t for 25145@debbugs.gnu.org; Fri, 09 Dec 2016 08:55:24 -0500 Original-Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Fri, 09 Dec 2016 05:55:31 -0800 Original-Received: from HQMAIL101.nvidia.com ([172.20.13.39]) by hqnvupgp07.nvidia.com (PGP Universal service); Thu, 08 Dec 2016 17:53:01 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 08 Dec 2016 17:53:01 -0800 Original-Received: from UKMAIL101.nvidia.com (10.26.138.13) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 9 Dec 2016 13:53:57 +0000 Original-Received: from [10.26.11.240] (10.26.11.240) by UKMAIL101.nvidia.com (10.26.138.13) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 9 Dec 2016 13:53:52 +0000 In-Reply-To: <83pol1gsdm.fsf@gnu.org> X-Originating-IP: [10.26.11.240] X-ClientProxiedBy: DRUKMAIL102.nvidia.com (10.25.59.20) To UKMAIL101.nvidia.com (10.26.138.13) X-Mailman-Approved-At: Fri, 09 Dec 2016 11:31:11 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126774 Archived-At: On 12/09/2016 02:10 PM, Eli Zaretskii wrote: >> From: Stephane Chauveau >> Date: Fri, 9 Dec 2016 09:43:09 +0100 >> >> >> I noticed that the functions clipboard-yank, clipboard-kill-ring-save >> and clipboard-kill-region are not accessing the gui clipboard as they >> use to. >> >> In previous version those 3 functions were setting >> x-select-enable-clipbard to enable the clipboard. >> >> They are now setting gui-select-enable-clipboard. >> >> The problem is likely related to the recent renaming of >> x-select-enable-clibboard into select-enable-clipboard (so without a >> gui- prefix). >> >> The variable gui-select-enable-clipboard is set in a few other places >> but, as far as I can tell, it is never used for anything. > Thank you for your report. However, I don't think I understand what > is it that doesn't work in Emacs 25.1 as you expect. What you > describe are simply indications of some redesign and reimplementation > in this area, but the functionality definitely works for me. > > Could you perhaps give a recipe, starting from "emacs -Q", which > reproduces the problems you are seeing, and describe the expected > behavior and the actual one? That would allow us to analyze the > problems you see. Here is the recipe. This involved CLIPBOARD and PRIMARY buffer so on Linux X11 (1) Fill the CLIPBOARD and PRIMARY buffers with their respective name. I use xsel but any other method should do echo -n CLIPBOARD | xsel -b echo -n PRIMARY | xsel -p (2) Using emacs 24.3.1 emacs24 -Q --eval "(progn (setq x-select-enable-clipboard nil) (setq x-select-enable-primary nil) (yank) )" ==> empty window as expected since PRIMARY and CLIPBOARD are both disabled emacs24 -Q --eval "(progn (setq x-select-enable-clipboard nil) (setq x-select-enable-primary nil) (clipboard-yank) )" ==> the content of CLIPBOARD is added to the scratch buffer (3) The same commands using emacs 25.1.1 will always produce an empty window. As I tried to explain in my first email, the problem is that (clipboard-yank) is attempting to enable the clipboard by setting the variable gui-select-enable-clipboard: (defun clipboard-yank () "Insert the clipboard contents, or the last stretch of killed text." (interactive "*") (let ((gui-select-enable-clipboard t)) (yank))) However, this variable does not control the clipboard. The proper variable name is select-enable-clipboard or x-select-enable-clipboard