;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/char.el (defun what-char (&optional pos) (interactive "P") (let*((position (or (and (numberp pos) pos) (point) )) (kill pos) (char (char-after position)) ) (when char (let*((name (get-char-code-property char 'name)) (old-name (get-char-code-property char 'old-name)) (msg (if (and name old-name) (format "%s (old: %s)" name old-name) (or name old-name) )) (msg-dc (when (stringp msg) (downcase msg) ))) (when msg-dc (prog1 msg-dc (when kill (kill-new msg-dc) ) (message "%s (at point: %d)" msg-dc position) )))))) ;; (what-char) ; "space" ;; (what-char 754) ; "right parenthesis (old: closing parenthesis)" ;; C-u 754 M-x what-char RET ; same, but also killed ;; C-u M-x what-char RET* (C-y) ; asterisk is yanked ;; M-x what-char RET ; line feed (lf) (at point: 1034)