From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#56643: 29.0.50; Help-mode bookmarks not loading with native compilation Date: Wed, 20 Jul 2022 11:21:06 +0000 Message-ID: References: <83k089m4j0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28563"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , 56643@debbugs.gnu.org To: defun.foo@proton.me Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 20 13:57:09 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oE8KD-0007Eu-68 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 13:57:09 +0200 Original-Received: from localhost ([::1]:45492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oE8KC-00005t-0l for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 07:57:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oE7mE-0000Gh-F0 for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 07:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58238) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oE7mE-0000jz-5w for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 07:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oE7mD-0003lM-Sj for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 07:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jul 2022 11:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56643 X-GNU-PR-Package: emacs Original-Received: via spool by 56643-submit@debbugs.gnu.org id=B56643.165831607114389 (code B ref 56643); Wed, 20 Jul 2022 11:22:01 +0000 Original-Received: (at 56643) by debbugs.gnu.org; 20 Jul 2022 11:21:11 +0000 Original-Received: from localhost ([127.0.0.1]:55997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oE7lO-0003k0-Py for submit@debbugs.gnu.org; Wed, 20 Jul 2022 07:21:11 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:58823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oE7lM-0003jr-TA for 56643@debbugs.gnu.org; Wed, 20 Jul 2022 07:21:09 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 26KBL6SZ017115 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Wed, 20 Jul 2022 11:21:07 GMT In-Reply-To: (defun foo's message of "Tue, 19 Jul 2022 22:22:57 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:237492 Archived-At: "defun.foo--- via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" writes: > I dug into that a little when I was trying to find a work-around. It look= s like help-mode maintains a stack of previously-visited help items which i= s what enables users to jump back and forth between different items they've= viewed. From "C-h v help-xref-stack": > > "A stack of ways by which to return to help buffers after following xrefs. > Used by =E2=80=98help-follow-symbol=E2=80=99 and =E2=80=98help-xref-go-ba= ck=E2=80=99. > An element looks like (POSITION FUNCTION ARGS...). > To use the element, do (apply FUNCTION ARGS) then goto the point." > > So basically the FUNCTION element is a recipe for recreating a specific h= elp item, and "help-bookmark-make-record" just drops that FUNCTION element = intact into "help-fn" when creating a bookmark: > > `(,@(bookmark-make-record-default 'NO-FILE 'NO-CONTEXT) > (help-fn . ,(car help-xref-stack-item)) > (help-args . ,(mapcar (lambda (a) > (if (bufferp a) (buffer-name a) a)) > (cdr help-xref-stack-item))) > (position . ,(point)) > (handler . help-bookmark-jump)) > > The catch is that every function that generates a help buffer also define= s its own way of setting up an xref stack item. Some pass in a symbol while= some pass in a lambda, so after a while the stack might end up looking lik= e this: > > ((1 # > (("=03" . > [24 3])) > #) > (232 describe-variable help-xref-stack #) > (1 # describe= -package #)) > > Then when bookmark.el saves all the bookmarks ("bookmark-write-file"), it= just calls "pp" on each one: > > (dolist (i bookmark-alist) (pp i (current-buffer))) > > which apparently is able to create a readable representation of byte-comp= iled lambdas, but not native-compiled ones. > > And that's where my knowledge ends. :) I have very little C programming e= xperience and have no idea if it's even possible to serialize a compiled th= ing into something the reader can understand, or whether there's some proce= ssing help-mode could do on each function before it even becomes part of a = bookmark. It is unfortunatelly not possible to serialize native compiled code so that the reader can read it back. Native code can only stay in shared libraries (eln files) and be loaded from there. Not sure if help-mode can use a different strategy. BR Andrea