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#63865: 29.0.90; call-process while owning the X selection hangs other processes Date: Sun, 04 Jun 2023 08:12:34 +0800 Message-ID: <87sfb8m6fh.fsf@yahoo.com> References: <83edmt9j8i.fsf@gnu.org> <87bkhxnhpk.fsf@yahoo.com> <87wn0kn3zu.fsf@yahoo.com> 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="22705"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 63865@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 04 02:13:23 2023 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 1q5bN5-0005kQ-AS for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 02:13:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5bMn-0006SC-ET; Sat, 03 Jun 2023 20:13:05 -0400 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 1q5bMk-0006Rm-Uq for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 20:13:03 -0400 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 1q5bMk-0001y3-Gf for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 20:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5bMk-0002T9-0F for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 20:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jun 2023 00:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63865 X-GNU-PR-Package: emacs Original-Received: via spool by 63865-submit@debbugs.gnu.org id=B63865.16858375769481 (code B ref 63865); Sun, 04 Jun 2023 00:13:01 +0000 Original-Received: (at 63865) by debbugs.gnu.org; 4 Jun 2023 00:12:56 +0000 Original-Received: from localhost ([127.0.0.1]:44511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5bMe-0002Sq-E5 for submit@debbugs.gnu.org; Sat, 03 Jun 2023 20:12:56 -0400 Original-Received: from sonic316-21.consmr.mail.ne1.yahoo.com ([66.163.187.147]:44568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5bMY-0002SV-KI for 63865@debbugs.gnu.org; Sat, 03 Jun 2023 20:12:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685837565; bh=JcBGPOTb2ty/ptV5YNdIGmJuuucPEkx6cMAJYGZF9C0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=nmfWfe+JSBAYuHV3wxLLbt5Z0iPbgy5u3akHaJPXIahp7tO8l58bujOOUf331hTxaDN1rONp1vPeOgYJZpacKwpEmYtz31grBnYiSI9mulgNPOy8NrVpBOptI+lzN1bN7QleYruTx8Sy4nTDEDb8ODdKI50nFWlaKpXh8trdfkIqGOfZEo4SPpbbK7hfAOFkISjXz/GK9IX+tCkus4sSS583AfM+AnPwwXo0Mdxce/bgv/wAWi6ovCg61q/6mJWKU+h0Z/PuYcl60hKtmJ7KknS8sp4hdK5myHDbfuCv+IAWKzgnKoW+/4XEtKlJJrWrY/FvO5x4iEQyPsuoa/qDBQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1685837565; bh=De8adGY8ePxzBGt7q5wnSeQ2seVsnLdmbOvxmnRVR2Q=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=oAoudJIQZEIDveYKYnhzdIoBz85kJD+Xqt2dGmORqi5i6poW0AW2zyq2OiktyvvdQbDGwRmkr/8zSMO1D34s/itmK4mgZg4trURcxmUG+eYB/5eBwt5rGX++rVyVWEaT0aCeHVGyuuRkIQZ6rmfYALjXvKbe+P2vMgIM27A9AKmo4g/GrQP/WQusgTkWP5tCKycCsW0QU54otIwN4s2PN/fFcHO/22vKmBdb3W1SB1iRymP6hYjG2lkVYy+GGurcUEQkhArkYxz62gsqtXnxxLP2E9GfQbTAWplH4hKUKcELjkfi0ox9SBurofQKAvMCPUcsB79G0/xTPz/XsHRzTQ== X-YMail-OSG: XEz50QsVM1lzExU98RldnrcqQXOc49bkGa9OScUVjdIWqwjpbz46Gwt6kMa4Nqj ZTqOBXh1Yeqsz9fjt6DMVyA4PofV46Ui6uxcaRq53ZBN.__55N5t0bPIhbt6TOWLeQKg2F2qQeLp aWiGfwaT.hhUnPFO3TrjsMYxtRi.5beRUf57zvnbxCLg8wI7VJFayCm1bLgJXeCF9MFwRyWj0vJQ iEPs1LDHjQXylbAwu.9nWj36FUSXLRizWayZ4xufPT_lU8oemCwUuxNtFogDJ0VV7EHtLCPfRa9g 8EV9BIEorjxfBmKMc7IAvRHO_FaMKbdsgQw.ypCGYxfFH8.okZFhiT0WHIpt46LvTYMp8AcjCgJf n3MKt3ieaarECVBzYUaUQlhPXh3cFY33yPidji_C9jufdUp_DIezoBkZk.5mmyYoGmgV_OC.h0lf IulqvX8L5xVXJFG7L4Y1fZfSfGxh78VcIXXrbszZimqRahBWVuvER3HIQpv3n7BprtnIT6N2nDVh s1wUjZ5.l027r8oNDDDUeJmvpGOnNvq2TZ7.q.3QvNwfbl4mOkmD8exCt_0eEj0adV7Wav9Ea5f0 fMGbzyz1fYtjk3cS2VspdGlS7xOf6PcUzhQe2u5cKetl6_eEEcxzAPT_Tcf7aFZWqcMTk_p0N6k2 yS.sZNiKXo.y1t0b4Z5gy1l1t5Hb5T67BlIEDoFgZOIKuZhxIj1_EfSbelBaKjwmvCbOdYr2nn2q re4XYeBrfJS4_aLhtRYBYLhun9VeCwHk_Fri4O4Itt46pUQdp2VQzbiTpqeSydWAUo9TQNQxF8Z4 hKEWbuer5eVAFNzBBp194xeT7vl7H57AOZ6e5Gf9.Z X-Sonic-MF: X-Sonic-ID: e7e90793-fa28-4921-8792-bf907f8813b4 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Sun, 4 Jun 2023 00:12:45 +0000 Original-Received: by hermes--production-sg3-748897c457-524hn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5a9c7772353f7991842daced8076beb0; Sun, 04 Jun 2023 00:12:41 +0000 (UTC) In-Reply-To: (Spencer Baugh's message of "Sat, 03 Jun 2023 08:30:57 -0400") X-Mailer: WebService/1.1.21495 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:262887 Archived-At: Spencer Baugh writes: > "Emacs can not respond to selection requests when it is not reading > keyboard input." sounds like a bug to me! Even if it's hard to fix, > it's still a bug. > > If I'm implementing some package and I decide to use call-process for > some long operation, then some user uses my package and it runs > call-process, and they get bored while waiting and switch away from > Emacs, they'll experience a hang in some other application. That hang > seems clearly undesirable! > > (I should mention that Slack (and possibly all Electron applications) > have worse behavior than I originally said: They don't just hang on > paste, their UI hangs completely while Emacs is in call-process. (I > guess these applications are constantly requesting the selection or > something?) Which is an extremely bad experience for the users of > packages which use call-process...) > > I'm personally working around this by replacing call-process with > start-process and accept-process-output. Because otherwise my packages > (and any other package using call-process ever) will cause random hangs > in other applications, which is obviously bad and not something anyone > would want. > > So perhaps call-process on Unix should be reimplemented in terms of > those functions? Or if that would change behavior too much, perhaps > call-process should be deprecated in favor of some new helper built on > those? Do you expect completely arbitrary Lisp code (which may perform _any_ operations, including reading user input) to run inside call-process? Because Emacs runs such code upon receiving a selection request. Hangs in badly implemented programs are a small price to pay for such flexibility. Try getting a clipboard manager: it may resolve the issue.