bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60587: Patch for adding links to symbols' help documentation


From: Gregory Heytings
Subject: bug#60587: Patch for adding links to symbols' help documentation
Date: Wed, 15 Feb 2023 13:42:36 +0000


No, not any longer 😊.

Can someone tell me an easy way to make that particular diamond character display as the ASCII sequence `;-)'?

(defun set-character-display (char repl)
 (let ((c (char-from-name char)))
   (when (and c (stringp repl))
     (aset (or standard-display-table
                (setq standard-display-table (make-display-table)))
            c
            (vconcat
             (mapcar
              (lambda (char) (make-glyph-code char 'homoglyph))
              repl))))))

(set-character-display "SMILING FACE WITH SMILING EYES" ":-)")


Or, if you don't want to use the homoglyph face for such replacements:

(defun set-character-display (char repl)
  (let ((c (char-from-name char)))
    (when (and c (stringp repl))
      (aset (or standard-display-table
             (setq standard-display-table (make-display-table)))
         c (vconcat repl)))))

(set-character-display "SMILING FACE WITH SMILING EYES" ":-)")

reply via email to

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