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: Fri, 22 Jul 2022 13:41:32 +0000 Message-ID: References: <83k089m4j0.fsf@gnu.org> <8335ewm2i1.fsf@gnu.org> <83a693lhms.fsf@gnu.org> <87sfmvtn99.fsf@web.de> <838ronkpzh.fsf@gnu.org> <83y1wmmyq7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31711"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: michael_heerdegen@web.de, defun.foo@proton.me, 56643@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 22 15:42:42 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 1oEsvR-00080w-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Jul 2022 15:42:41 +0200 Original-Received: from localhost ([::1]:48334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEsvP-0003Rj-4R for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Jul 2022 09:42:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEsup-0002rj-Ua for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 09:42:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEsuo-0003wt-86 for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 09:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oEsuo-0003pM-4b for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2022 09:42: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: Fri, 22 Jul 2022 13:42: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.165849729514675 (code B ref 56643); Fri, 22 Jul 2022 13:42:02 +0000 Original-Received: (at 56643) by debbugs.gnu.org; 22 Jul 2022 13:41:35 +0000 Original-Received: from localhost ([127.0.0.1]:40455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEsuN-0003od-7u for submit@debbugs.gnu.org; Fri, 22 Jul 2022 09:41:35 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:64133) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEsuL-0003oU-5j for 56643@debbugs.gnu.org; Fri, 22 Jul 2022 09:41:34 -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 26MDfVbJ013051 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 22 Jul 2022 13:41:32 GMT In-Reply-To: <83y1wmmyq7.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Jul 2022 15:33:52 +0300") 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:237625 Archived-At: Eli Zaretskii writes: >> Date: Thu, 21 Jul 2022 10:01:57 +0000 >> From: defun.foo@proton.me >> Cc: Michael Heerdegen , 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