From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#42028: [Feature Request] 27.0.91; Provide the ability dynamic modules to post events in emacs event loop Date: Wed, 24 Jun 2020 21:04:52 +0300 Message-ID: <83y2ocs5kr.fsf@gnu.org> References: <875zbh0wbf.fsf@gmail.com> <83bll8ttet.fsf@gnu.org> <83366ktol5.fsf@gnu.org> <83zh8ss87t.fsf@gnu.org> <874kr0gyhi.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="40232"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42028@debbugs.gnu.org To: Ivan Yonchovski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 24 20:06:12 2020 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 1jo9mj-000AIE-Fy for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 20:06:09 +0200 Original-Received: from localhost ([::1]:38478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo9mi-0008DF-Az for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jun 2020 14:06:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo9mc-0008D9-6Q for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 14:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jo9mb-0002Lk-U4 for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 14:06:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jo9mb-0001HE-Og for bug-gnu-emacs@gnu.org; Wed, 24 Jun 2020 14:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Jun 2020 18:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42028 X-GNU-PR-Package: emacs Original-Received: via spool by 42028-submit@debbugs.gnu.org id=B42028.15930219194848 (code B ref 42028); Wed, 24 Jun 2020 18:06:01 +0000 Original-Received: (at 42028) by debbugs.gnu.org; 24 Jun 2020 18:05:19 +0000 Original-Received: from localhost ([127.0.0.1]:38871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo9lu-0001G8-DQ for submit@debbugs.gnu.org; Wed, 24 Jun 2020 14:05:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jo9lr-0001Ft-60 for 42028@debbugs.gnu.org; Wed, 24 Jun 2020 14:05:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53321) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo9lm-00024F-05; Wed, 24 Jun 2020 14:05:10 -0400 Original-Received: from [176.228.60.248] (port=2864 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jo9ll-0006EM-BL; Wed, 24 Jun 2020 14:05:09 -0400 In-Reply-To: <874kr0gyhi.fsf@gmail.com> (message from Ivan Yonchovski on Wed, 24 Jun 2020 20:33:29 +0300) 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" Xref: news.gmane.io gmane.emacs.bugs:182352 Archived-At: > From: Ivan Yonchovski > Cc: 42028@debbugs.gnu.org > Date: Wed, 24 Jun 2020 20:33:29 +0300 > > > You cannot easily post to the queue from a worker thread, because the > > queue cannot be posted to asynchronously. > > AFAIK this is not possible at all - thus this feature request. Your feature just asked for a way to queue events, it didn't say anything about doing that asynchronously, not from a function invoked by the main thread. If you mean the latter, then it AFAIU would need a serious redesign of the Emacs event queue, to make it accessible from several threads running in parallel at once. > > Again, I don't see the wider picture. Are you familiar with how the > > current JIT font-lock works? If so, can you explain which parts of > > that will be replaced/modified, and how? > > AFAIK the initial tree-sitter parsing (which does not involve anything > emacs related) may take 200-300ms. In other editors (e.g. vscode) this > part is not happening on the UI thread but in some extenal background > thread which then passes the AST to the main UI thread to do the actual > fontlock. IMO this model might be replicated in emacs in the event of TS > integration. What you describe is very different from how JIT font-lock works now. Which is why I asked the question: I know (more or less) how it works in other editors, I just don't yet understand well enough how something like that would fit into the existing fontification framework. I hope there is a way of fitting it, because otherwise it would mean a serious surgery of the display engine as well, which will make the job significantly larger and harder.