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: Can watermarking Unicode text using invisible differences sneak through Emacs, or can Emacs detect it? Date: Mon, 24 Jan 2022 14:14:06 +0200 Message-ID: <834k5tl4a9.fsf@gnu.org> References: <87sftk49ih.fsf@yahoo.com> <837dawt0h4.fsf@gnu.org> <838rv9plyf.fsf@gnu.org> <837dasntoj.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11230"; 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 Mon Jan 24 13:16:58 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 1nByHJ-0002kD-93 for ged-emacs-devel@m.gmane-mx.org; Mon, 24 Jan 2022 13:16:57 +0100 Original-Received: from localhost ([::1]:52606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nByHI-0005X5-3i for ged-emacs-devel@m.gmane-mx.org; Mon, 24 Jan 2022 07:16:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nByEo-0004fa-UR for emacs-devel@gnu.org; Mon, 24 Jan 2022 07:14:22 -0500 Original-Received: from [2001:470:142:3::e] (port=35086 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 1nByEo-00013I-EF; Mon, 24 Jan 2022 07:14:22 -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=dmjmhlHHHZJvmB9BDZMBnxyBEbWUBi8RzbqzJ6CkQd8=; b=XfOKieBVj5Rq ITVHXZXLzbeVKbPY2clfi7V5DzhlLhrfGWAbpy0VvpfK40bhOclnBZAw4WTxobxoQai27Aefc/505 tqliJsWY2U8cN1CRbrWgloO7zhcQJ/sYh+Mdej00B7skxqAfL1uazUQm/rGBLeC4MDHG/6hRLAqq6 9iZGSrPQekFyrYdNb5LKX2F84zdhduuRkuDYupqr8TBdMkxjYGC7z5HBxTHooyADoqGTHTbCS+uDD NKpb1M3f/eoVwYwIGB43oI/dfmx2gjfUJuF07Uj0gcPxj8FOUW+ifYkrRG7dJl/k4wbiNO2HG5k7Q 7JHJMOzT5fRIIOHbrGhwtg==; Original-Received: from [87.69.77.57] (port=3407 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 1nByEm-0007ZX-Eo; Mon, 24 Jan 2022 07:14:20 -0500 In-Reply-To: (message from Richard Stallman on Sun, 23 Jan 2022 23:33:59 -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:285301 Archived-At: > From: Richard Stallman > Cc: psainty@orcon.net.nz, luangruo@yahoo.com, emacs-devel@gnu.org > Date: Sun, 23 Jan 2022 23:33:59 -0500 > > > We don't have a way of determining whether a terminal can display > > ligatures. > > Could we do it via terminfo? We can define any capabilities we like. I don't think this is feasible. But before we discuss this, I think we need to clear some fundamental misunderstanding about this, see below. > > > I doubt any user wants to see a diamond instead of `fi'. > > > Is this what really happens for you, on your terminal? > > Yes. A few days ago I put point on a diamond, typed C-u C-x =, > and was told it was a ligature for `fi'. How did that ligature get written to the screen? Was it present literally in some text that Emacs displayed? If not, how did it come into existence, in the form of a diamond? Emacs doesn't produce such ligatures on TTY frames. > I didn't save details of what text I was looking at, but I suspect > it was a web page that a script fetched and emailed to me. If that web page included a literal fi ligature, there's little we can do in Emacs, because we don't produce that character. Of course, one can set up a display table where ligatures like fi are displayed as two characters, but that is a separate issue, very far from what we were discussing in this thread. So let's please leave the literal fi display alone, because it will take us far away from the original issue. The original issue is with sequences of characters that are supposed to be composed on display, because that's where the zero-width characters play their role. When several characters are supposed to be composed on a text-mode display, Emacs simply writes them to the terminal one after another, and expects the terminal to display them as a ligature. The only difference between what Emacs does in this case and what it does when no character composition is expected is that in the former case Emacs expects the terminal to produce just one glyph that takes just one column on display. Emacs never actually writes the ligature's code to the TTY, unless that code is literally present in the text. So I don't see how querying the terminal about ligature support will help us in the case we are discussing, nor do I see how is that relevant. In any case, ligature support is not just the ability of a terminal, it also requires certain features from the font used to display text, and on TTY frames Emacs doesn't know which font is being used where. Moreover, there's any number of possible ligatures, and which ones are supported depends on the font, so a question like "are ligatures supported" has no meaningful answer unless you also specify the font and the particular ligature.