From ac2cecbd83428d04b98cc1ef48ec098978141295 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 20 Aug 2021 16:35:56 +0200 Subject: [PATCH] Fix printing of C-@ in `describe-fontset' * lisp/international/mule-diag.el (mule--kbd-at): New function (bug#17836). (print-fontset-element): Use it to get multi-key things correct. --- lisp/international/mule-diag.el | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 02169ceb689..864cd3ce01e 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -862,15 +862,28 @@ The IGNORED argument is ignored." (defvar mule--print-opened) +(defun mule--kbd-at (point) + (save-excursion + (goto-char point) + (elt + (kbd (buffer-substring + (point) + (progn + ;; Might be a space, in which case we want it. + (if (zerop (skip-chars-forward "^ ")) + (1+ (point)) + (point))))) + 0))) + (defun print-fontset-element (val) ;; VAL has this format: ;; ((REQUESTED-FONT-NAME OPENED-FONT-NAME ...) ...) ;; CHAR RANGE is already inserted. Get character codes from ;; the current line. (beginning-of-line) - (let ((from (following-char)) + (let ((from (mule--kbd-at (point))) (to (if (looking-at "[^.]*[.]* ") - (char-after (match-end 0))))) + (mule--kbd-at (match-end 0))))) (if (re-search-forward "[ \t]*$" nil t) (delete-region (match-beginning 0) (match-end 0))) -- 2.39.5