From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 28 04:03:14 2017 Received: (at submit) by debbugs.gnu.org; 28 Sep 2017 08:03:15 +0000 Received: from localhost ([127.0.0.1]:35866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxTmq-0004N9-Rw for submit@debbugs.gnu.org; Thu, 28 Sep 2017 04:03:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxTmo-0004Mv-2r for submit@debbugs.gnu.org; Thu, 28 Sep 2017 04:03:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxTmh-0008TA-J1 for submit@debbugs.gnu.org; Thu, 28 Sep 2017 04:03:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53357) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxTmh-0008T4-Fr for submit@debbugs.gnu.org; Thu, 28 Sep 2017 04:03:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxTmc-0001YK-5R for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2017 04:03:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxTmX-0008OW-79 for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2017 04:02:58 -0400 Received: from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a]:48335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dxTmW-0008Nd-TI for bug-gnu-emacs@gnu.org; Thu, 28 Sep 2017 04:02:53 -0400 Received: by mail-pg0-x22a.google.com with SMTP id v23so523556pgc.5 for ; Thu, 28 Sep 2017 01:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=FbuLsP+9mgDz+RoQ32Tl5bUI2Z/ABUUXE43Y/TGjoGM=; b=vc3Gm4+dhCgvD2v/z6tMFdk/z8TcIYfLyTGnq4vPN68L05Bm+90Wqbu2kU4r3bQ2qD W5f/4QDXkXNTO3BDmAmD/oI5gHZ2kDqeQMGwgLOZaKLPc3iFNpEH2CO2KtCSgxc5YGz2 J01i9bl6YLsMVOvJB878vUqb+bjRnvKKNGQFAUTPw7j81CWG4h3ZPzp0G7sZBLDUYjtk 1EVUgkoPDdQ6yFRn03kPC0E3dWq9PKHIU+8WfKWgfj+lksePVE0a6EcRWRrsC7we1Qe1 gx9OwRE/Owk/qKlKfg22lyKbLK69NqWh21qf0w9b4S21KMjNHRh6L1sAPXVNbZWtGkMs 2DdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=FbuLsP+9mgDz+RoQ32Tl5bUI2Z/ABUUXE43Y/TGjoGM=; b=lXzVVJIBXp2J9Lki2mHtIOn3XBkv8qd5aw4UvRabkXqsiFQiLBxQxhUMzc4GCf4KVB 4pA1UfnosWklH0HnrO46QoOkHaZbFoParkbAzLinwTMklGxqt6iS3ZHYgsAjgZX2k9eP M6w+gX1cAhpRn5TT3iWfnBBshwCJ7BYHAQBUkqknHnEp8AZtGT1C993uFuEr1O5NYpVE gXukkpwYoSyz36E/pu1Mtu/HoKEp/9iXIUKTe6XrfmMXlc+br+y5hv+RFS8I509FWdpZ miVBj2P5AzQ5Sj7NSRi3atngV7GEJFBOI9TsqmvZ2haKhU9jTY7fXKDH9FSYdbaPzi3x II5w== X-Gm-Message-State: AHPjjUhm3cz4uHn5aVVGmcVRrJLT+0wWcAWw6vkGNo3bbAPCAnEyIQzP jZxeFxq3DJXkN2Y+Rkq5/asKvQ== X-Google-Smtp-Source: AOwi7QDvTxFZA0lJIkjcbwoegrWhxUXSOOeG88lS6k4zGahJ2E6dWT/cTmGNlxA/T9h4ZYInBDFpMQ== X-Received: by 10.99.177.74 with SMTP id g10mr3566915pgp.326.1506585770065; Thu, 28 Sep 2017 01:02:50 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id 65sm1726275pgh.31.2017.09.28.01.02.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Sep 2017 01:02:49 -0700 (PDT) From: Tino Calancha To: bug-gnu-emacs@gnu.org Subject: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection Date: Thu, 28 Sep 2017 17:02:39 +0900 Message-ID: <87ing3w8rk.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Tags: patch I am biten by this problem from time to time. When winer-mode is enabled and i deactivate the mark with C-g, then i observe funny behaviour with `yank'. Usually i visit another buffer BUF-B to copy a string STR; then i do `winner-undo' to comeback to the initial buffer, BUF-A, and `yank' STR. Sometimes i found that `yank' insert a string different than STR. That's happen if i previously deactivated the mark in BUF-A with C-g. To reproduce the problem: emacs -Q -eval '(winner-mode 1)' \ -eval "(customize-set-variable 'select-enable-clipboard nil)" \ -eval "(customize-set-variable 'select-enable-primary t)" < C-TAB M-f M-f ; `yank' would insert ";; This buffer" C-x C-b C-x 0 C-x h ; mark whole buffer ;; `yank' would insert the content of *Buffer List* C-g RET ; `yank' would insert ";; This buffer" C-c ; winner-undo ;; `yank' would insert the content of *Buffer List* Note that the primary selection doesn't change if you visit *Buffer List* with C-x b RET. That is, if you change above C-c by: C-x b RET then, the `yank' will insert ";;This buffer". I don't see a good reason why visiting a buffer with `C-x b' or `winner-undo' makes a difference in the primary selection. How about the following patch? --8<-----------------------------cut here---------------start------------->8--- commit 74e5a589b762388baadbb2ac2f146bbe66765deb Author: Tino Calancha Date: Thu Sep 28 16:34:52 2017 +0900 Set mark at point after keyboard-quit * lisp/simple.el (deactivate-mark): In transient-mark-mode always set the mark at point after keyboard-quit (Bug#28631). diff --git a/lisp/simple.el b/lisp/simple.el index 469557713d..1f809d8964 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5349,6 +5349,11 @@ deactivate-mark (kill-local-variable 'transient-mark-mode))) (setq mark-active nil) (run-hooks 'deactivate-mark-hook) + ;; Set mark at point after `keyboard-quit' (Bug#28631). + (when (and transient-mark-mode + (eq this-command 'keyboard-quit) + (/= (mark 'force) (point))) + (push-mark nil 'nomsg)) (redisplay--update-region-highlight (selected-window)))) (defun activate-mark (&optional no-tmm) --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-28 Repository revision: 1f02ae39310f15bf683642b9aee1cf162bd391e6 In GNU Emacs 25.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-20 built on calancha-pc Repository revision: c3ff6712ad24fcf45874dc0665a8606e9b2208a4 Windowing system distributor 'The X.Org Foundation', version 11.0.11902000 System Description: Debian GNU/Linux 9.1 (stretch) Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Buffer Menu Minor modes in effect: winner-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set [4 times] Quit Winner undo (1 / 4) Quit Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode mail-prsvr mail-utils cus-edit easymenu cus-start cus-load wid-edit cl-loaddefs pcase cl-lib winner ring time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 104842 3683) (symbols 48 21319 0) (miscs 40 108 146) (strings 32 17876 5250) (string-bytes 1 487777) (vectors 16 12687) (vector-slots 8 439460 5000) (floats 8 174 21) (intervals 56 281 10) (buffers 976 20)) From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 20:52:45 2017 Received: (at 28631) by debbugs.gnu.org; 12 Oct 2017 00:52:46 +0000 Received: from localhost ([127.0.0.1]:34635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2Rjx-0007Gk-ME for submit@debbugs.gnu.org; Wed, 11 Oct 2017 20:52:45 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:50246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2Rjv-0007GX-Bz for 28631@debbugs.gnu.org; Wed, 11 Oct 2017 20:52:43 -0400 Received: by mail-pf0-f173.google.com with SMTP id m63so2645810pfk.7 for <28631@debbugs.gnu.org>; Wed, 11 Oct 2017 17:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=0nfaDWKHQ/SK5jUQjuKNoCC4WPb5QpgxxOuncnYx9qo=; b=HqLKHxMNMwab1Px5d7XQjDRcDPxKuAFL6A9S1r2HY47yu9esCpl+WbYyv0mHk4cc3v PSnL4LayB0a6I5VBIiR+BYFBpTcTQ7rkVsma5OHbM2vedpNzBjqqpOsTvWaU+Ok73Jo0 cG4kPOJKN5reHQ1qccHfYXP6/+7oDv86Ep9FNd1HsyPeS5lLipfNqpPrJ2vlW7tu8I0v gtoCH7ai3vm3hJIuB32a6NFR7IlYewg+K8w4IjTpKtGnsPCPnjPhMF+c3Z6Onu4nlMFS 9oGU4k7tFejm1bOdjFM82YLSE8wzmAgeQmyPBjIkU2DwUIlnBzc8wa5VIp4aYU2OZRdR sydg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=0nfaDWKHQ/SK5jUQjuKNoCC4WPb5QpgxxOuncnYx9qo=; b=R5s3k0v9PcOA7d82BHhavW/2nlDkGjEk7to8GzHZWRTWdB+qv9g1ZJbqiSNqGcL6dZ 8RUDSxOgYxVE7vMzoyOGP6AXd/ON7AVHwFST/CP/S2E4qKznSPQKy+BM0M1XHkubKitK ykanHd67PlIkwCPUDpJVKN+RRbWouk59LCeKUYpP/8Js+laryxx4GFu8ar5sGB7ZdjTq K6RzWuklXWrxmuia+UYdOJYOIW16AScwMPM9Z3FhJ3NtOS2BSirEg7E2xlaJVc56QJEE IRfRg6czyyNkD9meyrVhj41+MYHS/8XIzogLc2VtURgvHD9tTNMY/UgsgEG5iHhLB0aN xFVw== X-Gm-Message-State: AMCzsaWwrdTNKK5A4ivtDbEAsAryn5ndaeSEL3FdDaa1A3y8NjGqKIwr Yu+VIkw+BhhUOZtnyKP/fwY= X-Google-Smtp-Source: AOwi7QB54LjycJfmf+2tVzpz4MHXE8cxYtzHku9w4/mK0/BR4d7p/x9ZGZiRawmzt0ArACKT5H7+MQ== X-Received: by 10.84.209.238 with SMTP id y101mr640054plh.211.1507769557312; Wed, 11 Oct 2017 17:52:37 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id a25sm25915354pfc.143.2017.10.11.17.52.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2017 17:52:36 -0700 (PDT) From: Tino Calancha To: 28631@debbugs.gnu.org Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> Date: Thu, 12 Oct 2017 09:52:28 +0900 In-Reply-To: <87ing3w8rk.fsf@gmail.com> (Tino Calancha's message of "Thu, 28 Sep 2017 17:02:39 +0900") Message-ID: <87h8v5mblf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28631 Cc: tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Tino Calancha writes: > I am biten by this problem from time to time. > Usually I visit another buffer BUF-B to copy a string STR; then > I do `winner-undo' to comeback to the initial buffer, BUF-A, and `yank' > STR. Sometimes I found that `yank' insert a string different than STR. > That's happen if I previously deactivated the mark in BUF-A with C-g. Since I reported this issue I added the patch into my .emacs and I don't get this problem anymore. Maybe someone prefer to fix this issue in another way. Any comment or suggestion? From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 22:06:32 2017 Received: (at 28631) by debbugs.gnu.org; 12 Oct 2017 02:06:32 +0000 Received: from localhost ([127.0.0.1]:34670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2StL-0002Yl-VS for submit@debbugs.gnu.org; Wed, 11 Oct 2017 22:06:32 -0400 Received: from mail-io0-f178.google.com ([209.85.223.178]:53525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2StK-0002YX-EJ for 28631@debbugs.gnu.org; Wed, 11 Oct 2017 22:06:30 -0400 Received: by mail-io0-f178.google.com with SMTP id 189so3860116iow.10 for <28631@debbugs.gnu.org>; Wed, 11 Oct 2017 19:06:30 -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=O38uuUlZrDiACq938Bfn+1TMElkeC9ZVdcRw/mU9UgI=; b=qbfpjhZqWrdPuktuOOlsPOOjyXJ6OurtW5mpMjbV1NgKXqAmsHpXGW1+UBtN4EVI72 sKSZ32AlFttB9cuG9RGK1WdPJ3FeVU0W5QdDGZprx4mooJ7+TaU+h973c9v0avTa86j7 qfra81D/gEy47H1OuCFrUDfYokCrfWxnAhM3TRI/RSx+GPUebu/hHtWzH+mFZgVsEroJ EVTDgdIz84FOgzgJ6jvL2Ecx/xIRNLFr4WQn0PPn/OKKpSBMXXBzp6CAtz+iZALk6li0 vSBMYNUBXooCP5bYb1AN6NHIrfFKwots5YMC7F0uVW6p5VUgYsTWrCt39h8JjWquKHsM fsEQ== 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=O38uuUlZrDiACq938Bfn+1TMElkeC9ZVdcRw/mU9UgI=; b=kK2HfTQf7uWVMQWjBiSn56EtrUSBa5AvmnydA1nvWft26MXPmUHhnss4Op2EQggRes K1CgbYsMwF3AYoEQuy+6M8y20tybBlyDw4cG+mrCZRu27gr1ecZpJCHpAl0G+rPMKKGQ MbMY+Cg9+YQ2vvFWEsaOsTELCZoggXhB7O4PJx1JfG00oZ1LPFo4xS+7SvOfKz3RZ5Fw aaKBeVFIVclJd6BNOW/zW6sfSM+fUgpU7aOiWIKkoEFa594yhqjW3YSq8PPWJpuu6Zc0 k3lTU6ZTeQ/NTl6CdSggFE8S6WEtx4D5CD7QPRlbhBjKVkfREt/vWCZUaTEb3LqwKVtk siUg== X-Gm-Message-State: AMCzsaVeAGRXpyf2F+BPfJoccsmEyUcuRzgnzOvErzbL7l5fZwhG5Luw P+gfnfUIxUprQ0c2D3U521WvXQ== X-Google-Smtp-Source: ABhQp+QYDPgNTFAT0UjOe01VxzgVkl1Txkccc/G2EWOoDgzO7ji5PDbCdOK/+a6k6Ynl/SDuBPcn/A== X-Received: by 10.107.141.206 with SMTP id p197mr1346899iod.92.1507773984508; Wed, 11 Oct 2017 19:06:24 -0700 (PDT) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id b66sm7274287itb.28.2017.10.11.19.06.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2017 19:06:23 -0700 (PDT) From: Noam Postavsky To: Tino Calancha Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> Date: Wed, 11 Oct 2017 22:06:22 -0400 In-Reply-To: <87ing3w8rk.fsf@gmail.com> (Tino Calancha's message of "Thu, 28 Sep 2017 17:02:39 +0900") Message-ID: <87o9pdazmp.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 28631 Cc: 28631@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Tino Calancha writes: > I am biten by this problem from time to time. When winer-mode > is enabled and i deactivate the mark with C-g, then i observe > funny behaviour with `yank'. > > Usually i visit another buffer BUF-B to copy a string STR; then > i do `winner-undo' to comeback to the initial buffer, BUF-A, and `yank' > STR. Sometimes i found that `yank' insert a string different than STR. > That's happen if i previously deactivated the mark in BUF-A with C-g. > > To reproduce the problem: > emacs -Q -eval '(winner-mode 1)' \ > -eval "(customize-set-variable 'select-enable-clipboard nil)" \ > -eval "(customize-set-variable 'select-enable-primary t)" > > < C-TAB M-f M-f ; `yank' would insert ";; This buffer" That should be 'M-< C-SPC M-f M-f' I guess. > C-x C-b C-x 0 C-x o, not C-x 0. > C-x h ; mark whole buffer > ;; `yank' would insert the content of *Buffer List* > C-g > RET ; `yank' would insert ";; This buffer" > C-c ; winner-undo > ;; `yank' would insert the content of *Buffer List* > > Note that the primary selection doesn't change if you visit > *Buffer List* with C-x b RET. That is, if you change above > C-c > by: > C-x b RET > > then, the `yank' will insert ";;This buffer". > > I don't see a good reason why visiting a buffer with `C-x b' or > `winner-undo' makes a difference in the primary selection. It's because winner-undo tries to restore marks. (defun winner-active-region () (declare (gv-setter (lambda (store) ... `(if ,store (activate-mark) (deactivate-mark)))))) (region-active-p)) ... ;; Make sure point does not end up in the minibuffer and delete ;; windows displaying dead or boring buffers ;; (c.f. `winner-boring-buffers'). Return nil if all the windows ;; should be deleted. Preserve correct points and marks. (defun winner-set (conf) ... ;; Restore marks (save-current-buffer (cl-loop for buf in buffers for entry = (cadr (assq buf winner-point-alist)) do (progn (set-buffer buf) (set-mark (car entry)) (setf (winner-active-region) (cdr entry))))) ... Lisp Backtrace: "x-own-selection-internal" (0xffffb560) 0x1364810 PVEC_COMPILED "apply" (0xffffbbe0) "gui-backend-set-selection" (0xffffc110) "gui-set-selection" (0xffffc628) "deactivate-mark" (0xffffcb60) "winner-set" (0xffffd100) "winner-undo-this" (0xffffd600) "winner-undo" (0xffffddb0) "funcall-interactively" (0xffffdda8) "call-interactively" (0xffffe010) "command-execute" (0xffffe588) (gdb) p selection_value $10 = XIL(0x31a5f54) (gdb) xpr Lisp_String $11 = (struct Lisp_String *) 0x31a5f50 ". * *scratch*", ' ' , "266 Lisp Interaction \n %* *Messages*", ' ' , "133 Messages \n" > How about the following patch? > > Set mark at point after keyboard-quit > > * lisp/simple.el (deactivate-mark): In transient-mark-mode > always set the mark at point after keyboard-quit (Bug#28631). That seems quite disruptive. Perhaps instead deactivate-mark could be changed so that it would not update the selection on winner-undo? From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 22:54:03 2017 Received: (at 28631) by debbugs.gnu.org; 12 Oct 2017 02:54:03 +0000 Received: from localhost ([127.0.0.1]:34696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2TdK-0005d5-TA for submit@debbugs.gnu.org; Wed, 11 Oct 2017 22:54:03 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2TdJ-0005cb-6l for 28631@debbugs.gnu.org; Wed, 11 Oct 2017 22:54:01 -0400 Received: by mail-pf0-f193.google.com with SMTP id i23so4138893pfi.2 for <28631@debbugs.gnu.org>; Wed, 11 Oct 2017 19:54:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7wk+97MYHgy7u9Y45Yb8UQ2PXc3hyKnCC3N1S0PcsLc=; b=QBT0zMi7JCCnzA2L2FnJmNhT42kAhXXH9hga0ZasVDL01AARx+vePq6YnV1iiKxPfY N1VJcI5IrbdxjV/UTNFtCdEA/2rz3DjfFkt8wlvIfTUvblw2kFPObjD+DD/K3j7maRVV Y26IS6EpvC7xorDtMQxqJhfFJVUinuMr/tU1t8FNQ+SKjKNduSqAUsktsNdNF3QW/LMi 90zSyG91J+NRn/csuG1o5kwK+sqtIiWe+wpFav+e4jdKsVMi4jG8XMOWLa+F9wkLDHsv CVEIf9ZuPAcXaDpt5jMTQRN8P/F/wFkehgLsIRwYoUIJsN/mrj4p5M+PyuHSOGzOy1oX iijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7wk+97MYHgy7u9Y45Yb8UQ2PXc3hyKnCC3N1S0PcsLc=; b=DCtkpGyiZZbhkBSHyOoUS3A1EWLECo2ABMvb6UYUe7fupS0BSqvPY/9OzWSXPouzCJ G2cLN+KE116nFFox5c+/gF0yQ9I+EsLRpUPrsroLDY77Z6QWHNBI/aIzGK0YC/7Br33n xWjJB4+RWO9PfhLkYNG1YihSmfgESn76nDHpgPjk5Al8Ua5DSa+pGuYwiQ22r75w7rnp 4dT7WFPNLXGr/IXwxFmJec7xAM5vfUBOomgL8reEZ/H5EapaZEnWbQZ7YpgHb6eB91Cc 76FaLYrf9c9P3yOVjvGE/denbtcZJCt7Z0iakrqwrjB28Hp3edSW/gQPwC5b2DIkeNsz M4mg== X-Gm-Message-State: AMCzsaU1JJ4qqTHucd6ufp7cZt5x0oeAQf6eQaYzRApyj2Jt9JdGzcCZ EHZZyMkxC+ffMnIeqAse3AM= X-Google-Smtp-Source: AOwi7QCUk0HoZbyulrLheKPC8MYKkRnC4lWlWFEKyRWppJkfBJp676usrsLdw2PqlR+Gek6ZZ/xvwQ== X-Received: by 10.101.65.2 with SMTP id w2mr913759pgp.131.1507776834891; Wed, 11 Oct 2017 19:53:54 -0700 (PDT) Received: from calancha-pc (MAR90-45.kek.jp. [130.87.90.45]) by smtp.gmail.com with ESMTPSA id r81sm28981007pfj.106.2017.10.11.19.53.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2017 19:53:54 -0700 (PDT) From: Tino Calancha To: Noam Postavsky Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> Date: Thu, 12 Oct 2017 11:53:47 +0900 In-Reply-To: <87o9pdazmp.fsf@users.sourceforge.net> (Noam Postavsky's message of "Wed, 11 Oct 2017 22:06:22 -0400") Message-ID: <87o9pdaxfo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 28631 Cc: 28631@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) Noam Postavsky writes: Thank you very much for the comments. I have updated the patch following your suggestion (see below). >> To reproduce the problem: >> emacs -Q -eval '(winner-mode 1)' \ >> -eval "(customize-set-variable 'select-enable-clipboard nil)" \ >> -eval "(customize-set-variable 'select-enable-primary t)" >> >> < C-TAB M-f M-f ; `yank' would insert ";; This buffer" > > That should be 'M-< C-SPC M-f M-f' I guess. Absolutely. >> C-x C-b C-x 0 > > 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*. >> I don't see a good reason why visiting a buffer with `C-x b' or >> `winner-undo' makes a difference in the primary selection. > > It's because winner-undo tries to restore marks. I see, thank you. > >> How about the following patch? >> >> Set mark at point after keyboard-quit >> >> * lisp/simple.el (deactivate-mark): In transient-mark-mode >> always set the mark at point after keyboard-quit (Bug#28631). > > That seems quite disruptive. Perhaps instead deactivate-mark could be > changed so that it would not update the selection on winner-undo? Yeah, my patch is kinda of lazy. What you are suggesting sounds better. Following one works to me --8<-----------------------------cut here---------------start------------->8--- 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)) --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 14, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-10-12 Repository revision: 349c1f93021e49c63f076b602d3d228324105fd6 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 12 20:47:05 2017 Received: (at 28631) by debbugs.gnu.org; 13 Oct 2017 00:47:05 +0000 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 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 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) 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) From: Noam Postavsky To: Tino Calancha Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> Date: Thu, 12 Oct 2017 20:46:54 -0400 In-Reply-To: <87o9pdaxfo.fsf@gmail.com> (Tino Calancha's message of "Thu, 12 Oct 2017 11:53:47 +0900") Message-ID: <87infjc1s1.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 28631 Cc: 28631@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 12 21:54:53 2017 Received: (at 28631) by debbugs.gnu.org; 13 Oct 2017 01:54:53 +0000 Received: from localhost ([127.0.0.1]:36533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2pBd-0003TN-7a for submit@debbugs.gnu.org; Thu, 12 Oct 2017 21:54:53 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:51050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2pBb-0003T8-0n for 28631@debbugs.gnu.org; Thu, 12 Oct 2017 21:54:51 -0400 Received: by mail-pf0-f180.google.com with SMTP id m63so7616011pfk.7 for <28631@debbugs.gnu.org>; Thu, 12 Oct 2017 18:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=y+67KpAKJsiap5mLqfj4Im1N9T5QsJhWh7naF1QFEhs=; b=g/SY7YDaoG+qAHf4Mo5ncbaO5ljmdLGOEPbLfnOGSH8rbWkyHn+SoExmU/DnlJQ079 6Xc6usqufMKMq+eyfRUgkqtQJRBCBFEFV60G2CjIu4BRDNb5iy/QGrsYivv0Ece9Bes7 HhvnwjAqR/St/OjHkJ4N8tPQEN1NRxrFJ30L6TH09JmsFKsnOqMTlof8EMgeSi82TNJf nlyTsNH7X1B1YcCcV6T8nl2wV6mzzBCs3ZntYZv0FZvwvtl7/qbbdqrCx2Z0l+y3BiJW Yxa1jZo7GN2X/03mT2iJgjx8C6ql82iINw7FZF5SHpEs+zzx1iZcGnlZ77bqJAhZewHg TfXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=y+67KpAKJsiap5mLqfj4Im1N9T5QsJhWh7naF1QFEhs=; b=Sdjx0UJc9ZkSOsSLFu2Z/35FULv9JCdSNmSn/It9l0vXEyfr4HNRcBvbAVZfXa+5PT mpudGyb/Yqun8kmxxGJtzRvACBXBEkqXxtrh34ucO4XSdIJfG7Y/eVjTifjGDNs8Odsw 6T87hT2Vy0lbCxvlUNs5TuiaGxvvnciG6U8MSOzgMNFGadUbJokIdYdxOH+7Mv4EczZx gnXZkEytUxvtVQT97AE/kZxRA/aDvee1UDCF5t1usc2BZoXo8+rUpoSHdvD7SXdChEb/ b5ZCDHymB9Iyzj5qg2Otsw9KNEQ2cvkZwOxMWFaSLRkbavIEjWkCUhcFeSOE0baYHqHZ Y/RQ== X-Gm-Message-State: AMCzsaX2wewVAS2XYiu2ZeoMYa5oVv3bFGeAqwJByRunMB1fy35uLH2q dzTVRBBediK8Csf4OT93w2Y= X-Google-Smtp-Source: AOwi7QDe3+DSby8VQ8GU/iEK72hMHfSnmwLJXhLq/qhwq3yjjwAsr0gj8Oms6Gav+kA0Wl8xVeHSww== X-Received: by 10.84.173.228 with SMTP id p91mr1800615plb.264.1507859684857; Thu, 12 Oct 2017 18:54:44 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id t24sm27778027pfj.46.2017.10.12.18.54.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Oct 2017 18:54:44 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Fri, 13 Oct 2017 10:54:41 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Noam Postavsky Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection In-Reply-To: <87infjc1s1.fsf@users.sourceforge.net> Message-ID: References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 28631 Cc: 28631@debbugs.gnu.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) On Thu, 12 Oct 2017, Noam Postavsky wrote: > 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. OK. Thank you very much. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 02:48:34 2017 Received: (at 28631) by debbugs.gnu.org; 13 Oct 2017 06:48:34 +0000 Received: from localhost ([127.0.0.1]:36652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2tlq-0008OK-EW for submit@debbugs.gnu.org; Fri, 13 Oct 2017 02:48:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2tlp-0008O6-Q5 for 28631@debbugs.gnu.org; Fri, 13 Oct 2017 02:48:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2tlh-0001B7-Ft for 28631@debbugs.gnu.org; Fri, 13 Oct 2017 02:48:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2tlh-0001Ax-D6; Fri, 13 Oct 2017 02:48:25 -0400 Received: from [176.228.60.248] (port=1061 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e2tlg-0002i3-Gp; Fri, 13 Oct 2017 02:48:24 -0400 Date: Fri, 13 Oct 2017 09:48:15 +0300 Message-Id: <83a80vlf0w.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87infjc1s1.fsf@users.sourceforge.net> (message from Noam Postavsky on Thu, 12 Oct 2017 20:46:54 -0400) Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28631 Cc: 28631@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Noam Postavsky > Date: Thu, 12 Oct 2017 20:46:54 -0400 > Cc: 28631@debbugs.gnu.org > > --- 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. Is there really no way to solve this in winner? It seems like a winner bug/misfeature, and I'm worried by the possible effect of this patch on use cases that have nothing to do with the specific scenario of this bug. deactivate-mark is used a lot in places and ways we cannot possibly predict. So I think a solution for emacs-26 should be safer than that. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 04:07:09 2017 Received: (at 28631) by debbugs.gnu.org; 13 Oct 2017 08:07:09 +0000 Received: from localhost ([127.0.0.1]:36778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2uzt-0005qO-8H for submit@debbugs.gnu.org; Fri, 13 Oct 2017 04:07:09 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:55539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2uzq-0005py-Vq for 28631@debbugs.gnu.org; Fri, 13 Oct 2017 04:07:07 -0400 Received: by mail-pf0-f173.google.com with SMTP id 17so8975258pfn.12 for <28631@debbugs.gnu.org>; Fri, 13 Oct 2017 01:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xOvNTYD+S+OBu8f7f79/mTbBZ0rF9Od0jefzs0w2514=; b=MW0VoaM7ARlGnG36eQIRZuGMZwK3VM563hsRjpnEELRZZbpb7SW+AdFfQ+AovBs/nx RC7babFlYilIzi0PpwP5W7QoE1lJm62FSbUDog+DpzrgioYM9WBk/pDPJV2QGnJEHXYY p7VTovRcraPwt0RFl2CvkH0YgNzDrsOByt2WWk/mG2Y7+kSqYB6XVZFqrS7lv4a4FZZ0 EXCBdEmO+slSveoKrIqu0y3jzGZwC4/dKCjljW4Razj2Uvm2gY7y3tJF9A6TV+ZfI8Bu G4TxWFPWLfxrmPhD7IQCTfldOL1uHr6xm6+bNBPwwWCjNZoO2povOmcgi4rzR/qfX4LT AqYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xOvNTYD+S+OBu8f7f79/mTbBZ0rF9Od0jefzs0w2514=; b=Z2KUFFzniU4a2iOC9Q0GROrSQ5Op1F1GSEU9I0W09II2BIqHv9QiBk0O6K6TRzQt86 WcotFfJD7IuTWO1PEHKtcU43pUGj1T2bn9luhIw30R+OLEI4q61l7GMYRdgV/kJI2Vec zyJNJKofHmmMlfi3tPb1WQhBk/p+lmvuGGPk7Yo7zr3M8o8MzM0Fy2exmdxS0io8ZqUy JSwhpNR080YigFTeMEpKgaGUCJAvn0MlhbivuWzL65/wZusSntm6r5tAm4gE0Lkr8fNg kbZWD+ZcXS6bKLcfhCyPShSqmGU0Q3kfiHmkDncQ+uKD4U6fa3DZjCY12L9x7LpYFIef c1Gw== X-Gm-Message-State: AMCzsaUSvL67d95k/g4InruulGOmetFzZaNVRxNXIs1MEyn4hQj0Zckt xMg8OvIjrQjnjLlE69jfNfmhiw== X-Google-Smtp-Source: AOwi7QBSSn2RpaP9tmVefUKHbqKiVgInn/2EN0rZOVIRF3I6g9X4X4V/5eELIKD/WYQCCCr0hLNPuQ== X-Received: by 10.84.131.103 with SMTP id 94mr677069pld.302.1507882020988; Fri, 13 Oct 2017 01:07:00 -0700 (PDT) Received: from calancha-pc ([103.5.140.183]) by smtp.gmail.com with ESMTPSA id q70sm1468095pfj.39.2017.10.13.01.06.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 01:06:59 -0700 (PDT) From: Tino Calancha To: Eli Zaretskii Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> <83a80vlf0w.fsf@gnu.org> Date: Fri, 13 Oct 2017 17:06:53 +0900 In-Reply-To: <83a80vlf0w.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 Oct 2017 09:48:15 +0300") Message-ID: <878tgf8o9u.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28631 Cc: 28631@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Eli Zaretskii writes: >> From: Noam Postavsky >> Date: Thu, 12 Oct 2017 20:46:54 -0400 >> Cc: 28631@debbugs.gnu.org >> >> --- 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. > > Is there really no way to solve this in winner? It seems like a > winner bug/misfeature, and I'm worried by the possible effect of this > patch on use cases that have nothing to do with the specific scenario > of this bug. deactivate-mark is used a lot in places and ways we > cannot possibly predict. I agree it's better if it is handled inside winner. I am not a winner guru, just an user so sorry if the following patch is not right. --8<-----------------------------cut here---------------start------------->8--- commit 3420c8089f3c3d2dc22472dddfa938a2bd044a27 Author: Tino Calancha Date: Fri Oct 13 16:56:55 2017 +0900 Dont update primary selection with winner-undo * lisp/winner.el (winner-set): Dont update primary selection when select-enable-primary is non-nil (Bug#28631). diff --git a/lisp/winner.el b/lisp/winner.el index 61ea4d40e7..6bc27484a7 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -304,12 +304,15 @@ winner-set (push win xwins))) ; delete this window ;; Restore marks - (save-current-buffer - (cl-loop for buf in buffers - for entry = (cadr (assq buf winner-point-alist)) - do (progn (set-buffer buf) - (set-mark (car entry)) - (setf (winner-active-region) (cdr entry))))) + ;; `winner-undo' shouldn't update the selection (Bug#28631) when + ;; select-enable-primary is non-nil. + (unless select-enable-primary + (save-current-buffer + (cl-loop for buf in buffers + for entry = (cadr (assq buf winner-point-alist)) + do (progn (set-buffer buf) + (set-mark (car entry)) + (setf (winner-active-region) (cdr entry)))))) ;; Delete windows, whose buffers are dead or boring. ;; Return t if this is still a possible configuration. (or (null xwins) --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-10-13 Repository revision: 7dc037e39e6bbfa8964d0040e8141dbcf70d726d From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 09:32:39 2017 Received: (at 28631) by debbugs.gnu.org; 13 Oct 2017 13:32:39 +0000 Received: from localhost ([127.0.0.1]:37004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e304s-0000s4-27 for submit@debbugs.gnu.org; Fri, 13 Oct 2017 09:32:39 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:50972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e304q-0000rp-70 for 28631@debbugs.gnu.org; Fri, 13 Oct 2017 09:32:36 -0400 Received: by mail-io0-f172.google.com with SMTP id 97so8983818iok.7 for <28631@debbugs.gnu.org>; Fri, 13 Oct 2017 06:32:36 -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=BbUajqI2ZuCogwEf/g0OCxTjIRSJYFp8HauipDOMwI0=; b=SUE7EIKODkx+/yMhSjr9UeAe7sm5xlEfvbasDnoi1NUHdLL7AXrYHxIHWTHpXcmIhm dMBgzrJMpI+bhWxnACGHhMCh3CRjP1y+N+Y2DsOebhCbsQ/x2Z3lP1AeciJnl+CY8flE yVtPSafmh3uTaDCTDzi/Aouek0I2Cpieoz6ZI5SVm645ecU9Pp5LFflq8Qivv7g9AMsV 1yW+LmJy+mRxOrq3yTkRyWz/96t6svmux1dO8aIIBMt5DQRVxcCk7CKkb0ybCgYAgoGY YyADKoOF57ABpzAPgeMRBeGVDVG8/Uask0z0Ulku4gImPQv0nbEsNSTmNRC8bP7nmcaz ep3Q== 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=BbUajqI2ZuCogwEf/g0OCxTjIRSJYFp8HauipDOMwI0=; b=ZDyP47LS6Y1GLKj2VA6H6gVacGsy275+//O7qB+nasvjc6T8MZxjQPYLMoslp2EuDi c0Dh042S+m5dFZ1HmlbXlplxoLu2h3FSsChYvXMY1c3i354ru3lSLUOya7CXcPeWCSjk Q17Vhsx/l5C8fUttYjNzIlUxhdmns0a3v/Zg9q5Ea8aD7kRvVYIfXjp7pzJWRWpeGWL3 YnO+baON3eM8REi+UyPzKMB5UivMdk5Eb1f3n4geT17s6soMyKDorv1AAr08NSrV7ORB YMDiXXeuE3w3sbyV7xRdu3sn+BDxvVoIERQRIwVB2Sl3k2DgkkNSEHBKtZhU/zvG7ElN IIqA== X-Gm-Message-State: AMCzsaWKdcaF2HFNTldYM61OcrWpDR6ni1nkZMK6m8FIAonM5Lc5+mXO mw0/HkkTAkgqJnOJJ7jISltghQ== X-Google-Smtp-Source: AOwi7QB+AuGPt3EN+C5I7qj6xikYgy7c/scvTo+FKYa/Vg4qPKdPQvX05+ymOH2HEXfKfWIlGKA3gA== X-Received: by 10.107.140.18 with SMTP id o18mr1779036iod.35.1507901550414; Fri, 13 Oct 2017 06:32:30 -0700 (PDT) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c187sm716278ith.4.2017.10.13.06.32.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 06:32:29 -0700 (PDT) From: Noam Postavsky To: Tino Calancha Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> <83a80vlf0w.fsf@gnu.org> <878tgf8o9u.fsf@gmail.com> Date: Fri, 13 Oct 2017 09:32:28 -0400 In-Reply-To: <878tgf8o9u.fsf@gmail.com> (Tino Calancha's message of "Fri, 13 Oct 2017 17:06:53 +0900") Message-ID: <87y3of9nrn.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 28631 Cc: Eli Zaretskii , 28631@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Eli Zaretskii writes: >> ((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))))) > Is there really no way to solve this in winner? It seems like a > winner bug/misfeature, and I'm worried by the possible effect of this > patch on use cases that have nothing to do with the specific scenario > of this bug. deactivate-mark is used a lot in places and ways we > cannot possibly predict. That patch only has affect during winner-undo, no? Probably cleaner to avoid relying on `this-command' if possible though. Tino Calancha writes: > I agree it's better if it is handled inside winner. > I am not a winner guru, just an user so sorry if the following patch > is not right. > + ;; `winner-undo' shouldn't update the selection (Bug#28631) when > + ;; select-enable-primary is non-nil. > + (unless select-enable-primary > + (save-current-buffer > + (cl-loop for buf in buffers > + for entry = (cadr (assq buf winner-point-alist)) > + do (progn (set-buffer buf) > + (set-mark (car entry)) > + (setf (winner-active-region) (cdr entry)))))) Maybe only the (setf (winner-active-region) (cdr entry)) part should be skipped? From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 21:42:27 2017 Received: (at 28631) by debbugs.gnu.org; 14 Oct 2017 01:42:27 +0000 Received: from localhost ([127.0.0.1]:38603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3BT9-0005Ro-6H for submit@debbugs.gnu.org; Fri, 13 Oct 2017 21:42:27 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:53462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3BT7-0005Ra-In for 28631@debbugs.gnu.org; Fri, 13 Oct 2017 21:42:25 -0400 Received: by mail-pf0-f194.google.com with SMTP id t188so9163814pfd.10 for <28631@debbugs.gnu.org>; Fri, 13 Oct 2017 18:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=1CgHD+v5Rs7cFYlJtZ2mAIPrJiWUkfJpOoWOJJBIKK0=; b=kQdizRU6FI9C61cdNGk8EA99XSGiwu3clcTGKm3Gm6SwRoxHb//6xCpLGz/QN6dGTI o0PzcUHybj5IH+7vtTMEYVmpxtt9WXJ9pPiW3hlWcw8+Rfh/J6nz2j8Fi/O6ZGxRmZf6 Ap4iafrdQVDM00WacecLUQvp/9Kq1lJ3vubi+xxvXjJNEdlM9WxD9RwX9fXT5OjujTQ2 kHZ6K4fyvSdxUr9qN3YcfkrHDR5dQKAwAIJD11CgoN6muAZ+7r7waW6VnLucL3muIc21 ih35el7pkQfHpqgrk+/BfiRUTX+4EqLxrMQ6YJSRU44WaCsDEXltCThX6iuFdhKuMuRe DpOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=1CgHD+v5Rs7cFYlJtZ2mAIPrJiWUkfJpOoWOJJBIKK0=; b=G2fxave1ryUTEoODv2juyIRQ/ZZj2W2OB/JCP0spP0toM2O9u2yIHBnRx/eyRTWcEp 8ZXzlwAf4iRJCLktyJM/gRmkVQkG9G7KwlNkXTynC3K9NZB9Jn7cUfTKyOZe2b2ci8Rv AA05/zyDDx8s8rV5cxdA466A2f6/avZS7slAKGz0dPglA2w3350L8DMZ3PfjC5x05hNA u7CjFQlmghzzoe/J738xnsXHFY80cnd2gT8nK5dX/UemQfmakgKI+3U2N3quZTO6g2m3 KGhaXE48ME9M4oZpqxtVzYp34yR/g8zXvNf/kMms3NxpWWkhc5jXom2/Y4yJPZAgunbK xeyw== X-Gm-Message-State: AMCzsaX3rjpxOva/h5UCyy9zHrmYRAJJDhpg+F8XV+BOyBALOlZE5eUi cnhUGGG+D9bQGLnDklvOXb0= X-Google-Smtp-Source: AOwi7QDGmW+Y18ohTFtNvQnJt5pN41Yz6wA+IgBDE84cse9iPYxZlxWiTORRzJBmzBpXvANqsXLINA== X-Received: by 10.84.235.3 with SMTP id o3mr3005533plk.30.1507945339531; Fri, 13 Oct 2017 18:42:19 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id g24sm4905035pfk.0.2017.10.13.18.42.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 18:42:18 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Sat, 14 Oct 2017 10:42:15 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Noam Postavsky Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection In-Reply-To: <87y3of9nrn.fsf@users.sourceforge.net> Message-ID: References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> <83a80vlf0w.fsf@gnu.org> <878tgf8o9u.fsf@gmail.com> <87y3of9nrn.fsf@users.sourceforge.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 28631 Cc: Eli Zaretskii , 28631@debbugs.gnu.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On Fri, 13 Oct 2017, Noam Postavsky wrote: > > Eli Zaretskii writes: > >>> ((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))))) > >> Is there really no way to solve this in winner? It seems like a >> winner bug/misfeature, and I'm worried by the possible effect of this >> patch on use cases that have nothing to do with the specific scenario >> of this bug. deactivate-mark is used a lot in places and ways we >> cannot possibly predict. > > That patch only has affect during winner-undo, no? I think so. >> + ;; `winner-undo' shouldn't update the selection (Bug#28631) when >> + ;; select-enable-primary is non-nil. >> + (unless select-enable-primary >> + (save-current-buffer >> + (cl-loop for buf in buffers >> + for entry = (cadr (assq buf winner-point-alist)) >> + do (progn (set-buffer buf) >> + (set-mark (car entry)) >> + (setf (winner-active-region) (cdr entry)))))) > > Maybe only the (setf (winner-active-region) (cdr entry)) part should be > skipped? We need to ban (set-mark (car entry)) as well, because it updates the primary selection. emacs -Q -eval '(winner-mode 1)' \ -eval "(customize-set-variable 'select-enable-clipboard nil)" \ -eval "(customize-set-variable 'select-enable-primary t)" M-< M-: (set-mark 15) RET M-: C-y ; It inserts in minibuffer ";; This buffer" I prefer this patch because: 1) Make the fix inside winner.el 2) The fix takes effect just if user has enabled select-enable-primary I don't fully understand the purpose of that part of the code, but I assume if someone have set select-enable-primary, then she probably doesn't want winner-undo to change her selection. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 22:09:59 2017 Received: (at 28631) by debbugs.gnu.org; 14 Oct 2017 02:09:59 +0000 Received: from localhost ([127.0.0.1]:38610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Btn-00069W-I1 for submit@debbugs.gnu.org; Fri, 13 Oct 2017 22:09:59 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:54720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3Btm-00069K-44 for 28631@debbugs.gnu.org; Fri, 13 Oct 2017 22:09:58 -0400 Received: by mail-io0-f181.google.com with SMTP id e89so3063764ioi.11 for <28631@debbugs.gnu.org>; Fri, 13 Oct 2017 19:09:58 -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=GhsLXmclYjlHpTrWiFJ4Cb5/19Kh+fcQd9paUIwvNDk=; b=iabKSyMnxcWWCVHPmE1l9rLDSrD2XCBTB79enFdQxHuR08oxRxciuRxdqKzau7VbGA 4QSakFdLtT+tspjzNlB6RsNW2liMX8mx79Qt9xuEjB72rj5nnsCCeRP3lSeW8mc0J11D 1wkXhYdTR2va61a9imYoD36rh8jVBDMd5+T0BoHUooAfFsfQLFlD5GeQNw4spbAyBXAo K1tVg9PIb7MMRR9AXo34bPd3f3Vid9e3/wbOllpX6OlYsL/ssVFQClgY4iZy2S1z38zi TBgZQvsJdBhS0VHbzNN//XO5gMoBppcooB/tsm+xc1tqtGJuhFx4UQKcIrglM/rIjN9W pMrw== 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=GhsLXmclYjlHpTrWiFJ4Cb5/19Kh+fcQd9paUIwvNDk=; b=JhLZytySMkFuOghRB5d09azVTfUl07P1rPlqG/gMfn5suOOAuVIXzK9KN8Gj/l75M1 Dc69k5gepxMa3OGKxqTOmU8oPwRBlw3QHQ14+zQCF4B+2542gA8na+saLhAXckmTOZvh /tQI27iQgdlX3DPMAeRiCTsolNZMlXBZ/Q2XTqbnsrSymh41h8HopftsA6tVQDUzvYk1 HOHog1oIH4UORTkzD4UOOCtaCdauH5bLsPrNNsqz2MJzhPSOjT1Tpj+Md45gIe9lM/V2 MrdkUAk9XE6OUBJ6Egf1Ex2B4C6LKgpHgjsKCPzQqYjVlvVVUUhoe1WRCq704zWjGJGy Qkbw== X-Gm-Message-State: AMCzsaXWeSD7+1eGzwcqMU7NAyUxzkRZH/AJBoT3nqve4UeqU0jpVKZj rnAhiLVZ4f9FGAYcVBprcWdAbw== X-Google-Smtp-Source: ABhQp+TaMgaLbkfCxBH28qH5kua3BV6aa1Tuv2pFb9SSFq+XPVZbxx7oi7OBovxSTVIjoYW2dhh6ig== X-Received: by 10.107.102.14 with SMTP id a14mr4403720ioc.60.1507946992165; Fri, 13 Oct 2017 19:09:52 -0700 (PDT) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id i29sm1147401ioo.31.2017.10.13.19.09.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 19:09:50 -0700 (PDT) From: Noam Postavsky To: Tino Calancha Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> <83a80vlf0w.fsf@gnu.org> <878tgf8o9u.fsf@gmail.com> <87y3of9nrn.fsf@users.sourceforge.net> Date: Fri, 13 Oct 2017 22:09:49 -0400 In-Reply-To: (Tino Calancha's message of "Sat, 14 Oct 2017 10:42:15 +0900 (JST)") Message-ID: <87shema39u.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 28631 Cc: Eli Zaretskii , 28631@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Tino Calancha writes: > On Fri, 13 Oct 2017, Noam Postavsky wrote: > >>> Is there really no way to solve this in winner? It seems like a >>> winner bug/misfeature, and I'm worried by the possible effect of this >>> patch on use cases that have nothing to do with the specific scenario >>> of this bug. deactivate-mark is used a lot in places and ways we >>> cannot possibly predict. >> >> That patch only has affect during winner-undo, no? > I think so. Actually, I thought about it a bit more, and realized it could also affect things like post-command hooks that are run after winner-undo. >> Maybe only the (setf (winner-active-region) (cdr entry)) part should be >> skipped? > We need to ban > (set-mark (car entry)) > as well, because it updates the primary selection. Ah, okay. > I assume if someone have set select-enable-primary, then she > probably doesn't want winner-undo to change her selection. Seems reasonable. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 02:56:38 2017 Received: (at 28631) by debbugs.gnu.org; 14 Oct 2017 06:56:38 +0000 Received: from localhost ([127.0.0.1]:38708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3GNC-0000Qn-IX for submit@debbugs.gnu.org; Sat, 14 Oct 2017 02:56:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3GNA-0000QW-Sr for 28631@debbugs.gnu.org; Sat, 14 Oct 2017 02:56:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3GN1-0003E8-S8 for 28631@debbugs.gnu.org; Sat, 14 Oct 2017 02:56:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3GN1-0003Du-Oc; Sat, 14 Oct 2017 02:56:27 -0400 Received: from [176.228.60.248] (port=3156 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3GN0-0006nO-Ej; Sat, 14 Oct 2017 02:56:27 -0400 Date: Sat, 14 Oct 2017 09:56:20 +0300 Message-Id: <834lr2jjzf.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87shema39u.fsf@users.sourceforge.net> (message from Noam Postavsky on Fri, 13 Oct 2017 22:09:49 -0400) Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> <83a80vlf0w.fsf@gnu.org> <878tgf8o9u.fsf@gmail.com> <87y3of9nrn.fsf@users.sourceforge.net> <87shema39u.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28631 Cc: 28631@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Noam Postavsky > Cc: Eli Zaretskii , 28631@debbugs.gnu.org > Date: Fri, 13 Oct 2017 22:09:49 -0400 > > >> That patch only has affect during winner-undo, no? > > I think so. > > Actually, I thought about it a bit more, and realized it could also > affect things like post-command hooks that are run after winner-undo. > > >> Maybe only the (setf (winner-active-region) (cdr entry)) part should be > >> skipped? > > We need to ban > > (set-mark (car entry)) > > as well, because it updates the primary selection. > > Ah, okay. > > > I assume if someone have set select-enable-primary, then she > > probably doesn't want winner-undo to change her selection. > > Seems reasonable. Please push to emacs-26 in a few days, if no comments or objections surface. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 03:26:09 2017 Received: (at 28631-done) by debbugs.gnu.org; 17 Oct 2017 07:26:09 +0000 Received: from localhost ([127.0.0.1]:44742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4MGP-0007ki-AC for submit@debbugs.gnu.org; Tue, 17 Oct 2017 03:26:09 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:44005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4MGN-0007kL-Ie for 28631-done@debbugs.gnu.org; Tue, 17 Oct 2017 03:26:07 -0400 Received: by mail-pg0-f47.google.com with SMTP id s75so752113pgs.0 for <28631-done@debbugs.gnu.org>; Tue, 17 Oct 2017 00:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=L/iBMnXKllnfElW4pDEx3LU7LigNnTtWlgzMfY7XI/s=; b=VKwYZgldxHleH3Yqx/imhCQKXVCmsdFEI8ljs+v+lZTAhY/ihF1oskk3E6VaTFiDfH HwRANWWe9GDYaVqmoL5Snp/co3HQ7R7W1YvQZH8eEVMEccXvuN/fR46kmH/ZGb+4RiQG A2lDnowvguYhOQsHOY2n5wr7jAVwcyRu5ALtAmQ/vhT/i/FNysocN7/9q0CEjYDb4zSe f7Dwaz+nPtIoUc2YSuvL6hGVt4hTfiIJktmGQ/gu91fgQnw6+KfM0+hHk0Vr9epQmuO5 leEu8IWnDtp5ViOjcIoGrazE57T+HpH8tYlzoO9zHmqliB0uCIWWS5yGBznPESsligfH R8mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=L/iBMnXKllnfElW4pDEx3LU7LigNnTtWlgzMfY7XI/s=; b=Ah82uR5i+cmeMlFTRFp6Q5p29E2FZx9SYCUdAXyQMc79KiOh5Q9vJElr6q7MEPMkVT cHtF1pZm+tKdwg+EuFWKH/okO6uuIgvdkxai7IMcBaGz8ECIZEyg5BnPE3vm6IYSAaV8 fqcchm62/N6zDMnyNzHzNg3N4/q/VsO3PhCklX6YJAsx9KiYHHszvz8oHxH5SM4nBEwB tPTKpmx1MnhpPZ8IWRyX48wbcKByDqNonQIMuBWJSOjA96JIQXlwB4ggv2UHa4by+F92 RBIZ0ziZFCmWctEDrUYbedj9F5XAk4qhCri2M0zZ7w5mK5zn1rzLa4KR2fcW5TVrImXJ bZaA== X-Gm-Message-State: AMCzsaXq3oAS8jpPIJ47JC/UXuv6EbSWKECaDm29OlgypnFkOTf/jGgs 2nKFDSlJFAqOX2O3gzNnCvZS0g== X-Google-Smtp-Source: AOwi7QBUXybWoRNdCdJK7nSSo7mdfgxPOxggduxmNqlFMKveanvFQUXgOLqkEBYR2A2LEr68aLS5XQ== X-Received: by 10.84.194.37 with SMTP id g34mr11158704pld.132.1508225161555; Tue, 17 Oct 2017 00:26:01 -0700 (PDT) Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id x26sm18227919pfh.95.2017.10.17.00.26.00 for <28631-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2017 00:26:00 -0700 (PDT) From: Tino Calancha To: 28631-done@debbugs.gnu.org Subject: Re: bug#28631: 25.3.50; Deactivate mark with Ctrl-g mess up the primary-selection References: <87ing3w8rk.fsf@gmail.com> <87o9pdazmp.fsf@users.sourceforge.net> <87o9pdaxfo.fsf@gmail.com> <87infjc1s1.fsf@users.sourceforge.net> <83a80vlf0w.fsf@gnu.org> <878tgf8o9u.fsf@gmail.com> <87y3of9nrn.fsf@users.sourceforge.net> <87shema39u.fsf@users.sourceforge.net> <834lr2jjzf.fsf@gnu.org> Date: Tue, 17 Oct 2017 16:25:54 +0900 In-Reply-To: <834lr2jjzf.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Oct 2017 09:56:20 +0300") Message-ID: <87y3oa1bi5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 28631-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) Eli Zaretskii writes: > Please push to emacs-26 in a few days, if no comments or objections > surface. Pushed into emacs-26 branch as commit "Dont update primary selection with winner-undo" (2c3e6f1ddc90335249f1a7f56f5f7b377c873fb7) From unknown Fri Aug 15 18:47:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Nov 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator