all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo <akrl@sdf.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, defun.foo@proton.me, 56643@debbugs.gnu.org
Subject: bug#56643: 29.0.50; Help-mode bookmarks not loading with native compilation
Date: Fri, 22 Jul 2022 13:41:32 +0000	[thread overview]
Message-ID: <xjf35etnu2b.fsf@ma.sdf.org> (raw)
In-Reply-To: <83y1wmmyq7.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Jul 2022 15:33:52 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Thu, 21 Jul 2022 10:01:57 +0000
>> From: defun.foo@proton.me
>> Cc: Michael Heerdegen <michael_heerdegen@web.de>, akrl@sdf.org, 56643@debbugs.gnu.org
>> 
>> > > Alternatively we could introduce a named helper function. Note there
>> > > are more calls of `help-setup-xref' using lambdas in arguments.
>> >
>> >
>> > And that would solve the problem? Did you try that?
>> 
>> I tried it with describe-function and it does solve the problem,
>> although as noted above there are many other functions that generate
>> help buffers and pass in a lambda.
>
> I know very well there are other instances, I just wanted us to stay
> focused.
>
>> Named helper:
>> 
>> (defun describe-function-xref-func (function buffer)
>>   (let ((describe-function-orig-buffer
>>                     (if (buffer-live-p buffer) buffer)))
>>                (describe-function function)))
>> 
>> Revised describe-function snippet:
>> 
>>     (help-setup-xref
>>      (list 'describe-function-xref-func function describe-function-orig-buffer)
>>      (called-interactively-p 'interactive))
>> 
>> This produces the following bookmark, which I confirmed still works after restarting Emacs:
>> 
>> ("named-function-help-bookmark"
>>  (position . 1)
>>  (last-modified 25305 7198 806743 243000)
>>  (help-fn . describe-function-xref-func)
>>  (help-args completing-read "*scratch*")
>>  (position . 1)
>>  (handler . help-bookmark-jump))
>
> Thanks.  If Andrea confirms that this won't have any problems with
> native-compilation, I will install such changes on the release branch
> (since AFAIU this issue is a regression in Emacs 28).

I confirm it should just work.

Actually I think the use of a lambda there was not really optimal in
first place as is not capturing anything and we were serializing and
deserializing the same code over and over again for no good reason.

BTW, I mention this for other similar cases, another fix would be to add
(declare (speed -1)) to `describe-function'.  Ideally would be _really_
nice to add it directly to the lambda we want to be able to
se/deserialize, but AFAIK the declare semantinc is not available to
lambdas :( Probably an improvement to keep in mind...

Thanks

  Andrea





  parent reply	other threads:[~2022-07-22 13:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 13:45 bug#56643: 29.0.50; Help-mode bookmarks not loading with native compilation defun.foo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-19 16:49 ` Eli Zaretskii
2022-07-19 22:22   ` defun.foo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-20  9:51     ` Andrea Corallo
2022-07-20 11:21     ` Andrea Corallo
2022-07-20 11:45       ` Eli Zaretskii
2022-07-20 18:31         ` Andrea Corallo
2022-07-20 19:16           ` Eli Zaretskii
2022-07-20 22:47             ` Michael Heerdegen
2022-07-21  5:13               ` Eli Zaretskii
2022-07-21 10:01                 ` defun.foo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-21 12:33                   ` Eli Zaretskii
2022-07-22 13:40                     ` Eli Zaretskii
2022-07-22 13:41                     ` Andrea Corallo [this message]
2022-07-22 14:40                       ` Eli Zaretskii
2022-07-23  9:57                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjf35etnu2b.fsf@ma.sdf.org \
    --to=akrl@sdf.org \
    --cc=56643@debbugs.gnu.org \
    --cc=defun.foo@proton.me \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.