From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59875: 30.0.50; [PATCH] fallout c73f99f Date: Thu, 08 Dec 2022 09:58:08 +0800 Message-ID: <87lenilkr3.fsf@yahoo.com> References: <877cz3yf5q.fsf@dick> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19629"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59875-done@debbugs.gnu.org To: dick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 02:59:22 2022 Return-path: Envelope-to: geb-bug-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 1p36C0-0004we-Fs for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 02:59:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p36Bl-0002SI-Fv; Wed, 07 Dec 2022 20:59:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p36Bk-0002Rh-2a for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 20:59:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p36Bj-0001KT-Qn for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 20:59:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p36Bi-0008AK-Cr for bug-gnu-emacs@gnu.org; Wed, 07 Dec 2022 20:59:02 -0500 Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 01:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 59875 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 59875@debbugs.gnu.org, luangruo@yahoo.com, dick.r.chiang@gmail.com Original-Received: via spool by 59875-done@debbugs.gnu.org id=D59875.167046470731377 (code D ref 59875); Thu, 08 Dec 2022 01:59:02 +0000 Original-Received: (at 59875-done) by debbugs.gnu.org; 8 Dec 2022 01:58:27 +0000 Original-Received: from localhost ([127.0.0.1]:53525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p36B9-0008A0-0W for submit@debbugs.gnu.org; Wed, 07 Dec 2022 20:58:27 -0500 Original-Received: from sonic305-22.consmr.mail.ne1.yahoo.com ([66.163.185.148]:37750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p36B5-00089u-VD for 59875-done@debbugs.gnu.org; Wed, 07 Dec 2022 20:58:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1670464697; bh=+Jv+tY8+oOeeZ0VJZJiLqls5+vBBqi09K8rF+uFFKEQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=YpkZwrd29GT+8TakKlMndwAE60PvqED9EzobEEdzw9e8qMoe11TkZje666UXjEulcOkfBlcPv3AjumnQDnbwPdeoEOIRCtcdBuSFJ75mjMu4IbADp+vEyQ+B5hDshDdhSC6h2Ac4rs890PVAkZKTtxnA5r1Ee7Yo2oz1kJVVO9OjiFuLN1+1mFHG7ZKaGP62Z9E352zc2irnU448rmKUyeM0qeTx20IYX+6znT91VTDZOggsTxZi/jD1a3jbuEwg6jwetLBsaev3XjnxKNL9PfK4Go40r8dQKXRPLMGQVi6y6kUxUj0OYcm2x57xJPFPfvx8EwYCyXVbIdEueXpC0A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1670464697; bh=CZQ4wDijpj9jgksMO4IY8JQY2+XS+LWbGibisB0ki0+=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=rmrcnuG73SAZVKp3hxbShtAXzFnmjQRn2HqmNBD+ACPJlNVqEniXCgs5IJWgR+hMOyMb7/n6LWmwvf4hqFsgqP7CEqJx2zeHBxRu/w3b4yynmNEaR9hcVNUyYJhusHTIWKxjTAlLqEIoumketx+gE1zlFhcOc0qY6NBU9TsHcfrBfnsCzCJTd9rdTCeJszhFEJ6Fo9OARPUtL25Opgo+Kpt1JkIJs8m0PHw1KsiPAs3vw/6f0cSzR7A8k3eoHa1O5cZnPhUqJspJ8machgSkax+gP23KErzQYhZ2BboDCzXany82R+le6sAMtmkRVbXF4IHu87iJZ8ffJTZKiKv5qQ== X-YMail-OSG: _h_hcuEVM1lMOGLZxZq4.ymhHoU5gPNLrOR0qdfdXLn1OPm2b7T83MdAXN7tAYC mSS3G9.bbevMh0dDqLw8FrlT3TlzU37hLYFPSchJOy9rFyZQ3Cp2XXsXl1BHq4mXfsp1kgCz6Tae 7Pq51VmD7zG9GMnzKiu1NekGNwcjRtExMEmvqATpty0Jrf93LqIiFHgRNaVDKOTlSrckfLETiQCP o0C_nSBvCvGyIFoLNPUxr8YfiwrN3hwSzo.HI01WxhwW.O9mPgWRn_6cMLAjVdrpADzlorqpli_a g0AIPo59Av29.lt0xUBschKlteBezy1Cn5ttyIEBzoJ2TEio3XJ3505BBvvIiVSBpZxLnyG5U5wJ Z4lCBg0xcCEddljH3cOToNxyEhez9f.s9Sl3X4PUD.zpY744FNZAIT1lbPyReaOhqdjCmLjIML7C dS5mFRlOtNKvZgkRsQPaSyRwgEyElb9MUgC_.4kmusTDvnIGscV0iMyZd1HQjmhcg98pVvJOet7g Uts94l_4TKEiWqjFRg.aIg4gVQSMR7oLYkwxhmKc3O8CFvbQZ4tCrLFX1Xtx9jfY6aRgBXbCQNqN 1avRVs1xyQ5dgbt.K3g7UrZJ7o2DMJbLO2RM2pQv6iAKrUl7va.EsPIvfNdYLp1c.uTypo4OFjzE gJxuTd21fzYeXxUXTe8j6Cvnnp.rFPG6w_X7ymm1kooVpBd.GjTDILWgy1WBFmEQUBJshoKQOqIB ZqeyM6OGH8aXtgUZPz3XcnWonNCoJm6vhjC2nwvx2YJ7lPoJV.u6yPNwODzd19h4O4.C7tYIWc1k Gj6IRARHIUMFOz1EuAPIUsczE9ETrUeXzA3MMvA4Ls X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Thu, 8 Dec 2022 01:58:17 +0000 Original-Received: by hermes--production-sg3-b666c6484-8hzhs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b78904e8d9f22e920f1ac108949d140b; Thu, 08 Dec 2022 01:58:14 +0000 (UTC) In-Reply-To: <877cz3yf5q.fsf@dick> (dick's message of "Wed, 07 Dec 2022 00:08:17 -0500") X-Mailer: WebService/1.1.20926 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250236 Archived-At: dick writes: > src/xselect.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/src/xselect.c b/src/xselect.c > index 121b17df1b0..78820cb3a7c 100644 > --- a/src/xselect.c > +++ b/src/xselect.c > @@ -624,6 +624,13 @@ x_pop_current_selection_request (void) > xfree (tem); > } > > +static bool > +x_selection_for_multiple (struct selection_data *data) > +{ > + return (Atom *) data->data > + == &selection_request_stack->conversion_fail_tag; > +} > + > /* Used as an unwind-protect clause so that, if a selection-converter signals > an error, we tell the requestor that we were unable to do what they wanted > before we throw to top-level or go into the debugger or whatever. */ > @@ -639,7 +646,7 @@ x_selection_request_lisp_error (void) > for (cs = frame->converted_selections; cs; cs = next) > { > next = cs->next; > - if (cs->data) > + if (cs->data && ! x_selection_for_multiple (cs)) > xfree (cs->data); > xfree (cs); > } > @@ -839,8 +846,7 @@ x_start_selection_transfer (struct x_display_info *dpyinfo, Window requestor, > secs = timeout / 1000; > nsecs = (timeout % 1000) * 1000000; > > - if ((Atom *) data->data > - == &selection_request_stack->conversion_fail_tag) > + if (x_selection_for_multiple (data)) > return; > > transfer = xzalloc (sizeof *transfer); No. I will install a better fix and am closing this bug. Don't you think `x_selection_for_multiple' is a misleading name? Did you try to understand the code there? In addition, if you do not write even a real commit message for a patch you attach, or explain what it fixes, you are simply wasting everyone else's time. If you see a bug, it's better to just report it rather than submitting a patch like this.