From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Ligature support Date: Fri, 05 Nov 2021 22:30:47 +0200 Message-ID: <838ry2cpl4.fsf@gnu.org> References: <83v916d64z.fsf@gnu.org> <878ry2k6qz.fsf@gnus.org> <83tugqd488.fsf@gnu.org> <87zgqiiq8c.fsf@gnus.org> <83r1bud3or.fsf@gnu.org> <87r1buipf5.fsf@gnus.org> <83o86yd0ig.fsf@gnu.org> <87a6iiimay.fsf@gnus.org> <20211105171356.GB24570@tuxteam.de> <83ee7uct47.fsf@gnu.org> <20211105195245.GC24570@tuxteam.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13325"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: tomas@tuxteam.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 05 21:31:50 2021 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 1mj5sM-0003HD-JC for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 21:31:50 +0100 Original-Received: from localhost ([::1]:44944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mj5sL-0007MO-7n for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 16:31:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj5rf-0006gV-1G for emacs-devel@gnu.org; Fri, 05 Nov 2021 16:31:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj5re-0004OU-D2; Fri, 05 Nov 2021 16:31:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=inhUMObVAIpFpd1bAt7zV/1e9d4r9WsG1zyDRr7QU4s=; b=osPyuUNxkjIH 16nKilryK6UlW062A7Y3Dg4sgDsRRia5tSOSZX+6QPYRhu9e2HFmcJXb2f0EUGH8MneTtCF3/jylW l0zYRDT77j16/UBhgEpSGNTwFG0SO7oDEvfUme3nclLDb9M7H6VXXrOfuQhqiH3e1DnZAf+Q3rB2y WANNV+6Z9QI+u1+RtaLtwi2MCFdKdwLorLZQa79/xQFLsGEDkG0DGWcUp4u79MkEu09L2vbrk4oO7 ITVq7fRJuj8hgoML05AQUHbOpB2smnmGPJYfGPF0u5AVgYmTnyjOhn2SGttAJXUXsdiJTqcsLUSYb Fd+G/HAvPQ/Y0UCQWK2TNw==; Original-Received: from [87.69.77.57] (port=3894 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj5rd-0004ot-1Y; Fri, 05 Nov 2021 16:31:06 -0400 In-Reply-To: <20211105195245.GC24570@tuxteam.de> (tomas@tuxteam.de) 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" Xref: news.gmane.io gmane.emacs.devel:278809 Archived-At: > Date: Fri, 5 Nov 2021 20:52:45 +0100 > From: tomas@tuxteam.de > Cc: emacs-devel@gnu.org > > > > it would have to know (or guess?) the language it is treating. > > > > We do pass the language to HarfBuzz when we think we know it, but the > > problem is Emacs itself has no good notion of the "current language". > > This is what I was pointing at. Well, don't just point to the obvious: better sit down and code some features that we can use to be smarter ;-) > If the text itself is multilingual, your best bet is to ask the user Asking the user during redisplay is a non-starter. > and your second-best bet is to do some statistical heuristics, which > only will "work" for a longer stretch of text. That's a waste of CPU cycles: when we don't know the language, we ask HarfBuzz to guess, and I trust HarfBuzz that it can guess as well or better as we can. > > Such a notion is problematic in a multilingual editor such as Emacs. > > It is something we still need to figure out, and after that implement > > the necessary infrastructure. What we have now is rudimentary and > > very insufficient. > > I think that will always be an approximation. Maybe, maybe not. I Hope at least sometimes we could do better. there are various hints in the form of the encoding, the source of the text, etc. We just need to figure out which means we have for gleaning the language that is not obvious from the characters themselves (because HarfBuzz does the latter already), and provide the features for Lisp programs and users to use them.