kjambunathan / org-mode-ox-odt

The Authoritative fork of Org mode's ODT exporter
GNU General Public License v3.0
45 stars 9 forks source link

Emacs 29.4, org-export to spreadsheet does not work any more org-buffer-text-pixel-width not found #277

Open ouboub opened 3 days ago

ouboub commented 3 days ago

hello

sorry, after sucessfully upgrading org-mode-ox-odt, I tried to export the following table as an ods file (as I did successfully before)

| Hoario        | Lunes | Martes | Miércoles | Jueves | Viernes |
|---------------+-------+--------+-----------+--------+---------|
| 14:30 – 15:00 | CAP   |        |           | CAP    |         |
| 15:00 – 15:30 | CAP   |        |           | CAP    |         |
| 15:30 – 16:00 |       |        | CAP       |        |         |
| 16:00 – 16:30 |       |        | CAP       |        |         |
| 16:30 – 17:00 |       |        |           |        |         |
| 17:00 – 17:30 |       |        |           |        |         |
| 17:30 – 18:00 |       |        |           |        |         |

however the export command return error org-buffer-text-pixel-width not found. but I moved my old org installation out of the way.

Debugger entered--Lisp error: (void-function org-buffer-text-pixel-width)
  org-buffer-text-pixel-width()
  org-string-width(#("Hoario" 0 6 (face default :parent (table-cell (:begin 320 :end 336 :contents-begin 321 :contents-end 327 :post-blank 0 :parent (table-row (:type standard :begin 319 :end 385 :contents-begin 320 :contents-end 384 :post-blank 0 :post-affiliated 319 :mode table-row :granularity nil :parent (table ... #20 ... ... ... ... ... ... ... ...)) #6 (table-cell (:begin 336 :end 344 :contents-begin 337 :contents-end 342 :post-blank 0 :parent #20) #("Lunes" 0 5 ...)) (table-cell (:begin 344 :end 353 :contents-begin 345 :contents-end 351 :post-blank 0 :parent #20) #("Martes" 0 6 ...)) (table-cell (:begin 353 :end 365 :contents-begin 354 :contents-end 363 :post-blank 0 :parent #20) #("Miércoles" 0 9 ...)) (table-cell (:begin 365 :end 374 :contents-begin 366 :contents-end 372 :post-blank 0 :parent #20) #("Jueves" 0 6 ...)) (table-cell (:begin 374 :end 384 :contents-begin 375 :contents-end 382 :post-blank 0 :parent #20) #("Viernes" 0 7 ...)))) #("Hoario" 0 6 (:parent #6))))))
  org-table-align()
  org-element-table-interpreter((table ... ... ... ... ... ... ... ... ... ...) #("| Hoario | Lun..." 2 8 ... 11 16 ... 19 25 ... 28 37 ... ...))
  #f(compiled-function (data parent) #<bytecode 0x1647f88916a16860>)((table ... ... ... ... ... ... ... ... ... ...) nil)
  org-element-interpret-data((table ... ... ... ... ... ... ... ... ... ...))
  #f(compiled-function (table) #<bytecode 0x39c30d441d1f3c>)((table ... ... ... ... ... ... ... ... ... ...))
  #f(compiled-function (table) #<bytecode 0x9d766d497826ced>)((table ... ... ... ... ... ... ... ... ... ...))
  #f(compiled-function (--data) #<bytecode -0x1d677722c720ddff>)((table ... ... ... ... ... ... ... ... ... ...))
  mapc(#f(compiled-function (--data) #<bytecode -0x1d677722c720ddff>) (... ... ... ... ... ...))
  #f(compiled-function (--data) #<bytecode -0x1d677722c720ddff>)((section ... ... ... ... ... ... ...))
  mapc(#f(compiled-function (--data) #<bytecode -0x1d677722c720ddff>) (...))
  #f(compiled-function (--data) #<bytecode -0x1d677722c720ddff>)((headline ... ...))
  mapc(#f(compiled-function (--data) #<bytecode -0x1d677722c720ddff>) (...))
  #f(compiled-function (--data) #<bytecode -0x1d677722c720ddff>)((org-data ... ...))
  org-element-map((org-data ... ...) table #f(compiled-function (table) #<bytecode 0x9d766d497826ced>) (:export-options nil :back-end ... :translate-alist ... :exported-data #<hash-table eq 0/4001 0x18463d80ad91> :input-buffer "reserva-uwe3.o..." :input-file "/home/oub/Down..." :odt-preferred-output-format nil ...) nil nil t)
  org-ods--translate-tblfms-to-ods-formulae((org-data ... ...) ods (:export-options nil :back-end ... :translate-alist ... :exported-data #<hash-table eq 0/4001 0x18463d80ad91> :input-buffer "reserva-uwe3.o..." :input-file "/home/oub/Down..." :odt-preferred-output-format nil ...))
  org-export-filter-apply-functions((org-odt--translate-clickable-images org-odt--translate-latex-fragments org-odt--translate-description-lists org-odt--translate-list-tables org-odt--transclude-sole-footnote-references-in-a-table org-ods--translate-tblfms-to-ods-formulae org-html--translate-list-tables) (org-data ... ...) (:export-options nil :back-end ... :translate-alist ... :exported-data #<hash-table eq 0/4001 0x18463d80ad91> :input-buffer "reserva-uwe3.o..." :input-file "/home/oub/Down..." :odt-preferred-output-format nil ...))
  org-export--annotate-info(#s(org-export-backend :name ods :parent opendocument :transcoders ((table . org-ods-table)) :options ((:odt-preferred-output-format "ODS_PREFERRED_OUTPUT_FORMAT" nil org-ods-preferred-output-format t) (:odt-styles-file "ODS_STYLES_FILE" nil org-ods-styles-file t) (:odt-extra-images "ODS_EXTRA_IMAGES" nil nil split) (:odt-extra-styles "ODS_EXTRA_STYLES" nil org-ods-extra-styles newline) (:odt-auto-generated-extra-styles nil nil nil nil) (:odt-extra-automatic-styles "ODS_EXTRA_AUTOMATIC_STYLES" nil org-ods-extra-automatic-styles newline) (:odt-master-styles "ODS_MASTER_STYLES" nil org-ods-master-styles newline) (:odt-content-template-file "ODS_CONTENT_TEMPLATE_FILE" nil org-ods-content-template-file) (:odt-automatic-styles "ODS_AUTOMATIC_STYLES" nil org-ods-automatic-styles newline)) :filters ((:filter-parse-tree org-ods--translate-tblfms-to-ods-formulae)) :blocks nil :menu (111 "Export to ODT" ((115 "As ODS file" org-ods-export-to-ods) (83 "As ODS file and open" (lambda (a s v b) (if a (org-ods-export-to-ods t s v b) (org-open-file ... ...))))))) (:export-options nil :back-end #s(org-export-backend :name ods :parent opendocument :transcoders ((table . org-ods-table)) :options ((:odt-preferred-output-format "ODS_PREFERRED_OUTPUT_FORMAT" nil org-ods-preferred-output-format t) (:odt-styles-file "ODS_STYLES_FILE" nil org-ods-styles-file t) (:odt-extra-images "ODS_EXTRA_IMAGES" nil nil split) (:odt-extra-styles "ODS_EXTRA_STYLES" nil org-ods-extra-styles newline) (:odt-auto-generated-extra-styles nil nil nil nil) (:odt-extra-automatic-styles "ODS_EXTRA_AUTOMATIC_STYLES" nil org-ods-extra-automatic-styles newline) (:odt-master-styles "ODS_MASTER_STYLES" nil org-ods-master-styles newline) (:odt-content-template-file "ODS_CONTENT_TEMPLATE_FILE" nil org-ods-content-template-file) (:odt-automatic-styles "ODS_AUTOMATIC_STYLES" nil org-ods-automatic-styles newline)) :filters ((:filter-parse-tree org-ods--translate-tblfms-to-ods-formulae)) :blocks nil :menu (111 "Export to ODT" ((115 "As ODS file" org-ods-export-to-ods) (83 "As ODS file and open" (lambda (a s v b) (if a ... ...)))))) :translate-alist ((table . org-ods-table) (bold . org-odt-bold) (center-block . org-odt-center-block) (clock . org-odt-clock) (code . org-odt-code) (drawer . org-odt-drawer) (dynamic-block . org-odt-dynamic-block) (entity . org-odt-entity) (example-block . org-odt-example-block) (export-block . org-odt-export-block) (export-snippet . org-odt-export-snippet) (fixed-width . org-odt-fixed-width) (footnote-definition . org-odt-footnote-definition) (footnote-reference . org-odt-footnote-reference) (headline . org-odt-headline) (horizontal-rule . org-odt-horizontal-rule) (inline-src-block . org-odt-inline-src-block) (inlinetask . org-odt-inlinetask) (inner-template . org-odt-inner-template) (italic . org-odt-italic) (item . org-odt-item) (keyword . org-odt-keyword) (latex-environment . org-odt-latex-environment) (latex-fragment . org-odt-latex-fragment) (line-break . org-odt-line-break) (link . org-odt-link) (node-property . org-odt-node-property) (paragraph . org-odt-paragraph) (plain-list . org-odt-plain-list) (plain-text . org-odt-plain-text) (planning . org-odt-planning) (property-drawer . org-odt-property-drawer) (quote-block . org-odt-quote-block) (radio-target . org-odt-radio-target) (section . org-odt-section) (special-block . org-odt-special-block) (src-block . org-odt-src-block) (statistics-cookie . org-odt-statistics-cookie) (strike-through . org-odt-strike-through) (subscript . org-odt-subscript) (superscript . org-odt-superscript) (table . org-odt-table) (table-cell . org-odt-table-cell) (table-row . org-odt-table-row) (target . org-odt-target) (template . org-odt-template) (timestamp . org-odt-timestamp) (underline . org-odt-underline) (verbatim . org-odt-verbatim) (verse-block . org-odt-verse-block)) :exported-data #<hash-table eq 0/4001 0x18463d80ad91> :input-buffer "reserva-uwe3.org" :input-file "/home/oub/Downloads/Reserva-CAP/reserva-uwe3.org") nil nil (:output-file "reserva-uwe3.ods"))
  org-export-as(ods nil nil nil (:output-file "reserva-uwe3.ods"))
  org-odt-export-to-odt-backend(ods nil nil nil nil nil)
  org-ods-export-to-ods(nil nil nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)
kjambunathan commented 3 days ago

org-buffer-text-pixel-width is right there in org-compat.

So, your init file is loading org-compat from elsewhere.

Do an M-x find-library RET org-compat RET to see the path from where the wrongorg-compat is getting loaded.

Use the snippet in https://github.com/kjambunathan/org-mode-ox-odt/issues/276#issuecomment-2414161462 to find out where the wrong org-compat is located and how it gets loaded.

FWIW,

commit 11ce194dcf060782f1457c77a44f791389ed32f0
Author: Ihor Radchenko <yantar92@posteo.net>
Date:   Fri Aug 4 10:53:17 2023 +0300

    org-string-width: Fix Emacs <29 compatibility

    * lisp/org-compat.el (org-buffer-text-pixel-width): New function using
    `buffer-text-pixel-size' in Emacs >=29 and falling back to
    `window-text-pixel-size' in older Emacs.
    * lisp/org-macs.el (org-string-width): Use the new function.
org-buffer-text-pixel-width is a byte-code-function in
`org-compat.el'.

(org-buffer-text-pixel-width)

Return pixel width of text in current buffer.
This function uses `buffer-text-pixel-size', when available, and falls
back to `window-text-pixel-size' otherwise.
ouboub commented 3 days ago

Hm, I tried out this snippet which you also posted (saved in temp2.el)


(require 'find-func)

(add-to-list 'after-load-functions
         (lambda (file-name)
           (message "\nLoading %s because %s" (file-name-nondirectory file-name) load-file-name)
           ;; (message "Loaded %s" (file-name-nondirectory file-name))
           ))

(defmacro debug-on--load (feature)
  `(with-eval-after-load ',feature
     (message "\nLoaded `%s': %s" ',feature
          (find-library-name (symbol-name ',feature)))
     (debug)))

(defmacro debug-on-load (feature-or-features)
  (let* ((features (or (unless (consp feature-or-features)
             (list feature-or-features))
               feature-or-features)))
    `(progn
       ,@(seq-map
      (lambda (it)
        `(debug-on--load ,it))
      features))))

(debug-on-load
 (
  org-compat
  org-macs
  org
  ))

(custom-set-variables 
 '(package-archive-priorities
   '(("gnu" . 100) ("nongnu" . 90) ("gnu-devel" . 80) ("melpa" . 70)
     ("ox-odt" . 60)))
 '(package-archives
   '(
     ;; ("gnu-devel" . "https://elpa.gnu.org/devel/")
     ("gnu" . "https://elpa.gnu.org/packages/")
     ("nongnu" . "https://elpa.nongnu.org/nongnu/")
     ("melpa" . "https://melpa.org/packages/")
     ;; ("ox-odt" . "https://kjambunathan.github.io/elpa/")
     ))
 '(package-directory-list '("/home/oub/.emacs.d/elpa/")))

(package-initialize 'no-activate)
(package-activate 'citeproc)

;; emacs  -Q -batch
;;     --eval '(setq vc-handled-backends nil org-startup-folded nil org-element-cache-persistent nil)'
;;     --eval '(add-to-list `load-path ".")'
;;     --eval '(load (expand-file-name "../mk/org-setup-elpa-dir.el"))'
;;     --eval '(load "org-compat.el")'
;;     --eval '(load "../mk/org-fixup.el")'
;;     --eval '(org-make-org-version "9.7.7" "release_9.2.2-6587-g01f922.dirty")'

;; The lines below are a line-to-line reproduction of what happens
;; during batch compilation of `org-mode-ox-odt' repo.

(defvar org-mode-ox-odt
  "/home/oub/ALLES/src/org-mode-ox-odt-hg/lisp"
  "`.' in the build process points to `lisp' subdir of `org-mode-ox-odt'.")

(setq vc-handled-backends nil org-startup-folded nil org-element-cache-persistent nil)

;; (add-to-list `load-path ".")
(add-to-list 'load-path org-mode-ox-odt)

;; (load (expand-file-name "../mk/org-setup-elpa-dir.el"))
(load (expand-file-name "../mk/org-setup-elpa-dir.el" org-mode-ox-odt))
(load "org-compat.el")

;; (load "../mk/org-fixup.el")
(load (expand-file-name "../mk/org-fixup.el" org-mode-ox-odt) )

(org-make-org-version "9.7.7" "release_9.2.2-6587-g01f922.dirty")

run `emacs -Q --debug-init load-file temp.el

here is the backtrace

Debugger entered: nil
  (lambda nil (message "\nLoaded `%s': %s" 'org-macs (find-library-name (symbol-name 'org-macs))) (debug))()
  eval-after-load-helper("/home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-ma...")
  run-hook-with-args(eval-after-load-helper "/home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-ma...")
  do-after-load-evaluation("/home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-ma...")
  require(org-macs)
  eval-buffer(#<buffer  *load*-323804> nil "/home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-co..." nil t)  ; Reading at buffer position 1244
  load-with-code-conversion("/home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-co..." "/home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-co..." nil nil)
  load("org-compat.el")
  eval-buffer(#<buffer  *load*> nil "/home/oub/temp.el" nil t)  ; Reading at buffer position 2310
  load-with-code-conversion("/home/oub/temp.el" "/home/oub/temp.el" nil nil)
  load("/home/oub/temp.el" nil nil t)
  load-file("~/temp.el")
  funcall-interactively(load-file "~/temp.el")
  call-interactively(load-file record nil)
  command-execute(load-file record)
  execute-extended-command(nil "load-file" "load-fil")
  funcall-interactively(execute-extended-command nil "load-file" "load-fil")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

and here the message buffer

For information about GNU Emacs and the GNU system, type C-h C-a.
Loading /home/oub/temp.el (source)...

Loading cl-loaddefs.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/cl-lib.elc

Loading cl-lib.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/package.elc

Loading url-vars.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-parse.elc

Loading bytecomp.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/map.elc

Loading gv.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/map.elc

Loading byte-opt.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/map.elc

Loading map.elc because /opt/emacs29.4/share/emacs/29.4/lisp/json.elc

Loading subr-x.elc because /opt/emacs29.4/share/emacs/29.4/lisp/json.elc

Loading json.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading password-cache.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading cl-macs.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/eieio-core.elc

Loading eieio-core.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/eieio.elc

Loading eieio.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading cl-seq.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading auth-source.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-parse.elc

Loading url-parse.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-handlers.elc

Loading url-handlers.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/package.elc

Loading mailcap.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-util.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-cookie.elc

Loading url-domsuf.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-cookie.elc

Loading generate-lisp-file.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-cookie.elc

Loading url-cookie.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-history.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-methods.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-expand.elc

Loading url-expand.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-privacy.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-proxy.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url.elc because /opt/emacs29.4/share/emacs/29.4/lisp/net/browse-url.elc

Loading browse-url.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/package.elc

Loading package.elc because /home/oub/temp.el

Loading finder-inf.el because /home/oub/temp.el

Loading dash-autoloads.el because /home/oub/temp.el

Loading info.elc because /home/oub/temp.el

Loading s-autoloads.el because /home/oub/temp.el

Loading f-autoloads.el because /home/oub/temp.el

Loading queue-autoloads.el because /home/oub/temp.el

Loading string-inflection-autoloads.el because /home/oub/temp.el

Loading parsebib-autoloads.el because /home/oub/temp.el

Loading citeproc-autoloads.el because /home/oub/temp.el
Loading /home/oub/ALLES/src/org-mode-ox-odt-hg/mk/org-setup-elpa-dir.el (source)...

Loading peg-autoloads.el because /home/oub/ALLES/src/org-mode-ox-odt-hg/mk/org-setup-elpa-dir.el

Loading rnc-mode-autoloads.el because /home/oub/ALLES/src/org-mode-ox-odt-hg/mk/org-setup-elpa-dir.el

Loading org-setup-elpa-dir.el because /home/oub/temp.el
Loading /home/oub/ALLES/src/org-mode-ox-odt-hg/mk/org-setup-elpa-dir.el (source)...done
Loading /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el (source)...

Loading format-spec.elc because /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-macs.elc

Loading org-macs.elc because /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el

Loaded ‘org-macs’: /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-macs.el

Loading help-mode.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/backtrace.elc

Loading backtrace.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/debug.elc

Loading debug.elc because /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el
Entering debugger...

Loading cl-print.elc because /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el

Loading radix-tree.elc because /opt/emacs29.4/share/emacs/29.4/lisp/help-fns.elc

Loading help-fns.elc because /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el
Continuing.

Loading pcase.elc because /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el

Loading org-compat.el because /home/oub/temp.el

Loaded ‘org-compat’: /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el
Entering debugger...
Continuing.
Loading /home/oub/ALLES/src/org-mode-ox-odt-hg/lisp/org-compat.el (source)...done
Loading /home/oub/ALLES/src/org-mode-ox-odt-hg/mk/org-fixup.el (source)...

Loading org-fixup.el because /home/oub/temp.el
Loading /home/oub/ALLES/src/org-mode-ox-odt-hg/mk/org-fixup.el (source)...done
Saving file /home/oub/org-version.el...
Wrote /home/oub/org-version.el

Loading temp.el because nil
Loading /home/oub/temp.el (source)...done

Loading display-line-numbers.elc because nil
scroll-down-command: Beginning of buffer [15 times]

Loading misearch.elc because nil
Mark saved where search started

Loading time-date.elc because nil
C-> is undefined
Mark set
next-line: End of buffer [3 times]
Making completion list...
C-> is undefined
Mark set
next-line: End of buffer
Beginning of buffer [11 times]
Mark set
Quit

so it seems to use the right file. I will continue tomorrow

ouboub commented 3 days ago

Ok I have two clones,

  1. one with git

  2. one with hg I switched now back to the git repository, am on commit 3f86a7c543aaf945a I run

  3. make clean

  4. make I also have these lines in my Emacs

(setq load-path (cons (expand-file-name "~/ALLES/src/org-mode-ox-odt/lisp") load-path)) (load-file "/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc") (load-file "/home/oub/ALLES/src/org-mode-ox-odt/lisp/odt.elc") (load-file "/home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc") (load-file "/home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-ods.elc")


I restarted Emacs, I tried again to export, and I obtain the same error, I swear it worked with 
commit `8242670d7192`
kjambunathan commented 3 days ago

I created ~/disabled/.emacs as below, and do emacs -Q and M-x load-file RET ~/disabled/.emacs followed with C-c C-e o S on your table, I get the ods file just as expected.

There is something else wrong in your init file ...

If the init file is just the following content with no additional content and with -Q on emacs -Q things work for me. It should for you too.

(require 'find-func)

(add-to-list 'after-load-functions
         (lambda (file-name)
           (message "\nLoading %s because %s" (file-name-nondirectory file-name) load-file-name)
           ;; (message "Loaded %s" (file-name-nondirectory file-name))
           ))

(defmacro debug-on--load (feature)
  `(with-eval-after-load ',feature
     (message "\nLoaded `%s': %s" ',feature
          (find-library-name (symbol-name ',feature)))
     (debug)))

(defmacro debug-on-load (feature-or-features)
  (let* ((features (or (unless (consp feature-or-features)
             (list feature-or-features))
               feature-or-features)))
    `(progn
       ,@(seq-map
      (lambda (it)
        `(debug-on--load ,it))
      features))))

(debug-on-load
 (
  org-compat
  org-macs
  org
  ))

(setq my-org-mode-ox-odt-path "~/src/emacs-extras/org-mode-ox-odt/lisp"
      ;; "~/ALLES/src/org-mode-ox-odt/lisp"
      )

(setq load-path (cons (expand-file-name my-org-mode-ox-odt-path)
              load-path))

(mapc (lambda (feature)
    (load-file
     (format "%s/%s.elc" my-org-mode-ox-odt-path feature))
    )
      '(
    org-macs
    odt
    ox-odt
    ox-ods
    ))
kjambunathan commented 3 days ago
(setq load-path (cons (expand-file-name "~/ALLES/src/org-mode-ox-odt/lisp") load-path))
 (load-file "/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc")
 (load-file  "/home/oub/ALLES/src/org-mode-ox-odt/lisp/odt.elc")
 (load-file  "/home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc")
 (load-file "/home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-ods.elc")

Loading odt will load org-compat.

Considering that org-buffer-text-pixel-width is defined in org-compat, I wonder why org-compat is missing from that list.

If I am extra paranoid, I will go with

(defvar my-org-mode-ox-odt-path
      "~/ALLES/src/org-mode-ox-odt/lisp"
      )

(setq load-path (cons (expand-file-name my-org-mode-ox-odt-path)
              load-path))

(mapc (lambda (feature)
    (load-file
     (format "%s/%s.elc" my-org-mode-ox-odt-path feature))
    )
      '(
    org-macs
    org-compat
    odt
    ox-odt
    ox-ods
    ))
ouboub commented 2 days ago

Sorry I had only time now to check, you first proposal:

  1. emacs -Q --init-debug
  2. M-x load-file
  3. the following backtrace pops up
    (lambda nil (message "\nLoaded `%s': %s" 'org-macs (find-library-name (symbol-name 'org-macs))) (debug))()
    eval-after-load-helper("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
    run-hook-with-args(eval-after-load-helper "/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
    do-after-load-evaluation("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
    load("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs...." nil nil t)
    load-file("~/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc")
    (lambda (feature) (load-file (format "%s/%s.elc" my-org-mode-ox-odt-path feature)))(org-macs)
    mapc((lambda (feature) (load-file (format "%s/%s.elc" my-org-mode-ox-odt-path feature))) (org-macs odt ox-odt ox-ods))
    eval-buffer(#<buffer  *load*> nil "/home/oub/emacs/my-org.el" nil t)  ; Reading at buffer position 1103
    load-with-code-conversion("/home/oub/emacs/my-org.el" "/home/oub/emacs/my-org.el" nil nil)
    load("/home/oub/emacs/my-org.el" nil nil t)
    load-file("~/emacs/my-org.el")
    funcall-interactively(load-file "~/emacs/my-org.el")
    call-interactively(load-file record nil)
    command-execute(load-file record)
    execute-extended-command(nil "load-file" "load-fi")
    funcall-interactively(execute-extended-command nil "load-file" "load-fi")
    call-interactively(execute-extended-command nil nil)
    command-execute(execute-extended-command)
ouboub commented 2 days ago

the second paranoid method 😉 resulted in a backtrace of the form

Debugger entered: nil
  (lambda nil (message "\nLoaded `%s': %s" 'org-macs (find-library-name (symbol-name 'org-macs))) (debug))()
  eval-after-load-helper("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  run-hook-with-args(eval-after-load-helper "/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  do-after-load-evaluation("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  load("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs...." nil nil t)
  load-file("~/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc")
  (lambda (feature) (load-file (format "%s/%s.elc" my-org-mode-ox-odt-path feature)))(org-macs)
  mapc((lambda (feature) (load-file (format "%s/%s.elc" my-org-mode-ox-odt-path feature))) (org-macs org-compat odt ox-odt ox-ods))
  eval-buffer(#<buffer  *load*> nil "/home/oub/emacs/my-org2.el" nil t)  ; Reading at buffer position 1073
  load-with-code-conversion("/home/oub/emacs/my-org2.el" "/home/oub/emacs/my-org2.el" nil nil)
  load("/home/oub/emacs/my-org2.el" nil nil t)
  load-file("~/emacs/my-org2.el")
  funcall-interactively(load-file "~/emacs/my-org2.el")
  call-interactively(load-file record nil)
  command-execute(load-file record)
  execute-extended-command(nil "load-file" "load-fil")
  funcall-interactively(execute-extended-command nil "load-file" "load-fil")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
kjambunathan commented 2 days ago

the second paranoid method 😉 resulted in a backtrace of the form

Debugger entered: nil
  (lambda nil (message "\nLoaded `%s': %s" 'org-macs (find-library-name (symbol-name 'org-macs))) (debug))()
  eval-after-load-helper("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  run-hook-with-args(eval-after-load-helper "/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  do-after-load-evaluation("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  load("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs...." nil nil t)

Just press c to continue.

Look at the snipppet I added.

There is an intentional debug statement whenever a library of interest is passed as a arg to debug-on-load call.

You can see that org-macs, org-compat and org are mentioned in the below call. And you will most likely see Emacs entering debugger thrice, and you may be pressing c thrice.

(debug-on-load
 (
  org-compat
  org-macs
  org
  ))

If you find the debug statement annoying (to being with), you can replace the above portion with

(debug-on-load
 (
  ;; org-compat
  ;; org-macs
  ;; org
  ))
ouboub commented 2 days ago

Just press c to continue. Look at the snipppet I added. There is an intentional debug statement whenever a library of interest is mentioned in debug-on-load call is loaded.

I did that. It continued to spit out the same message, till I reached the line

byte-code: Cannot open load file: No such file or directory, peg
kjambunathan commented 2 days ago

Just press c to continue. Look at the snipppet I added. There is an intentional debug statement whenever a library of interest is mentioned in debug-on-load call is loaded.

I did that. It continued to spit out the same message, till I reached the line

byte-code: Cannot open load file: No such file or directory, peg

You could have figured out yourself. Just add wherever peg is in to load-path.

(I use Emacs from master branch, and peg is a builting package)

You need to change the package directory paths in below snippet.

Note that this snippet explicitly sets package-load-list , and ONLY those packages from ELPA will be available to you.

This is essentially creates a sandbox (that contains only the essentials and nothing else) for you to use the ODT exporter.

Use this snippet

(require 'find-func)

(add-to-list 'after-load-functions
         (lambda (file-name)
           (message "\nLoading %s because %s" (file-name-nondirectory file-name) load-file-name)
           ;; (message "Loaded %s" (file-name-nondirectory file-name))
           ))

(defmacro debug-on--load (feature)
  `(with-eval-after-load ',feature
     (message "\nLoaded `%s': %s" ',feature
          (find-library-name (symbol-name ',feature)))
     (debug)))

(defmacro debug-on-load (feature-or-features)
  (let* ((features (or (unless (consp feature-or-features)
             (list feature-or-features))
               feature-or-features)))
    `(progn
       ,@(seq-map
      (lambda (it)
        `(debug-on--load ,it))
      features))))

(debug-on-load
 (
  org-compat
  org-macs
  org
  ))

(custom-set-variables
 ;; '(package-archive-priorities
 ;;   '(("gnu" . 100) ("nongnu" . 90) ("gnu-devel" . 80) ("melpa" . 70)
 ;;     ("ox-odt" . 60)))
 '(package-archives
   '(
     ;; ("gnu-devel" . "https://elpa.gnu.org/devel/")
     ("gnu" . "https://elpa.gnu.org/packages/")
     ("nongnu" . "https://elpa.nongnu.org/nongnu/")
     ("melpa" . "https://melpa.org/packages/")
     ;; ("ox-odt" . "https://kjambunathan.github.io/elpa/")
     ))
 '(package-directory-list '("/home/kjambunathan/src/emacs-init/package.el/"))
 '(package-user-dir "/home/kjambunathan/src/emacs-init/package.el")
 '(package-load-list '((org nil) (peg t) (rnc-mode t))))

(package-initialize)

(setq my-org-mode-ox-odt-path "~/src/emacs-extras/org-mode-ox-odt/lisp"
      ;; "~/ALLES/src/org-mode-ox-odt/lisp"
      )

(setq load-path (cons (expand-file-name my-org-mode-ox-odt-path)
              load-path))

(mapc (lambda (feature)
    (load-file
     (format "%s/%s.elc" my-org-mode-ox-odt-path feature))
    )
      '(
    org-macs
    odt
    ox-odt
    ox-ods
    ))
ouboub commented 2 days ago

After changing the relevant path I run

1) emacs -Q 2) and load that file

I again obtain a bunch of backtrace, I continue with c and then nothing. Here is the output of the backtrace buffer


Debugger entered: nil
  (lambda nil (message "\nLoaded `%s': %s" 'org-macs (find-library-name (symbol-name 'org-macs))) (debug))()
  eval-after-load-helper("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  run-hook-with-args(eval-after-load-helper "/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  do-after-load-evaluation("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs....")
  load("/home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs...." nil nil t)
  load-file("~/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc")
  (lambda (feature) (load-file (format "%s/%s.elc" my-org-mode-ox-odt-path feature)))(org-macs)
  mapc((lambda (feature) (load-file (format "%s/%s.elc" my-org-mode-ox-odt-path feature))) (org-macs odt ox-odt ox-ods))
  eval-buffer(#<buffer  *load*> nil "/home/oub/emacs/my-org3.el" nil t)  ; Reading at buffer position 1735
  load-with-code-conversion("/home/oub/emacs/my-org3.el" "/home/oub/emacs/my-org3.el" nil nil)
  load("/home/oub/emacs/my-org3.el" nil nil t)
  load-file("~/emacs/my-org3.el")
  funcall-interactively(load-file "~/emacs/my-org3.el")
  call-interactively(load-file record nil)
  command-execute(load-file record)
  execute-extended-command(nil "load-file" "load-fi")
  funcall-interactively(execute-extended-command nil "load-file" "load-fi")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

and here of the message buffer

For information about GNU Emacs and the GNU system, type C-h C-a.
Loading /home/oub/emacs/my-org3.el (source)...

Loading cl-loaddefs.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/cl-lib.elc

Loading cl-lib.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/package.elc

Loading url-vars.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-parse.elc

Loading bytecomp.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/map.elc

Loading gv.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/map.elc

Loading byte-opt.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/map.elc

Loading map.elc because /opt/emacs29.4/share/emacs/29.4/lisp/json.elc

Loading subr-x.elc because /opt/emacs29.4/share/emacs/29.4/lisp/json.elc

Loading json.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading password-cache.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading cl-macs.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/eieio-core.elc

Loading eieio-core.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/eieio.elc

Loading eieio.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading cl-seq.elc because /opt/emacs29.4/share/emacs/29.4/lisp/auth-source.elc

Loading auth-source.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-parse.elc

Loading url-parse.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-handlers.elc

Loading url-handlers.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/package.elc

Loading mailcap.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-util.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-cookie.elc

Loading url-domsuf.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-cookie.elc

Loading generate-lisp-file.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-cookie.elc

Loading url-cookie.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-history.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-methods.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url-expand.elc

Loading url-expand.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-privacy.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url-proxy.elc because /opt/emacs29.4/share/emacs/29.4/lisp/url/url.elc

Loading url.elc because /opt/emacs29.4/share/emacs/29.4/lisp/net/browse-url.elc

Loading browse-url.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/package.elc

Loading package.elc because /home/oub/emacs/my-org3.el

Loading finder-inf.el because /home/oub/emacs/my-org3.el

Loading rnc-mode-autoloads.el because /home/oub/emacs/my-org3.el

Loading peg-autoloads.el because /home/oub/emacs/my-org3.el
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc...

Loading format-spec.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc

Loading org-macs.elc because /home/oub/emacs/my-org3.el

Loaded ‘org-macs’: /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs.el

Loading help-mode.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/backtrace.elc

Loading backtrace.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/debug.elc

Loading debug.elc because /home/oub/emacs/my-org3.el
Entering debugger...

Loading cl-print.elc because /home/oub/emacs/my-org3.el

Loading radix-tree.elc because /opt/emacs29.4/share/emacs/29.4/lisp/help-fns.elc

Loading help-fns.elc because /home/oub/emacs/my-org3.el
Continuing.
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-macs.elc...done
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/odt.elc...

Loading pcase.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/odt.elc

Loading org-compat.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/odt.elc

Loaded ‘org-compat’: /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-compat.el
Entering debugger...
Continuing.

Loading dom.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/odt.elc

Loading odt.elc because /home/oub/emacs/my-org3.el
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/odt.elc...done
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc...

Loading xml.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading org-version.el because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox.elc

Loading ob-eval.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob-core.elc

Loading org-fold-core.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-fold.elc

Loading org-fold.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob-core.elc

Loading org-cycle.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob-core.elc

Loading ob-core.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob-exp.elc

Loading ob-exp.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox.elc

Loading oc.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox.elc

Loading rx.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ol.elc

Loading ol.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox.elc

Loading generator.elc because /opt/emacs29.4/share/emacs/29.4/lisp/emacs-lisp/avl-tree.elc

Loading avl-tree.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-element.elc

Loading ring.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-element.elc

Loading cal-loaddefs.elc because /opt/emacs29.4/share/emacs/29.4/lisp/calendar/calendar.elc

Loading cal-menu.elc because /opt/emacs29.4/share/emacs/29.4/lisp/calendar/calendar.elc

Loading calendar.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading thingatpt.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org-loaddefs.el because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org-keys.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org-table.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading ob-emacs-lisp.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading icons.elc because /opt/emacs29.4/share/emacs/29.4/lisp/outline.elc

Loading outline.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading time-date.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org-entities.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org-faces.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org-footnote.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-list.elc

Loading org-list.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading ansi-color.elc because /opt/emacs29.4/share/emacs/29.4/lisp/comint.elc

Loading ansi-osc.elc because /opt/emacs29.4/share/emacs/29.4/lisp/comint.elc

Loading comint.elc because /opt/emacs29.4/share/emacs/29.4/lisp/pcomplete.elc

Loading pcomplete.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-pcomplete.elc

Loading org-pcomplete.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading ob-comint.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-src.elc

Loading executable.elc because /opt/emacs29.4/share/emacs/29.4/lisp/progmodes/sh-script.elc

Loading treesit.elc because /opt/emacs29.4/share/emacs/29.4/lisp/progmodes/sh-script.elc

Loading smie.elc because /opt/emacs29.4/share/emacs/29.4/lisp/progmodes/sh-script.elc

Loading sh-script.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-src.elc

Loading org-src.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org-macro.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading ob-table.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob.elc

Loading ob-lob.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob.elc

Loading ob-ref.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob.elc

Loading ob-tangle.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ob.elc

Loading ob.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.elc

Loading org.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-element.elc

Loaded ‘org’: /home/oub/ALLES/src/org-mode-ox-odt/lisp/org.el
Entering debugger...
Continuing.

Loading inline.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-element-ast.elc

Loading org-element-ast.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-id.elc

Loading org-refile.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-id.elc

Loading org-id.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-persist.elc

Loading xdg.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-persist.elc

Loading org-persist.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/org-element.elc

Loading org-element.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox.elc

Loading ox.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading ox-publish.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-ascii.elc

Loading ox-ascii.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading table.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-html.elc

Loading ox-html.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading org-agenda.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-icalendar.elc

Loading ox-icalendar.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading ox-latex.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading cl-extra.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading nxml-util.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-loc.elc

Loading xmltok.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/nxml-parse.elc

Loading nxml-enc.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/nxml-parse.elc

Loading nxml-ns.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/nxml-parse.elc

Loading nxml-parse.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-loc.elc

Loading rng-pttrn.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-match.elc

Loading rng-util.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-match.elc

Loading rng-dt.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-match.elc

Loading rng-match.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-parse.elc

Loading rng-parse.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-loc.elc

Loading rng-uri.elc because /opt/emacs29.4/share/emacs/29.4/lisp/nxml/rng-loc.elc

Loading rng-loc.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading pp.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc
ox-odt: Soffice executable is ‘soffice’
ox-odt: Refusing to create / overwrite custom desktop file during load.
  To create custom desktop file, do M-x customize-variable RET org-odt-soffice-executable or
  do M-x org-odt-create-custom-desktop-file

Loading iso8601.elc because /opt/emacs29.4/share/emacs/29.4/lisp/textmodes/bibtex.elc

Loading bibtex.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/oc-csl.elc

Loading oc-csl.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc

Loading ox-odt.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc
ox-odt: Soffice executable is ‘soffice’
ox-odt: Refusing to create / overwrite custom desktop file during load.
  To create custom desktop file, do M-x customize-variable RET org-odt-soffice-executable or
  do M-x org-odt-create-custom-desktop-file

Loading ox-odt.elc because /home/oub/emacs/my-org3.el
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-odt.elc...done
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-ods.elc...

Loading peg.elc because /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-ods.elc

Loading ox-ods.elc because /home/oub/emacs/my-org3.el
Loading /home/oub/ALLES/src/org-mode-ox-odt/lisp/ox-ods.elc...done

Loading my-org3.el because nil
Loading /home/oub/emacs/my-org3.el (source)...done

Loading display-line-numbers.elc because nil

Now: I can export to ods. So I conclude I have to somehow merge this setting into my init file, and we can close the issue.

kjambunathan commented 2 days ago

Now: I can export to ods. So I conclude I have to somehow merge this setting into my init file, and we can close the issue.

Good.

ouboub commented 2 days ago

Now: I can export to ods. So I conclude I have to somehow merge this setting into my init file, and we can close the issue.

Good.

I just used these in my init file, and the conversion failed with the same error, I started with. So I have to debug my init file (in the afternoon).

ouboub commented 2 days ago

Something interesting:

Warning (package): Unnecessary call to ‘package-initialize’ in init file
⛔ Warning (emacs): Org version mismatch.
This warning usually appears when a built-in Org version is loaded
prior to the more recent Org version.

Version mismatch is commonly encountered in the following situations:

1. Emacs is loaded using literate Org config and more recent Org
   version is loaded inside the file loaded by ‘org-babel-load-file’.
   ‘org-babel-load-file’ triggers the built-in Org version clashing
   the newer Org version attempt to be loaded later.

   It is recommended to move the Org loading code before the
   ‘org-babel-load-file’ call.
kjambunathan commented 2 days ago

The problem is squarely at your end.

Nevertheless here is a suggestion.

I don't know if you use early-init.el file. Add the following to the very beginning of early-init file ...

(advice-add 'org-release :around
        (defun org-release--around (orig-fun &rest orig-args)
          (pcase-let* ((`nil orig-args))
        (let (frames frame (index 0))
          (while (setq frame (backtrace-frame index))
            (push frame frames)
            (cl-incf index))
          (message "%S" (list (format "org-release check @ %s" load-file-name) 
                      (thread-last frames
                           (seq-keep (lambda (f)
                                   (when (eq (nth 1 f) 'require)
                                 (nth 2 f)))))))
          ;;(debug)
          )
        (apply orig-fun orig-args))))

(setq package-enable-at-startup nil)

and report what you see in *Messages* buffer.

The messages buffer will have messages like

("org-release check @ /home/kjambunathan/src/emacs-extras/org-mode-ox-odt/lisp/ol-bibtex.elc" (org ox-odt ox ox-odt oc-csl citeproc citeproc-cite citeproc-biblatex citeproc-bibtex ol-bibtex))

It means that ol-bibtex is getting loaded, and is doing an org-assert-version. And the load sequence is something like org->ox->ox-odt->oc-csl etc -> citeproc-bibtex->ol-bibtex.

You may want to experiment with package-enable-at-startup set to nil or t.

THIS together with debug-on-load infrastructure will help you find out what is causing the problem. FWIW, you can put the debug-on-load infrastructure to early-init.el.

kjambunathan commented 2 days ago

The problem is squarely at your end.

I can go a step further and say it is the package.el infrastructure (specifically package-initialize and package-activate together with package-enable-at-startup etc) which is causing you the problem.

So, addressing the problem you see will depend on much if and how you use the package.el infrastructure. Obviously, I don't have access to your init files. Yeah, you are on your own here.

FWIW, since last year or so, I have stopped using package.el for my Emacs, and started using straight.el instead. I am VERY HAPPY that I made this switch.

package.el is headache ... and it is a BIG HEADACHE (for me atleast).

kjambunathan commented 2 days ago

You can also add the following advice to early-init.el.

It will tell you the sequence in which packages are getting activated.

(advice-add 'package-activate-1 :around
        (defun package-activate-1--around (orig-fun &rest orig-args)
          (pcase-let* ((`(,pkg-desc ,reload ,deps) orig-args))
        (let* ((name (package-desc-name pkg-desc))
               (pkg-dir (package-desc-dir pkg-desc)))
          (message "\n\nActivating %s @ %s" name pkg-dir))
        (apply orig-fun orig-args))))           

;; (advice-remove 'package-activate-1 'package-activate-1--around)