GNU bug report logs - #57972
29.0.50; Autoloaded function raises (void-function org-element-cache-reset) when called within major-mode body

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> gmail.com>

Date: Wed, 21 Sep 2022 08:34:01 UTC

Severity: normal

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #61 received at 57972-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57972-done <at> debbugs.gnu.org, Ihor Radchenko <yantar92 <at> gmail.com>
Subject: Re: bug#57972: 29.0.50; Autoloaded function raises (void-function
 org-element-cache-reset) when called within major-mode body
Date: Fri, 23 Sep 2022 17:13:50 -0400
>> Side question: Could you point me towards documentation on how to
>> properly do autoloading in Emacs packages? Maybe Org is doing things
>> wrongly?
>
> I think Org basically does what other packages do, which is explicitly
> load the *-loaddefs.el in some central place.  I don't think we have
> any magic anywhere to do that any other way.

Indeed, that's the usual way (except for the weird (eq
this-command 'eval-buffer):

    % grep '(\(load\|require\).*-loaddefs' **/*.el
    lisp/calc/calc.el:(load "calc-loaddefs.el" nil t)
    lisp/calendar/calendar.el:(load "cal-loaddefs" nil t)
    lisp/calendar/diary-lib.el:(eval-and-compile (load "diary-loaddefs" nil t))
    lisp/calendar/holidays.el:(load "holiday-loaddefs" nil t)
    lisp/dired.el:(require 'dired-loaddefs nil t)
    lisp/emacs-lisp/cl-lib.el:(unless (load "cl-loaddefs" 'noerror 'quiet)
    lisp/erc/erc.el:(load "erc-loaddefs" 'noerror 'nomessage)
    lisp/ibuffer.el:(require 'ibuffer-loaddefs)
    lisp/mh-e/mh-e.el:(require 'mh-loaddefs)
    lisp/net/tramp-cache.el:(require 'tramp-loaddefs)
    lisp/net/tramp.el:(require 'tramp-loaddefs)
    lisp/ps-print.el:(require 'ps-print-loaddefs)
    lisp/textmodes/reftex.el:(require 'reftex-loaddefs)
    lisp/textmodes/texinfo.el:(require 'texinfo-loaddefs)
    %


-- Stefan





This bug report was last modified 2 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.