From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: defun.foo--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56643: 29.0.50; Help-mode bookmarks not loading with native compilation Date: Tue, 19 Jul 2022 22:22:57 +0000 Message-ID: References: <83k089m4j0.fsf@gnu.org> Reply-To: defun.foo@proton.me 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="26957"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56643@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 20 02:10:15 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 1oDxI6-0006oM-12 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jul 2022 02:10:14 +0200 Original-Received: from localhost ([::1]:41420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDxI4-0001gW-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 20:10:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDxHu-0001g8-Tz for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 20:10:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDxHu-0002DX-KS for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 20:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDxHu-0000Vo-5I for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 20:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: defun.foo@proton.me Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jul 2022 00:10:02 +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.16582757471900 (code B ref 56643); Wed, 20 Jul 2022 00:10:02 +0000 Original-Received: (at 56643) by debbugs.gnu.org; 20 Jul 2022 00:09:07 +0000 Original-Received: from localhost ([127.0.0.1]:55405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDxGx-0000UU-SD for submit@debbugs.gnu.org; Tue, 19 Jul 2022 20:09:07 -0400 Original-Received: from mail-40131.protonmail.ch ([185.70.40.131]:34871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDvcS-0006JB-Ty for 56643@debbugs.gnu.org; Tue, 19 Jul 2022 18:23:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=g7tt2dkbdze7rc2fckxxnjdvg4.protonmail; t=1658269381; x=1658528581; bh=tkawaolO/7ZWPJzCeQgl/BywADm9hj+ARtEGZQAaqvQ=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=S5xb/UFjm/aRUbpQ2gVGWgJAleRGDs+N99HsKQ1LDvalJPI7h8dQ0B/+DJ+s8uEd/ /wtQXRGZmySa+K17wfBVsRGMF/EhAkZz/MS+RCnvJTsZpvA0qrxfpHl2qtP+dmKN7u 4Fpl4OxXDmr0pvKgDWjwi0CHkBXgDr31HY8nWzw46enu7Vuliqxj3rlzWj4802A/TA W+e5iodutR2chgRYY3JrvnU6pvrXBjD0j7QKTA3zderWBJdvxGXLsWWvrRctiIX6lz PSLNqdlZr7h12nJVszmTIUp1m7Fqv5sMRfiGPvpcaJXHS+U1OCNgft8WH33ISur80E 3Umxx8loGPtzQ== In-Reply-To: <83k089m4j0.fsf@gnu.org> Feedback-ID: 52178609:user:proton X-Mailman-Approved-At: Tue, 19 Jul 2022 20:09:02 -0400 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" X-ACL-Warn: , defun.foo@proton.me Xref: news.gmane.io gmane.emacs.bugs:237471 Archived-At: I dug into that a little when I was trying to find a work-around. It looks = like help-mode maintains a stack of previously-visited help items which is = what enables users to jump back and forth between different items they've v= iewed. 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-back= =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 hel= p item, and "help-bookmark-make-record" just drops that FUNCTION element in= tact 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 defines = its own way of setting up an xref stack item. Some pass in a symbol while s= ome pass in a lambda, so after a while the stack might end up looking like = this: ((1 # (("=18=03" . [24 3])) #) (232 describe-variable help-xref-stack #) (1 # describe-p= ackage #)) Then when bookmark.el saves all the bookmarks ("bookmark-write-file"), it j= ust calls "pp" on each one: (dolist (i bookmark-alist) (pp i (current-buffer))) which apparently is able to create a readable representation of byte-compil= ed lambdas, but not native-compiled ones. And that's where my knowledge ends. :) I have very little C programming exp= erience and have no idea if it's even possible to serialize a compiled thin= g into something the reader can understand, or whether there's some process= ing help-mode could do on each function before it even becomes part of a bo= okmark. ------- Original Message ------- On Tuesday, July 19th, 2022 at 12:49 PM, Eli Zaretskii wrote= : > > Thanks. > > I started looking into this, but gave up when I got to help-mode.el > (which is where the bookmark support for Help lives, and which is > where we signal an error trying to read an unreadable object.) > > We basically have no usable documentation for what bookmark support in > help-mode does. Someone who knows what that code does will have to > see how to process a help-fn that is a natively-compiled function.