From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: Re: Display of undisplayable characters: \U01F3A8 instead of diamond Date: Tue, 20 Sep 2022 03:09:00 +0200 Message-ID: <878rmen977.fsf@dataswamp.org> References: <875yi0wzx7.fsf@dataswamp.org> <834jxkk635.fsf@gnu.org> <878rmw8085.fsf@dataswamp.org> <83edwnj4fh.fsf@gnu.org> <87tu5j7tu1.fsf@dataswamp.org> <83a67bih0f.fsf@gnu.org> <83tu5jgvfy.fsf@gnu.org> <83sfl3gtah.fsf@gnu.org> <83fsh3ghn9.fsf@gnu.org> <87bkroub0v.fsf@dataswamp.org> <83r10kdd68.fsf@gnu.org> <87a6777seb.fsf@dataswamp.org> <83bkrnbux2.fsf@gnu.org> <87pmg3jlyn.fsf@dataswamp.org> <83o7vn9r11.fsf@gnu.org> <87czc3jkas.fsf@dataswamp.org> <87y1uri1wr.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:0qq776DDQlnQxfw0jqC/T1klpZA= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 20 04:25:09 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaSwd-0009Yk-UI for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Sep 2022 04:25:08 +0200 Original-Received: from localhost ([::1]:38492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaSwc-0003EZ-6c for ged-emacs-devel@m.gmane-mx.org; Mon, 19 Sep 2022 22:25:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaRlB-0001hq-A7 for emacs-devel@gnu.org; Mon, 19 Sep 2022 21:09:13 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:36210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaRl8-00029R-Qy for emacs-devel@gnu.org; Mon, 19 Sep 2022 21:09:13 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oaRl6-0007r0-4y for emacs-devel@gnu.org; Tue, 20 Sep 2022 03:09:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 19 Sep 2022 22:23:23 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295769 Archived-At: >> The simple and well-known method [...] > > Wait, don't say anything! > > I'll just code it and show you! > > I didn't think of it ... Couldn't find a standard way of storing arbitrary Elisp data so just wrote it on instinct. At one point I didn't know what to do but it turned out my subconscious had already that problem solved. ;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/cache.el (let ((cache-file (format "%svar/data-cache.el" user-emacs-directory))) (defun save-char-table () (with-temp-buffer (insert "(setq standard-display-table\n\n") (prin1 standard-display-table (current-buffer)) (insert "\n\n)") (write-file cache-file) )) (declare-function save-char-table nil) (defun load-char-table () (when (file-exists-p cache-file) (load-file cache-file) )) (declare-function load-char-table nil) ) (defun set-replacement-char-table () (unless (load-char-table) (let ((tbl standard-display-table)) ;; WARNING, ugly code ahead! (set-char-table-range tbl '(#x102 . #x103) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x108 . #x10b) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x10e . #x111) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x114 . #x115) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x11a . #x121) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x124 . #x129) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x12c . #x12d) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x130 . #x135) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x138 . #x13a) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x13d . #x140) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x147 . #x14b) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x14e . #x155) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x158 . #x159) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x15c . #x15f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x162 . #x169) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x16c . #x171) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x174 . #x178) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x17f . #x2c6) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2c8 . #x2c8) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2ca . #x2d8) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2da . #x2da) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2dc . #x390) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x393 . #x394) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x398 . #x398) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x39b . #x39b) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x39e . #x39e) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x3a0 . #x3a0) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x3a2 . #x3a3) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x3a5 . #x3a6) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x3a8 . #x3bb) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x3bd . #x3bf) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x3c1 . #x400) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x402 . #x404) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x407 . #x407) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x409 . #x40f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x411 . #x411) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x413 . #x414) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x416 . #x419) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x41b . #x41b) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x41f . #x41f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x423 . #x424) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x426 . #x42f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x431 . #x434) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x436 . #x43d) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x43f . #x43f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x442 . #x442) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x444 . #x444) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x446 . #x450) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x452 . #x454) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x457 . #x457) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x459 . #x4ad) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x4af . #x1fff) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x200b . #x200f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2016 . #x2017) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x201b . #x201b) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x201f . #x201f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2023 . #x2025) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2027 . #x202e) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2031 . #x2038) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x203b . #x20ab) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x20ad . #x2115) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2117 . #x2121) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2123 . #x2129) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x212c . #x218f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2194 . #x2211) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2213 . #x2247) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2249 . #x225f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2261 . #x2263) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2266 . #x2269) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x226c . #x2294) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2297 . #x2297) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x229a . #x229a) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x229d . #x245f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2469 . #x24b5) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x24eb . #x24ff) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2580 . #x2587) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2589 . #x2590) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2593 . #x259f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25a1 . #x25ad) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25af . #x25b1) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25b3 . #x25b3) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25b5 . #x25b5) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25b7 . #x25b7) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25b9 . #x25bb) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25bd . #x25bd) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25bf . #x25bf) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25c1 . #x25c1) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25c3 . #x25c7) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25c9 . #x25ce) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x25d0 . #x260f) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2613 . #x2665) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2667 . #x2716) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2719 . #x2bbc) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#x2bbe . #xfffc) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (set-char-table-range tbl '(#xfffe . #x10ffff) (vconcat (list (make-glyph-code #xfffd 'homoglyph)))) (save-char-table) ))) (set-replacement-char-table) -- underground experts united https://dataswamp.org/~incal