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: Patch: perform autoloading when docs is missing from autoload object Date: Mon, 20 Sep 2021 13:02:47 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31712"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 20 19:07:59 2021 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 1mSMlq-0007yo-1D for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 19:07:58 +0200 Original-Received: from localhost ([::1]:53480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSMlo-0001AM-T3 for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 13:07:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSMhN-0004T5-Ut for emacs-devel@gnu.org; Mon, 20 Sep 2021 13:03:25 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSMhL-0002hT-2W for emacs-devel@gnu.org; Mon, 20 Sep 2021 13:03:20 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5ABE910018B; Mon, 20 Sep 2021 13:03:17 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id ECBB9100140; Mon, 20 Sep 2021 13:03:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1632157395; bh=GGyB/RaGdIXPzsCpCTUUUOjaFOYoLWcqqUOorD88w3g=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Yw6oowc5HPYakIQJfIVeCjYNqmFbHbiZXQk7wD7NpVxtQbhbdY0MVEdpGLITIu3/t 3T52N5+N9cpU8ZuQQqgnh0b0M39Pno1g+wx6IYMsaCfWpQ6QjWvBxaILtThiApOko0 tzheqyj+zO3TIIa9+GYq1dIxO9CODRJS4iG+hnO3EwCQJC5djBm4za3RAZ1XSLI0jx KbECX6UbGNSL5fRVsemhXLdjWYOJbZPMeGuANxePW3Ks1T9LKyx3sWwD3daZsiQl2w kugiFK5S1Nyl2tV8WTil1E/ceBVevLBPCfxqBcqZV7+KZmtj2x+ANdL04ZfVpQ4eko 1wIZafx1PAl4Q== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D1560120328; Mon, 20 Sep 2021 13:03:15 -0400 (EDT) In-Reply-To: (Arthur Miller's message of "Sat, 18 Sep 2021 20:25:09 +0200") 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:275154 Archived-At: > I tested with package-quickstart. As said, manually opened .elc and > evaled the buffer. Hmm... Can't see an obvious reason why it didn't do "the right thing" for you (tho `M-x eval-buffer` will result in an unusable (FILE . OFFSET) pair because the `load-file-name` var is not setup; a better test is to load the file, but that doesn't explain why you ended up with an actual doc *string*). > By the way, when I was reading the manual, and testing all this, I could see > that autoloads from Emacs sources were with offsets in autoload object. Yes, this a special case: they're offsets into the `etc/DOC` file, generated by the `lib-src/make-docfile.c` auxiliary tool. This so as to bring the cost down further: instead of (FILE . OFFSET) we can use just OFFSET where FILE is known implicitly to be `etc/DOC`. > But I couldn't see those from installed packages. That is why I have > finally ditched the entire package-quickstart and Emacs > autoload generation. Looking at the code, everything seems to be in place such that byte-compiling the `package-quickstart.el` file *should* end up with (FILE . OFFSET)s, but I haven't tested it to confirm yet. You say it doesn't work, so apparently there's something somewhere that still gets in the way :-( >>> So the entire business of docs in autoloads is due to autoload file generation, >>> seems to me, if I don't misunderstanding something? >> I'm afraid I don't know what you mean by "business of docs in autoloads". > Eh; sorry, that was a goofy expression. I meant that documentation ends up > in autoload objects, because Emacs code that scrapes for autoloads explicitly put > it there. I am no 100% sure, that is just my assumption, I hoped you would say > yes or no :). Ah, well then "yes" ;-) > Rationale was that it is faster to just parsing with 'read' without loading > structures in the memory; Most Elisp files can be loaded fairly quickly (some exceptions are things like `org.el` that pull in a lot of dependencies) and we'd only do it once per session an only in some particular cases (not in loops, etc...), so it's not that terribly important. Stefan