[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unicode confusables and reordering characters considered harmful
From: |
Andreas Schwab |
Subject: |
Re: Unicode confusables and reordering characters considered harmful |
Date: |
Wed, 03 Nov 2021 12:29:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
On Nov 03 2021, Gregory Heytings wrote:
> diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
> index db350a5f70..0005d3d4d7 100644
> --- a/lisp/progmodes/prog-mode.el
> +++ b/lisp/progmodes/prog-mode.el
> @@ -289,6 +289,24 @@ turn-on-prettify-symbols-mode
> (local-variable-p 'prettify-symbols-alist))
> (prettify-symbols-mode 1)))
>
> +(defun fontify-bidi-reordering-characters ()
> + (font-lock-add-keywords nil '(("\\|\\|\\|\\|\\|\\|\\|\\|" .
> 'font-lock-warning-face))))
> +
> +(defun make-bidi-reordering-characters-visible ()
> + (setq buffer-display-table (or buffer-display-table
> + standard-display-table
> + (make-display-table)))
> + (aset buffer-display-table ? [?→])
> + (aset buffer-display-table ? [?←])
> + (aset buffer-display-table ? [?→])
> + (aset buffer-display-table ? [?←])
> + (aset buffer-display-table ? [?→])
> + (aset buffer-display-table ? [?←])
> + (aset buffer-display-table ? [?↓])
> + (aset buffer-display-table ? [?↑])
> + (aset buffer-display-table ? [?↑])
A perfect example of how legitimate use of these characters can mess up
your source. :-)
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
- Re: Unicode confusables and reordering characters considered harmful, (continued)
- Re: Unicode confusables and reordering characters considered harmful, Eli Zaretskii, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Manuel Giraud, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Eli Zaretskii, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Manuel Giraud, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Eli Zaretskii, 2021/11/04
- Re: Unicode confusables and reordering characters considered harmful, Eli Zaretskii, 2021/11/04
- Re: Unicode confusables and reordering characters considered harmful,
Andreas Schwab <=
- Re: Unicode confusables and reordering characters considered harmful, Stefan Monnier, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Yuri Khan, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Stefan Monnier, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Gregory Heytings, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Stefan Monnier, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Yuri Khan, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Gregory Heytings, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Gregory Heytings, 2021/11/03
- Re: Unicode confusables and reordering characters considered harmful, Gregory Heytings, 2021/11/04
- Re: Unicode confusables and reordering characters considered harmful, Eli Zaretskii, 2021/11/03