emacs-devel
[Top][All Lists]
Advanced

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

Re: Unicode confusables and reordering characters considered harmful


From: Stefan Monnier
Subject: Re: Unicode confusables and reordering characters considered harmful
Date: Wed, 03 Nov 2021 15:32:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> +   '(("\N{LEFT-TO-RIGHT EMBEDDING}\\|\N{RIGHT-TO-LEFT EMBEDDING}\\|\
> +\N{LEFT-TO-RIGHT OVERRIDE}\\|\N{RIGHT-TO-LEFT OVERRIDE}\\|\
> +\N{LEFT-TO-RIGHT ISOLATE}\\|\N{RIGHT-TO-LEFT ISOLATE}\\|\
> +\N{FIRST STRONG ISOLATE}\\|\N{POP DIRECTIONAL FORMATTING}\\|\
> +\N{POP DIRECTIONAL ISOLATE}" . (0 'font-lock-warning-face t)))))

A [...] would be a lot more efficient than this "...\\|...\\|...\\|...".

> +(defun bidi-reordering-character-toggle-visibility ()
> +  "Toggle the visibility of bidi reordering characters."
> +  (interactive)
> +  (setq bidi-reordering-characters-visible
> +        (not bidi-reordering-characters-visible))

Aka

    (define-minor-mode bidi-reordering-characters-visible
      "Make the bidi reordering characters visible."
      :global t
      ...)
    (define-obsolete-function-alias
      'bidi-reordering-character-toggle-visibility
      #'bidi-reordering-characters-visible "...")


-- Stefan




reply via email to

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