From d8fc9021a60fd7dd219d64a40bce678a80a35b73 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 6 Nov 2021 18:21:05 +0100 Subject: [PATCH] Make describe-char include emoji combination descriptions * lisp/descr-text.el (describe-char): Output emoji descriptions. --- etc/NEWS | 3 +++ lisp/descr-text.el | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 4f8c03dd9a8..2406342075c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -91,6 +91,9 @@ buffer is already open. Now, the old point is pushed to mark ring. *** New key bindings in *Help* buffers: 'n' and 'p'. These will take you (respectively) to the next and previous "page". +--- +*** 'describe-char' now also outputs the name of emoji combinations. + ** Outline Minor Mode +++ diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 98871164f2a..2a239f81002 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -417,6 +417,7 @@ The character information includes: (display-table (or (window-display-table) buffer-display-table standard-display-table)) + (composition-string nil) (disp-vector (and display-table (aref display-table char))) (multibyte-p enable-multibyte-characters) (overlays (mapcar (lambda (o) (overlay-properties o)) @@ -538,7 +539,8 @@ The character information includes: (setcar composition nil))) (setcar (cdr composition) (format "composed to form \"%s\" (see below)" - (buffer-substring from to))))) + (setq composition-string + (buffer-substring from to)))))) (setq composition nil))) (setq item-list @@ -682,6 +684,11 @@ The character information includes: (if display (format "terminal code %s" display) "not encodable for terminal")))))) + ,@(when-let ((composition-name + (and composition-string + (eq (aref char-script-table char) 'emoji) + (emoji-describe composition-string)))) + (list (list "composition name" composition-name))) ,@(let ((face (if (not (or disp-vector composition)) (cond -- 2.39.2