From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#13697: A way to tell if Emacs can interact with the user Date: Wed, 03 Apr 2019 18:56:26 -0400 Message-ID: <87ef6ig0kl.fsf_-_@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="220488"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) Cc: 13697@debbugs.gnu.org To: Trey Ethan Harris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 04 01:10:06 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBp1C-000vEK-3t for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Apr 2019 01:10:06 +0200 Original-Received: from localhost ([127.0.0.1]:56076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBp1A-0001Bg-QI for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Apr 2019 19:10:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBp10-0000xI-Kw for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2019 19:09:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBoob-0000cQ-Gj for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2019 18:57:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58100) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hBooY-0000Q1-3f for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2019 18:57:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hBooX-00063Z-Vp for bug-gnu-emacs@gnu.org; Wed, 03 Apr 2019 18:57: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: Wed, 03 Apr 2019 22:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13697 X-GNU-PR-Package: emacs Original-Received: via spool by 13697-submit@debbugs.gnu.org id=B13697.155433219723250 (code B ref 13697); Wed, 03 Apr 2019 22:57:01 +0000 Original-Received: (at 13697) by debbugs.gnu.org; 3 Apr 2019 22:56:37 +0000 Original-Received: from localhost ([127.0.0.1]:43411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hBoo8-00062w-LZ for submit@debbugs.gnu.org; Wed, 03 Apr 2019 18:56:36 -0400 Original-Received: from mail-qt1-f177.google.com ([209.85.160.177]:39161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hBoo6-00062k-R3 for 13697@debbugs.gnu.org; Wed, 03 Apr 2019 18:56:35 -0400 Original-Received: by mail-qt1-f177.google.com with SMTP id t28so1058596qte.6 for <13697@debbugs.gnu.org>; Wed, 03 Apr 2019 15:56:34 -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=OefWYsOdmdHIGyR6RjC0ube5qgyI3xQvsBV1GSXK1ls=; b=aN7rJtuHKgDyQxUYFn+t3+qlrfs9/zgHHz3o/H47LCeLIko1MpjSTsQ7mcaSuIuJ50 aca96SXEqQlfAxpGTfjSEra1v+wcmCYX912S+1+Z76I6rm7LPf3ydCVIctNlEs8Asjfm 40AnjmttgmDBBhFzVDQOWulYcWKHz6Nky+5EooGYdJvVHB0nVj8L9SHSepUfwaSvPort XljE8qHgtRMXGU5suV0qOkSuyim+fc+uCZ0HBpPDO3lafNWt8TpTIXj1RWo4IVSUI4HP zK8jW+WOHkAgevG4p2fPJPUIKgmADK0w9xClDxlYXcaLrUDzFadOo+n9XUBVqVbJFB4d O87A== 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=OefWYsOdmdHIGyR6RjC0ube5qgyI3xQvsBV1GSXK1ls=; b=fBgF6PYNCV9IrnqRWi5PWZVuRFHv7JbJfSNj3IbWM2c8I6bvgkO6S+GknXWiXJN25z oj/PYCSLqwPg+Y23rgcTQWJwgo+iiWERpxTp+C13T5T/qCBJsW+dwxQRWLiTfes5sBqI JAM4wz8sfjSgyAi7EJEAX33h/v3+gzMDGLBLnhKH9wiubIBpya5z+WpC7jFa2TaXq7OQ wf7e8lW/KVZA43IN4D5dn1YSkheHOCENoELnCa7Xx95FYjiaSnOvhstKErkAm0vCtdOs Cmq8wFq+HiGRixEcVNBDHRZq21Pvrzr5ycmwO3BBgw9RW6t8g9NnPeyzxuK1nBfnRe1u bhGw== X-Gm-Message-State: APjAAAXAFAg/RP++s9OiaeaJDfrFdNkgE1MVUKwPlCHbTiqan3VDG3uI lMxp/ze9t0t+IJrQuOnaFGi//6W9 X-Google-Smtp-Source: APXvYqz+my4MXlaPVDUTMQsi/hd++BOdyhRbAC28rCAakfoBUtfwRZLju+5PrgXyaK4LN4zwLvpiCw== X-Received: by 2002:ac8:2a9a:: with SMTP id b26mr2527350qta.267.1554332188819; Wed, 03 Apr 2019 15:56:28 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id y10sm9911505qki.62.2019.04.03.15.56.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 15:56:27 -0700 (PDT) In-Reply-To: (Trey Ethan Harris's message of "Wed, 3 Apr 2019 17:01:38 -0400") 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: 209.51.188.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:157145 Archived-At: Trey Ethan Harris writes: > As described in the Emacs Stack Exchange question, > https://emacs.stackexchange.com/questions/32692/daemon-mode-defer-interactive-prompts-on-startup/ > , this bug seems to be applicable and should be reopened. [I've restored the original bug title as the subject, since "reopened" is a bit lacking in context. And by the way, this bug was never closed in the first place] > But Emacs _could,_ I think, provide a 99% solution: > > 1. Intercept interaction functions like `yes-or-no-p` and password prompts > running in asynchronous threads, allowing them to block their thread > 2. Automatically convert interaction in other threads into a warning failure > 3. Continue execution of other threads so that the server can start > 4. Upon first connection with an emacsclient, display the warnings > (presumably by popping up *Warnings*) so that the user is aware of what may > have failed in initialization due to inability to interact > 5. Take the user through the queued blocked threads so they can complete > the threaded interactions. Hmm, I'm not sure where all these threads you're talking about will come from. Emacs is still mostly single-threaded, and we still have stuff like Bug#25214 "Interacting with user from threads other than the primary" open.