Adds autocompletion for Python's \N{UNICODE NAME} string escape syntax in Emacs.
Completion is provided via completion-at-point (CAPF), making it compatible with company-mode (using company-capf), corfu, and the built-in M-TAB / C-M-i completion.
- Standard CAPF: Works with any modern Emacs completion UI.
- Lazy Loading: The Unicode name database (~140k entries) is populated from Python on the first completion attempt in a session.
- Fast: Subsequent completions are instant using an internal cache.
- Annotations: Displays the actual character in the completion candidate list.
- Automatic Closing: Appends the closing
}if it's missing.
- Download
python-unicode-escape.eland place it in yourload-path. - Add the following to your init file:
(require 'python-unicode-escape)
(add-hook 'python-mode-hook #'python-unicode-escape-mode)- Emacs 27.1+
python3must be available in yourPATH.
When you type \N{ and trigger completion, the package calls a small Python script to fetch all available Unicode names from the unicodedata module. This list is then cached for the duration of the Emacs session.
MIT License. See LICENSE for details.