From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection Date: Thu, 12 Oct 2017 20:46:54 -0400 Message-ID: <87infjc1s1.fsf@users.sourceforge.net> References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507855693 11881 195.159.176.226 (13 Oct 2017 00:48:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Oct 2017 00:48:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 28631@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 13 02:48:10 2017 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 1e2o90-0002Ek-W9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Oct 2017 02:48:07 +0200 Original-Received: from localhost ([::1]:47898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2o98-0000Zg-5j for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Oct 2017 20:48:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2o91-0000ZQ-Kg for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 20:48:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2o8w-0004wh-OC for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 20:48:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56046) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2o8w-0004wd-Iu for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 20:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e2o8w-0001mn-9e for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 20:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Oct 2017 00:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28631 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28631-submit@debbugs.gnu.org id=B28631.15078556256790 (code B ref 28631); Fri, 13 Oct 2017 00:48:02 +0000 Original-Received: (at 28631) by debbugs.gnu.org; 13 Oct 2017 00:47:05 +0000 Original-Received: from localhost ([127.0.0.1]:36494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2o81-0001lR-CF for submit@debbugs.gnu.org; Thu, 12 Oct 2017 20:47:05 -0400 Original-Received: from mail-io0-f172.google.com ([209.85.223.172]:44475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2o7z-0001ky-Hl for 28631@debbugs.gnu.org; Thu, 12 Oct 2017 20:47:03 -0400 Original-Received: by mail-io0-f172.google.com with SMTP id m16so7339565iod.1 for <28631@debbugs.gnu.org>; Thu, 12 Oct 2017 17:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/CNYdooiVLY6AftYtkztKywTB87hJxCSFqmbSGtr+YY=; b=ou2tBFdghp+JcKv/HU+hEIlZsibk6cHPUGr0QJOcIcCqv39wQfo78iawbYjbcJSpNk +BpfP2Qblo5eoxeyDPJImuEafAHcJKJErZAHhZk+5FdIo/gK7uOMTUlfK4l5M5T1skAv TfI7EeE1uiWOJYCDNKsWRwkCXzjsuKQVk/w8JDpXHLFnAVlpnUhjJvUobFSNANO27Q/o LEV82D05eb52hOVF1Z0JIva7Z/7cvYb0w8Aw46rZh5dVlzSaDsC5Owui92DHZQCyyhvw Xve9joAla3RI/07iZAuQPONShga/n/tOk9ic8Ep+KKPd3f0UrPTTpqx906N5mBjFIa6Q wn5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=/CNYdooiVLY6AftYtkztKywTB87hJxCSFqmbSGtr+YY=; b=TBDS4sBz8boQHQvU1MP/XHMKxaoS/HUqOIRVcY6/oPUrOJFLjOrdxmNPo1LnDki7GG ZOTBkypH8GyK2G1ntdBPC7t+mItV3LPOhzR+l7ADwhre/R0VwNkmTFbkG8S0MKDsFLhw 6DXwgtc0SfD5+pkakrWECFg/A7wy4Joh/GAwJhGEWb+hpWlmdGx+BkQ17tWwZx3s3gBZ gy4yr/Q+P/XL5OQ1YfquOeOB1lQ06BalU91cy696F/Ak5Wn/uZfini67zdWwKCI34OJW PRNBmoqVSEup3Opl7HN3CDFaKfhx1C7rbtw7Jsk1f/Brma+FE4GrmZwYWtngsLP1Tyaf g0bg== X-Gm-Message-State: AMCzsaWy1kGJXretDwaByw4C0a4NGtedWFUp8Nrp6IcRRQOukgC8B6XY R+SZFAgmEglwF6EdON9o4RN90w== X-Google-Smtp-Source: AOwi7QACMJQ6u/UM2OEgFzWLW7XO/r5F3mpU07kVD/gT/eNHCFIDzGlcEW3R/0BM7+PBFC4KSlPSvw== X-Received: by 10.107.69.7 with SMTP id s7mr5254966ioa.108.1507855617550; Thu, 12 Oct 2017 17:46:57 -0700 (PDT) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id e34sm5333440ioj.83.2017.10.12.17.46.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 17:46:56 -0700 (PDT) In-Reply-To: <87o9pdaxfo.fsf@gmail.com> (Tino Calancha's message of "Thu, 12 Oct 2017 11:53:47 +0900") 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:138312 Archived-At: Tino Calancha writes: >> C-x o, not C-x 0. > I think is OK. After C-x C-b you are in *scratch* buffer and the window > is splited horizontally. C-x 0 brings you at *Buffer List*. Oops, you're right, I was confused. > Following one works to me > > commit 6e4e47062daf54923928f6db096d4578bcecd6e2 > Author: Tino Calancha > Date: Thu Oct 12 11:41:44 2017 +0900 > > Dont update primary selection with winner-undo > > * lisp/simple.el (deactivate-mark): > Dont update primary selection if deactivate-mark is > called by winner-undo (Bug#28631). > > diff --git a/lisp/simple.el b/lisp/simple.el > index 5ef511ce0a..faedad4675 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -5332,6 +5332,8 @@ deactivate-mark > (if (gui-backend-selection-owner-p 'PRIMARY) > (gui-set-selection 'PRIMARY saved-region-selection)) > (setq saved-region-selection nil)) > + ;; `winner-undo' shouldn't update the selection (Bug#28631). > + ((eq this-command 'winner-undo) nil) > ;; If another program has acquired the selection, region > ;; deactivation should not clobber it (Bug#11772). > ((and (/= (region-beginning) (region-end)) I think I would rather put it with the next condition: --- i/lisp/simple.el +++ w/lisp/simple.el @@ -5336,7 +5336,9 @@ deactivate-mark ;; deactivation should not clobber it (Bug#11772). ((and (/= (region-beginning) (region-end)) (or (gui-backend-selection-owner-p 'PRIMARY) - (null (gui-backend-selection-exists-p 'PRIMARY)))) + (null (gui-backend-selection-exists-p 'PRIMARY))) + ;; `winner-undo' shouldn't update the selection (Bug#28631). + (not (eq this-command 'winner-undo))) (gui-set-selection 'PRIMARY (funcall region-extract-function nil))))) (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382). Either way, I think it's okay to push emacs-26, but wait a bit in case someone else thinks otherwise.