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: Thu, 08 Sep 2022 04:12:19 +0200 Message-ID: <87a67afwcc.fsf@dataswamp.org> References: <2f302d1c3966849477b3@heytings.org> <83mtbiovzr.fsf@gnu.org> <83a67hq3l7.fsf@gnu.org> <83mtbhneht.fsf@gnu.org> <83czcakqd3.fsf@gnu.org> <87a67dxhfw.fsf@dataswamp.org> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34464"; 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:pIfHyL0wZ11Zw2RC4AW9nvrdF+U= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 08 04:13:23 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 1oW72g-0008nB-Io for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Sep 2022 04:13:22 +0200 Original-Received: from localhost ([::1]:52356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oW72f-0007Wp-La for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Sep 2022 22:13:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oW71s-0006e9-Er for emacs-devel@gnu.org; Wed, 07 Sep 2022 22:12:32 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:36560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oW71p-0005rj-3s for emacs-devel@gnu.org; Wed, 07 Sep 2022 22:12:32 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oW71m-0007jV-LM for emacs-devel@gnu.org; Thu, 08 Sep 2022 04:12:26 +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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:294892 Archived-At: Yuri Khan wrote: >>> I believe Emanuel is alluding to the memoization pattern >>> "if a computation (e.g. of the set of all displayable >>> characters) is too expensive to perform every time its >>> result is needed, cache the result in some storage that >>> survives between the times it is needed (e.g. a data file >>> in .emacs.d/var/)". >> >> That's exactly what the instructions produced with the code >> suggest... > > Um, no? This is code generation, a different pattern where > slow code generates fast code that needs to be included in > the actual program (in this case, user’s init file). > > Code generation: > > * M-x standard-display-by-replacement-char RET. > * It pauses for a while, gives you some comments and code. > * At a minimum, you have to read and understand the comment. > * Then you copy and paste that code in your init file and optionally > evaluate it for immediate effect. > > Compare with caching/memoization: > > * M-x some-hypothetical-other-command RET. > * It pauses for a while, stores a data file, has an immediate effect. > * You see the effect, decide that it is good, put > (some-hypothetical-other-command) in your init file. > * On the next startup, it reads the file (which is fast), applies the > data (which is supposedly also fast), has the same effect. Yes, this is exactly what I mean. > The file name could include some relevant factors such as > the terminal type on which the data depends. Good idea, base that on tty(1) perhaps? (info "(coreutils) tty invocation") Also see ttyname(3). -- underground experts united https://dataswamp.org/~incal