From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Docstring hack Date: Sun, 31 Jul 2022 04:03:05 -0400 Message-ID: References: <83bkt6687a.fsf@gnu.org> <871qu2lo29.fsf@yahoo.com> <837d3u63ez.fsf@gnu.org> <834jyy61w6.fsf@gnu.org> <831qu25z5x.fsf@gnu.org> <87mtcqhvot.fsf@yahoo.com> <83sfmh4x0o.fsf@gnu.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="25828"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Po Lu , owinebar@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 31 10:05:47 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 1oI3xL-0006Sz-EU for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Jul 2022 10:05:47 +0200 Original-Received: from localhost ([::1]:37748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oI3xJ-0006NC-Os for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Jul 2022 04:05:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oI3us-0005d2-1D for emacs-devel@gnu.org; Sun, 31 Jul 2022 04:03:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:65466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oI3up-0003wP-Qd; Sun, 31 Jul 2022 04:03:13 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2A19B1003BF; Sun, 31 Jul 2022 04:03:10 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A984510011A; Sun, 31 Jul 2022 04:03:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1659254588; bh=rKEvYjBE81Mqz/oiuWEcJ9yLHjvLOQAf5IOUbVsOnXI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QpK9CLIQoq0aiAl0xUTH1LWN4ZFFQ1oY1mgjp6fSMj4t4U7jKok85qlFSLMrDvntA J+y6m8wFKTEVZD3mvJZEPdYkH6qMkOa2hLYlNQsunQr8Uulbot7wRz+ushmtk7dyKo KHbA3CJo9pxyJo8YkCNLpGMcQcPT6omVE3OKhYuKEE3gEm31TJItuqUxMwqIJFVSpJ ErlW3cPHEbgc2+igtBe8PpEp2ONVuYheY12ImLNZv4rC8MRj7qRY2CoKmxYjnpKPQk 35tjPw5xc7Lb88sbIrevHRkakGsG0YocADSofvg+VBTtaEq3d4zARlg8TaD7jdmgCI Vww3v7RxP6p3A== Original-Received: from milanesa (dyn.144-85-173-218.dsl.vtx.ch [144.85.173.218]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C3DED1201B8; Sun, 31 Jul 2022 04:03:07 -0400 (EDT) In-Reply-To: <83sfmh4x0o.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 31 Jul 2022 09:27:35 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:292902 Archived-At: > OK, but I still lack some glue to understand the issue. Specifically: > > . the OP said "strings that are erroneously treated as docstrings in > dump mode" -- where's the code which makes that mistake, and how > is read_literal_string related to that mistake? > . why isn't there an alternative to fix read_literal_string not to > generate zero instead of the format template? the other > alternatives all look like partial kludges to me In `read_literal_string` there is a hack that dates back to Emacs's early life where we drop the string we just read and return the 0 literal instead. We do that for those strings we think are docstrings that will be found in etc/DOC and will be re-provided later when we call `Snarf-documentation` (which should then replace those 0 literals with appropriate integers pointing into etc/DOC). The reason for this hack is to avoid allocating the string in the heap (or worse, the purespace) since it's to be found lazily in etc/DOC instead. But we don't have a sure-fire way to recognize those strings, so we use a convention that they start with "double-quote backslash newline" (this same convention is then used in `make-docfile` in order to find those strings). But some non-preloaded files also use "double-quote backslash newline" for other reasons, such as in `eieio-defclass-autoload`. Not sure why it's a problem for Lynn, tho: he should not try to preload `eieio-core.el` but only `eieio-core.elc` where the problem should not appear any more. But as noted elsewhere in Lynn's saga, the way we currently handle `site-load.el`, those site-loaded files are also preloaded in the `bootstrap-emacs.pdmp` (hence in their non-compiled form), which is a bad idea. We should fix our handling of `site-load.el` so it's only loaded in the "final" dump after the site-loaded files have been byte-compiled. Stefan