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: New feature: displaying ligature characters in the buffer Date: Thu, 27 Jan 2022 09:58:42 +0200 Message-ID: <83czkdfw3x.fsf@gnu.org> References: <87sftk49ih.fsf@yahoo.com> <837dawt0h4.fsf@gnu.org> <838rv9plyf.fsf@gnu.org> <837dasntoj.fsf@gnu.org> <834k5tl4a9.fsf@gnu.org> <5344439E-89EC-42C6-A759-510A981E6884@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30580"; mail-complaints-to="usenet@ciao.gmane.io" Cc: psainty@orcon.net.nz, luangruo@yahoo.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 27 09:18:33 2022 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 1nCzzE-0007kb-63 for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Jan 2022 09:18:32 +0100 Original-Received: from localhost ([::1]:57628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCzzB-0002lF-Uj for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Jan 2022 03:18:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCzgB-00083e-Po for emacs-devel@gnu.org; Thu, 27 Jan 2022 02:58:51 -0500 Original-Received: from [2001:470:142:3::e] (port=51124 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCzgB-0001E7-FQ; Thu, 27 Jan 2022 02:58:51 -0500 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=YfoRbimZ91rkM4dI/T7EtH+h01sgiJSQUvFVn5ojK9E=; b=a95xJnBZX+9S GstecMQImdp9UaMQW4rQntcMbjCoft1YZ6Y5yqYuG8EwYLrZ5P6tfuuQYAJFiPUrjGASU4hWQ4DRp nillOwf40vLlKTkKE0H6K0GD2IVrtEE3UG57VllxBtagdz8j5rddK1PdGZxmL4IaSVFChRIqFzz7K uxAmnCuZS3vJcnvpEBHxwRhocHp5CSvIU+Y2MEUenZqFdzm9BKcomn7p3dF7AO9cIP1VqGBwvoNeZ 091TtMaRep2NKZEepgvYav9jaIjllGHB51xVrFtXwPq45bhs+lpvrodFAbo7480Ku+xur2LwAqPCl mdyeoM+nUUWM0R6P8MlVfg==; Original-Received: from [87.69.77.57] (port=1705 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 1nCzg7-0004CE-VO; Thu, 27 Jan 2022 02:58:48 -0500 In-Reply-To: (message from Richard Stallman on Wed, 26 Jan 2022 23:12:57 -0500) 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:285479 Archived-At: > From: Richard Stallman > Cc: psainty@orcon.net.nz, luangruo@yahoo.com, emacs-devel@gnu.org > Date: Wed, 26 Jan 2022 23:12:57 -0500 > > > I'm guessing that the diamond glyphs you see for some ligatures > > is the way your terminal "supports" these characters. Or maybe > > it lies to Emacs about which characters it supports, or maybe > > the code which queries the terminal about supported characters > > doesn't work in your case for some other reason. > > Those sound possible. > How can I diagnose with GDB what is in fact going on? The code responsible for that is in terminal.c, functions terminal_glyph_code and calculate_glyph_code_table. The latter is called when we first want to find out whether a certain character can be displayed by the terminal, which probably happens during startup. I'd begin by establishing whether the ioctl used by calculate_glyph_code_table succeeds, and if so, whether the terminal tells us that the ligature codepoints do have glyphs in the terminal's font. The relevant Unicode codepoints are U+FB00..U+FB06. Another issue could be with the terminal encoding: terminal_glyph_code only queries the terminal for supported glyphs if terminal-coding-system is UTF-8 -- is that what you have? Or maybe the HAVE_STRUCT_UNIPAIR_UNICODE preprocessor condition doesn't work on your system, in which case these functions return trivial results. The Lisp interface to this is internal-char-font (which on TTY frames calls terminal_glyph_code). Does it return the same non-negative number for all of the ligature codepoints in the above range? If it does, then it could be an indication that the terminal displays the same diamond glyph for all of them, i.e. doesn't really support them. If internal-char-font returns a negative number, it means the terminal cannot support those ligatures, and our processing of that is somehow incorrect or assumes something that doesn't happen; see char-displayable-p.