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 09:51:17 +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="11691"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: defun.foo@proton.me, 56643@debbugs.gnu.org, @mx.sdf.org, eliz@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 20 11:52:11 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 1oE6NH-0002sy-Eg for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 11:52:11 +0200 Original-Received: from localhost ([::1]:55384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oE6NG-0002fi-2T for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 05:52:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oE6N8-0002fV-UG for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 05:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oE6N8-0001Ty-LX for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 05:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oE6N8-0007Li-Ey for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2022 05:52:02 -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 09:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56643 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: defun.foo@proton.me, "the.Swiss.army.knife.of.text.editors\\ " , @mx.sdf.org, Eli Zaretskii , 56643@debbugs.gnu.org Original-Received: via spool by 56643-submit@debbugs.gnu.org id=B56643.165831068128197 (code B ref 56643); Wed, 20 Jul 2022 09:52:02 +0000 Original-Received: (at 56643) by debbugs.gnu.org; 20 Jul 2022 09:51:21 +0000 Original-Received: from localhost ([127.0.0.1]:55880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oE6MS-0007Kj-QB for submit@debbugs.gnu.org; Wed, 20 Jul 2022 05:51:21 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:52212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oE6MR-0007Kb-56 for 56643@debbugs.gnu.org; Wed, 20 Jul 2022 05:51:19 -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 26K9pGlx004142 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Wed, 20 Jul 2022 09:51:17 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:237487 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