emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can watermarking Unicode text using invisible differences sneak thro


From: Eli Zaretskii
Subject: Re: Can watermarking Unicode text using invisible differences sneak through Emacs, or can Emacs detect it?
Date: Sun, 30 Jan 2022 09:36:48 +0200

> From: Richard Stallman <rms@gnu.org>
> Cc: psainty@orcon.net.nz, luangruo@yahoo.com, emacs-devel@gnu.org,
>       kevin.legouguec@gmail.com
> Date: Sat, 29 Jan 2022 23:17:21 -0500
> 
>   > IIUC what you mean by "this feature", we already have that in
>   > latin1-disp.el.
> 
> It is the same general idea, but (according to the comments at the
> start) it handles only the characters in the ISO 8859 character sets.

That comment is obsolete; I've updated it now.  There are facilities
in that package that display much more than ISO 8859 characters, see
latin1-display-ucs-per-lynx.

> It should handle all the Unicode characters that could sensibly be
> represented as characters to be composed, including ligatures and all
> Latin and Greek characters with diacritics.  Maybe some others can be
> handled too.

Ligatures are currently not there, and I think it would make sense to
have that as a separate command, as I suggested in another email
(which you still didn't respond to).  I'm waiting for your response
before I decide whether to install such a feature.  The question I
asked was:

  Would it be good enough to have a command that will arrange for these
  ligatures to be displayed as their ASCII equivalents, using the
  facilities in latin1-disp.el?  Such a command could be invoked either
  manually or from your init file.  latin1-disp.el also provides a
  special face to display such equivalents, so you could have them stand
  out on display if you want.

> I customized the variable to enable that mode but I don't know how to make it 
> actually do
> anything.  Maybe it needs something else to truly enable it.

If you customized latin1-display, then it only affects characters that
your terminal doesn't support.  The code dynamically discovers which
characters are those when you activate the feature.  See this fragment
from the setup function:

  (defun latin1-display-setup (set &optional _force)
    "Set up Latin-1 display for characters in the given SET.
  SET must be a member of `latin1-display-sets'.  Normally, check
  whether a font for SET is available and don't set the display if it is."
    (cond
     ((eq set 'latin-2)
      (latin1-display-identities set)
      (mapc
       (lambda (l)
         (or (char-displayable-p (car l))  <<<<<<<<<<<<<<<<<<<<<<<<<<
             (apply 'latin1-display-char l)))

> I inserted ẵ (latin small letter a with breve and tilde); it does not
> do anything special to that.

ẵ is not supported by latin1-display, as it is not an ISO 8859
character.  You need to turn on a more thorough feature.  Try this:

  M-x latin1-display-ucs-per-lynx RET

>   > Given the enormously large number of such sequences, I doubt that
>   > terminfo is the right means for determining which sequences are
>   > supported.  We have a solution for the Linux console,
> 
> We do?  What is it?

The same code I pointed to in response to your other message (about
displaying ligatures as diamonds): terminal_glyph_code and its
subroutine calculate_glyph_code_table (in terminal.c).

> I don't think auto-composition does anything in my Emacs.  If I insert
> an f and an i in the buffer, they display as two characters, f followed by i.
> Not as a ligature.

We haven't yet installed composition rules for ASCII ligatures,
because we need first to resolve some basic problems with them (see
etc/TODO for the details).  I could show you how to install such a
composition rule, but I don't think it will do anything on your
console, since it doesn't support ligatures.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]