From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: Ligatures Date: Tue, 19 May 2020 16:16:53 +0000 Message-ID: References: <20200517124125.000013a4@web.de> <97C7EAB7-10AB-4702-ABC8-EB6C1C50ABDB@gnu.org> <20200517165953.000044d2@web.de> <83lflqblp0.fsf@gnu.org> <83ftbybio3.fsf@gnu.org> <83zha69xs2.fsf@gnu.org> <83367x9qeq.fsf@gnu.org> <875zcs32fv.fsf@Otto.invalid> <83eerg80u6.fsf@gnu.org> <834ksc7za9.fsf@gnu.org> <83wo586inp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="63777"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stromeko@nexgo.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 19 18:18:33 2020 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 1jb4wq-000GRs-1z for ged-emacs-devel@m.gmane-mx.org; Tue, 19 May 2020 18:18:32 +0200 Original-Received: from localhost ([::1]:52882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb4wp-0004hS-43 for ged-emacs-devel@m.gmane-mx.org; Tue, 19 May 2020 12:18:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb4vu-0004Ea-7z for emacs-devel@gnu.org; Tue, 19 May 2020 12:17:34 -0400 Original-Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:37067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb4vs-0007FD-Aa; Tue, 19 May 2020 12:17:33 -0400 Original-Received: by mail-ot1-x329.google.com with SMTP id x22so7956238otq.4; Tue, 19 May 2020 09:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cOQCgKvVzksujtalVsX1Tihh7TxtJpo67c6uBNakP9c=; b=T/LntZOG7I6CYuxhFK59TAI1qjRcgCbloXnBJ9UR0rGWwvh2FUz4IPGaE0GqOyZaqU jxXGa+y/N4WGfZf/UdaGibcNZeLaDFtTPk5BO8VzxejFykvLeDDjYCKA4Bxu/LZ/byvd 6mtJrIc4ocJ8RzwBtZiuq/8PRpL/h2QB4+L8PV5bgLu/zBCaYc0JGvWlw81iTtLtHMoV t+sY/vBKQqsGY2ngjabHx0z2l9n3Z1WtBPnBU10NoCk7GlFmX6joIzzr+wzbaPHt6guU Z8fLK8+tWkY2iJl7GuVXKR6sDh1xGs8RuvNn3GPhmquNjumvu4CC7hPV7vSa3biXEtwm fxpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cOQCgKvVzksujtalVsX1Tihh7TxtJpo67c6uBNakP9c=; b=edQHwygRaDr4yFluPNFNjQ4gZtelNPkphVaN69YGZkX2v7EFpP940NSoyGIox90rkF WwIJZ8R0xCFFeieHz/H6tEQNibaZiJ1aYMu6bAPkNOudbfq5eESorQyXBeOQoQtXS9VQ y/Unui25XAfcnk8fyHcbfKzLJD1QfrI4qDIJOPuN6AamSMKCHGB0w+MWKL6Mh9lvEIx4 PUQL2Qj85xorR6NbfcAnuK2gVFeKHqazxDy13Suy7LeWCNImXnR4FK4lOVWxi3a3bcWE 9mue+gQeQl8R43AtZM2EmLJr6LiK9NpfWX+00dzJF7HCrcv+f99pW+pS/ZvMuXe8CqLT KRFg== X-Gm-Message-State: AOAM533ReFnRa/BF2JhK++TzZCfDGCSv0DkPt4i0mfCXyvkC1v0TQqvS MDTeg5ZO4s0dDIZoHhHoAaJe8IzMxrHCHK7vAiW6tXA5 X-Google-Smtp-Source: ABdhPJwTXCHij4dTik6xgc/aVTPUzdxpX5MkEZFGsatCpKyzVxo/6iYxqyyjqKPeFYPQUxkd1occMU+XlkxRk4jKOII= X-Received: by 2002:a9d:6a44:: with SMTP id h4mr12549500otn.287.1589905050157; Tue, 19 May 2020 09:17:30 -0700 (PDT) In-Reply-To: <83wo586inp.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::329; envelope-from=pipcet@gmail.com; helo=mail-ot1-x329.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_BL=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:250963 Archived-At: On Tue, May 19, 2020 at 3:36 PM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Tue, 19 May 2020 15:11:27 +0000 > > Cc: Stromeko@nexgo.de, emacs-devel@gnu.org > > > > On Tue, May 19, 2020 at 2:52 PM Eli Zaretskii wrote: > > > Btw, there's one subtle issue that will need to be resolved if we are > > > to have this feature of "sub-glyph" cursor movement inside composed > > > characters. The way we currently display the default block cursor is > > > by simply redrawing the glyph at point in reverse video. So we don't > > > have a way of displaying a cursor that "covers" only part of a glyph. > > > > I thought that was what glyph_row->clip was for. > > We could use that, but that's not the main problem. Sorry, I genuinely don't understand what the problem is. draw_glyphs is called by draw_phys_cursor_glyph, so all we need is a line or two of extra code in draw_phys_cursor_glyphs to set row->clip to the rectangle surrounding the subglyph the cursor is on. No further change of the display engine is required for that, is it? > The problem is that we need to change how the cursor is drawn, from > the control flow POV. That's a separate thing that, yes, we need to do. Because optimizing for TTYs is no longer appropriate. But I don't see why we need to perform this large change before performing the little one that makes things work for subglyphs. > We'd need to audit the code and see that the > information required for drawing the cursor is available when we are > drawing the text. And then there's the popular use case where nothing > changes except the cursor position, in which case no text is redrawn > at all. Except for the glyphs the cursor is on, right? Those are redrawn by draw_phys_cursor_glyph, or am I missing something here? > > > To make this happen, we'd probably need to draw the cursor as part of > > > drawing the glyph foreground and/or background, which is against the > > > > I believe that's a change we should make anyway: late cursor drawing > > makes sense on TTYs with physical cursors, but on GUI backends, we > > should simply use a special face for drawing the struct glyph a cursor > > is on, IMHO. > > It cannot be a single face, because the "thing under cursor" can be > anything, and can have different colors. Agreed. > We will need to merge faces, > which is slower than the current simple but effective method, which > completely sidesteps the issue. I believe performance concerns are an entirely different subject (put briefly, my opinion is that we've painted ourselves into a corner by micro-optimizing fast loops over an essentially inefficient basic design). > in any case, using a face doesn't solve the main problem, as we'd > still need to draw the glyph with partial colors. Which we can do by setting glyph_row->clip? I don't see how there's any problem here at all. Again, I see three totally separate problems here: 1. draw a box cursor over a partial glyph 2. improve the display engine to handle cursor(s) like other highlighting on graphical terminals 3. identify and counteract actual performance problems in the redisplay engine I still don't see how (1) depends on (2), and I think I disagree with you on the subject of (3), because I think we need to fix the design first, moving a lot of C code out to Lisp, then see where things actually chafe and maybe move some special code back to C.