From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs design and architecture Date: Fri, 15 Sep 2023 11:32:05 +0200 Message-ID: References: <873503y66i.fsf@yahoo.com> <87fs3ur9u8.fsf@dataswamp.org> <875y4moiiq.fsf@dataswamp.org> <83r0n4rj78.fsf@gnu.org> <83cyynpmvd.fsf@gnu.org> <838r99mh40.fsf@gnu.org> <83h6nwlmt4.fsf@gnu.org> <456d12ac-ecf4-3de4-56bb-a2440580777f@gutov.dev> <83a5tokmsv.fsf@gnu.org> <83sf7fki5g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16547"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Yuri Khan , dmitry@gutov.dev, owinebar@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 15 11:33:03 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qh5CB-00043t-6m for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Sep 2023 11:33:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qh5BP-0005T3-Hc; Fri, 15 Sep 2023 05:32:15 -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 1qh5BM-0005Ow-EN for emacs-devel@gnu.org; Fri, 15 Sep 2023 05:32:13 -0400 Original-Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qh5BK-00076W-LL; Fri, 15 Sep 2023 05:32:12 -0400 Original-Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-52683da3f5cso2376896a12.3; Fri, 15 Sep 2023 02:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694770328; x=1695375128; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U/YLQv9pUm9ARF+rZxISAX+73SA3UL5hZMAK14sgTfo=; b=S8Y5yPw1QQayrQxoJQe90avje8lrLLchFdHpv8CDTm/VKieGJ7ezfP054XiEBPTbaV fJy5LZMWD/mCiSGZgVOniXSNWdBEyhj7dcGLbdEarLE7nGl3lzNrN1SBYIE/cGHp3SR1 glvooOXMV+xBj+F9ELjyv/C5cX0FMC7IzdKk4urwcwvrVfY4fhxktL3UXZdcoqOgX8M1 r9IGRpaaciUBDCDFZRDKb0AlBaMbmaX5xk3Z3y1Rc+Q9cGgMBvPGL6mTeVV0h9ggV6Jf 1HR7xspBk9SztmRFISmUQWcWg+G9rnWmSzReksahvX623KrcsGTmhCWzAUy4BwfNjyDw ECuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694770328; x=1695375128; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=U/YLQv9pUm9ARF+rZxISAX+73SA3UL5hZMAK14sgTfo=; b=mrFMV+Bg1H7mg6exbpCsVesT4E1NwldL+Rl5vRBStd3AS14IXhmI/hCAeOMXoPeKfm i2UWmy8pgASG8wkEH+m+DX6fv0wP198B5w8YdfxaAgUfmJJI6jw5B2nGR9tKJYCQuS29 B0QREvkr0C83KGNkBZBNtK9q+KZAehuO91iEZiUvEbHOMdrb8RIXKGZXlGWA2EIIlJKR ENBKKKkB+ixc4O8+aVyzPkO4mQdtKSZ4WJTsmy+dFqf8N14Xr2/FTtYn+gV/v4aQ0tAg mCs3GV3e5Nm4IEd4IoiysDxAtyBxWRAz5ATjX8ZJf18x1iRjZSRcqCQcKkcF65XtTWBa Mx+A== X-Gm-Message-State: AOJu0YxoMHwddG6KVhEFh0cmmBBUb/5dbXF1jDmc3bVgCom88UkAw2JF ms84FXz0Uu89KmwaYZybNaMUBhCHGiiaRbl5 X-Google-Smtp-Source: AGHT+IHvKTT7QuH/U2NnfbtNd8L4uHTG/r5j7YoQUA+O0js97YK2NEW3nvFLAjGSKJvuzGk21m5ILg== X-Received: by 2002:aa7:c914:0:b0:530:6a34:24f7 with SMTP id b20-20020aa7c914000000b005306a3424f7mr998764edt.20.1694770327851; Fri, 15 Sep 2023 02:32:07 -0700 (PDT) Original-Received: from Pro.fritz.box (pd9e36d0d.dip0.t-ipconnect.de. [217.227.109.13]) by smtp.gmail.com with ESMTPSA id z10-20020aa7c64a000000b0052c11951f4asm1971526edr.82.2023.09.15.02.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 02:32:07 -0700 (PDT) In-Reply-To: <83sf7fki5g.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 15 Sep 2023 10:30:35 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310595 Archived-At: Eli Zaretskii writes: >> From: Yuri Khan >> Date: Fri, 15 Sep 2023 13:51:56 +0700 >> Cc: Dmitry Gutov , owinebar@gmail.com, rms@gnu.org, em= acs-devel@gnu.org >>=20 >> On Fri, 15 Sept 2023 at 12:51, Eli Zaretskii wrote: >>=20 >> > One of the important aspects to keep in mind in this regard is that >> > Emacs must give Lisp programs dynamic control of how stuff is >> > displayed, and should be able to exercise that control at high >> > frequency (a trivial example: pulse.el). >>=20 >> In CSS, this is solved in core with transitions. A style specifies >> that a certain property will change gradually, provides its target >> value, the transition duration, and a transition curve. > > You have taken the pulse.el example too literally. The fact that it > changes the color gradually is not relevant to the point I was trying > to make, but you made it the main point. > > My point is that quite a few Lisp programs affect the display in > near-real time and at high frequency. This is what makes Emacs so > powerful, and we don't want to lose this power when changing the > display engine. > >> The use case of pulse.el would be translated to a couple of styles >> that say effectively =E2=80=9CA pulsed span will instantly gain yellow >> background=E2=80=9D and =E2=80=9CA non-pulsed span will linearly revert = to whatever >> background it had over the course of 200 milliseconds=E2=80=9D and a sma= ll >> function that sets the span to pulsed and then immediately to >> non-pulsed. > > This sounds like a lot of hair, when a Lisp program just wants to > change the color of some part of the display. > >> (Implementing a CSS engine over a character terminal is a nontrivial >> matter though.) > > Something else to keep in mind, I guess. TTY colors are implemented > specially and separately in Emacs (under the hood; Lisp programs can > disregard the differences if they want), so it isn't a non-starter, > per se. I think it would maybe be good to think about the following: Random thoughts about a parallel redisplay, from a height of 10 km. What currently happens to bring changes to the screen is that redisplay is called quite frequently in the course of processing input for example. Redisplay determines what part of the a "model" (buffer) has changed, if any. It makes sure that all info it needs to proceed is available; think jit-lock, i.e. it calls Lisp. Because redisplay is called frequently, it must minimize what it does, which is the reason for the complicated optimizations there. Whatever is done in the end, I think it would first be necessary to change this general principle, so that layout/drawing whatever can happen in parallel. Without that, I suspect redisplay would get too slow, or would finally collapse to a black hole by its complexity. This of course, would pose several problems. - This form of parallel redisplay cannot call Lisp, so no jit-lock, no hooks, or whatever during redisplay. And at the point where we call redisplay today we don't know what will be displayed... - Parallel redisplay also needs either a copy of what it to be displayed, or the model must be some persistent data structure that makes immutable versions of buffer-text, for instance, available.