emacs-devel
[Top][All Lists]
Advanced

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

RE: Character literals for Unicode (control) characters


From: Drew Adams
Subject: RE: Character literals for Unicode (control) characters
Date: Wed, 2 Mar 2016 22:34:54 -0800 (PST)

> And it just struck me that it would be kinda nice if Emacs had a
> literal character syntax for these things...  So. Three options:
> 
> 1) Add a new syntax, perhaps something like ?\ucRIGHT-TO-LEFT-
>    OVERRIDE for the Unicode control characters we care about.
> 
> 2) Add a syntax for all Unicode characters, like ?\ucPILE-OF-POO.
>    We can just write ?đź’©, so this isn't totally necessary, but
>    perhaps it's nice?
> 
> c) Do nothing, and continue writing code like the code above.  Or
>   start using the Unicode control characters directly in the code,
>   but ‮there lies madness‬.  (Note Unicode control characters around
>   the last part of the previous sentence.)

4) (or is it d? ;-))

Continue to write code like that above.  When it helps, add a
comment showing or describing the char.  Or be able to hit a
key to describe the char whose code is at point:

(defun describe-char-code-at-point ()
  "Describe character whose code is at point."
  (interactive)
  (let* ((sexp  (thing-at-point 'sexp))
         (chr   (and sexp  (read sexp))))
    (unless (characterp chr) (error "No character code at point"))
    (with-temp-buffer
      (insert chr)
      (describe-char (1- (point))))))

Use it with point anywhere on a char code, e.g., #x202e, to
see its description, including, e.g.:

  name: LEFT-TO-RIGHT OVERRIDE
  general-category: Cf (Other, Format)
  decomposition: (8237) ('‭')



reply via email to

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