Subject: bug#56982: 29.0.50; Loading org.el fails to load org-loaddefs from installed location

From: "Peder O. Klingenberg" <[email-masked]>
Date: Thu, 04 Aug 2022 19:42:08 +0200

I routinely end my emacs builds with "make install".  After doing the
same thing this time, after startup. *Messages* contained

  WARNING: No org-loaddefs.el file could be found from where org.el is
  loaded.
  You need to run "make" or "make autoloads" from Org lisp directory

These messages come from org.el, which I load very early in my init.
The rest of my startup ran as usual, but org-mode was mostly
dysfunctional.

The problem is that org.el expects the exact filename of
org-loaddefs.el, but after make install I'm left with only
org-loaddefs.el.gz and org-loaddefs.elc in the install dir.

The fix seemed simple, just allow the normal machinery to load the elc
or el.gz if necessary.  Patch attached.  I have not examined whether
there are reasons to prefer exactly the .el version, but loading the elc
works fine for me so far.

In GNU Emacs 29.0.50 (build 7, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2022-08-04 built on PedersHP
Windowing system distributor 'HC-Consult', version 11.0.12009000
System Description: Ubuntu 20.04.4 LTS

Configured using:
 'configure --with-x-toolkit=lucid --with-native-compilation=true
 --prefix=/usr/local/emacs-git CC=gcc-10'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  cursor-sensor-mode: t
  which-key-mode: t
  marginalia-mode: t
  csv-field-index-mode: t
  sly-symbol-completion-mode: t
  pyvenv-mode: t
  beacon-mode: t
  global-git-gutter-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  global-corfu-mode: t
  corfu-mode: t
  override-global-mode: t
  vertico-mode: t
  savehist-mode: t
  gnus-undo-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/pok/.emacs.d/elpa/transient-20220803.1000/transient hides /usr/local/emacs-git/share/emacs/29.0.50/lisp/transient

Features:
(shr-color gnus-cite mm-archive textsec uni-scripts idna-mapping
ucs-normalize uni-confusable textsec-check gnus-bcklg qp gnus-async
gnus-ml gnus-topic cursor-sensor utf-7 nndraft nnmh bbdb-gnus epa-file
network-stream gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg nntp gnus-cache eudc-capf eudc cus-start eudc-vars shadow
bbdb-message footnote ecomplete mail-extr emacsbug whitespace dired-aux
magit-extras magit-patch mule-util vc-hg vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs log-view consult-yasnippet consult-vertico consult
compat-28 recentf tree-widget display-line-numbers smartparens-config
smartparens-org smartparens-python smartparens-markdown smartparens-text
smartparens-c smartparens wheatgrass-theme which-key marginalia php-mode
mode-local speedbar ezimage dframe cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs php-face php
php-project projectile lisp-mnt csv-mode sort multi-vterm vterm
magit-bookmark bookmark tramp tramp-loaddefs trampver tramp-integration
tramp-compat ls-lisp face-remap term disp-table ehelp vterm-module
term/xterm xterm restclient sly sly-completion sly-buttons sly-messages
sly-common apropos arc-mode archive-mode hyperspec gradle-mode
groovy-mode debbugs soap-client rng-xsd rng-dt rng-util xsd-regexp
bbdb-vcard bbdb-vcard-vcard21 bbdb-mua bbdb-com bbdb bbdb-site timezone
virtualenvwrapper gud highlight-indentation flymake-proc flymake
company-capf company-jedi jedi-core python-environment epc ctable
concurrent deferred company help-fns radix-tree elpy elpy-rpc pyvenv
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util elpy-shell elpy-profile elpy-django s elpy-refactor
ido hideshow etags fileloop xref project pcase markdown-preview-eww
yasnippet easy-kill ace-window avy beacon git-timemachine git-gutter
forge-list forge-commands forge-semi forge-bitbucket buck forge-gogs
gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy
gsexp ghub let-alist forge-notify forge-revnote forge-pullreq
forge-issue forge-topic yaml bug-reference forge-post markdown-mode
color forge-repo forge forge-core forge-db closql emacsql-sqlite emacsql
emacsql-compiler url-http url-auth url-gw nsm magit-submodule
magit-obsolete magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff git-commit log-edit pcvs-util add-log magit-core
magit-autorevert autorevert magit-margin magit-transient magit-process
with-editor server magit-mode magit-git magit-base magit-section crm
dash compat-27 compat-26 exec-path-from-shell try xterm-color ob-python
python ob-lisp ob-perl ob-shell shell org-tempo tempo gnus-icalendar
org-capture org-refile icalendar diary-lib diary-loaddefs rg files-x vc
rg-info-hack rg-menu transient compat rg-ibuffer rg-result wgrep-rg
wgrep rg-history rg-header ibuf-ext ibuffer ibuffer-loaddefs grep
compile cus-edit pp cus-load orderless corfu edmacro kmacro
use-package-bind-key bind-key vertico savehist comp comp-cstr warnings
vc-git diff-mode vc-dispatcher cl-extra help-mode org-element avl-tree
generator ol-eww eww xdg url-queue thingatpt mm-url ol-rmail ol-mhe
ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime
smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range
message sendmail yank-media puny rfc822 mml mml-sec epa derived epg
rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util text-property-search mail-utils range mm-util
mail-prsvr wid-edit ol-docview doc-view filenotify jka-compr image-mode
exif dired dired-loaddefs ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi
org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote
org-src ob-comint org-pcomplete pcomplete comint ansi-color ring
org-list org-faces org-entities noutline outline easy-mmode icons
org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex
iso8601 time-date ol rx org-keys oc org-compat advice org-macs
org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs
use-package-ensure use-package-core finder-inf bbdb-autoloads
beacon-autoloads consult-yasnippet-autoloads corfu-autoloads
csv-mode-autoloads easy-kill-autoloads eglot-autoloads elpy-autoloads
company-autoloads embark-consult-autoloads consult-autoloads
embark-autoloads forge-autoloads closql-autoloads ghub-autoloads
git-gutter-autoloads marginalia-autoloads markdown-mode-autoloads
f-autoloads csharp-mode-autoloads flycheck-autoloads orderless-autoloads
ox-hugo-autoloads php-mode-autoloads rg-autoloads sly-autoloads
smartparens-autoloads tomelr-autoloads treemacs-icons-dired-autoloads
treemacs-magit-autoloads magit-autoloads magit-section-autoloads
git-commit-autoloads transient-autoloads treemacs-autoloads
posframe-autoloads pfuture-autoloads projectile-autoloads
vertico-autoloads dash-autoloads vterm-autoloads which-key-autoloads
with-editor-autoloads info compat-autoloads yaml-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile cconv url-vars
cl-loaddefs cl-lib rmc iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit xinput2 x multi-tty make-network-process native-compile
emacs)

Memory information:
((conses 16 990744 25485)
 (symbols 48 58505 21)
 (strings 32 261023 8584)
 (string-bytes 1 8294668)
 (vectors 16 141406)
 (vector-slots 8 3121250 96479)
 (floats 8 760 663)
 (intervals 56 1265 273)
 (buffers 992 30))
>From 56eda8882eb3d1ece4a0a8805ac6648236fb3b40 Mon Sep 17 00:00:00 2001
From: "Peder O. Klingenberg" <[email-masked]>
Date: Thu, 4 Aug 2022 18:04:48 +0200
Subject: [PATCH] * lisp/org/org.el: Fix load of compiled or compressed
 org-loaddefs.

---
 lisp/org/org.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org/org.el b/lisp/org/org.el
index e62ee3203b..8bb69e98ce 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -82,8 +82,8 @@ org-inlinetask-min-level
 (or (eq this-command 'eval-buffer)
     (condition-case nil
 	(load (concat (file-name-directory load-file-name)
-		      "org-loaddefs.el")
-	      nil t t t)
+		      "org-loaddefs")
+	      nil t nil t)
       (error
        (message "WARNING: No org-loaddefs.el file could be found from where org.el is loaded.")
        (sit-for 3)
-- 
2.25.1