Re: [PATCH] Prevent mixed installation

2022-09-03 Thread Ihor Radchenko
Ihor Radchenko  writes:

> The annoying mixed installation problems keep popping up in the mailing
> list and other communication channels.
>
> The attached is a patch trying to forbid loading multiple Org versions.
> The idea is putting a macro that internally expands Org git version at
> compile time and later compares the expanded value with the runtime
> value.

Applied onto main via e81a09438 after amendments.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e81a094383a2e06a80e6dfb5ed0ca1ece44026f2

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



[PATCH] Prevent mixed installation

2022-08-05 Thread Ihor Radchenko
Hi,

The annoying mixed installation problems keep popping up in the mailing
list and other communication channels.

The attached is a patch trying to forbid loading multiple Org versions.
The idea is putting a macro that internally expands Org git version at
compile time and later compares the expanded value with the runtime
value.

Comments? Alternative ideas?

In the past we also discussed checking load-history, but I am afraid
that it will spoil the loading time. load-history can get quite large.

Also, I was thinking about using
(provide 'library '(version-subfeature))
but I have no idea how to do it automatically.

The proposed patch only requires adding two lines to newly added Org
libraries in future. Otherwise, it should just work.

Best,
Ihor

>From d493ab5e467033919ab0ce0ebf502d39e0b131b2 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Thu, 4 Aug 2022 21:53:05 +0800
Subject: [PATCH] Assert all the Org files to load the same Org version

* lisp/org-compat.el (org-assert-version): New macro comparing Org
version at compile time and laod time.

Add `org-assert-version' call to all files:

* lisp/org-macs.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-cycle.el:
* lisp/org-datetree.el:
* lisp/org-duration.el:
* lisp/org-element.el (avl-tree):
* lisp/org-entities.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-fold-core.el:
* lisp/org-fold.el:
* lisp/org-footnote.el:
* lisp/org-goto.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-keys.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-macro.el:
* lisp/org-mobile.el:
* lisp/org-mouse.el:
* lisp/org-num.el:
* lisp/org-pcomplete.el:
* lisp/org-persist.el:
* lisp/org-plot.el:
* lisp/org-protocol.el:
* lisp/org-refile.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-tempo.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-beamer.el:
* lisp/ox-html.el:
* lisp/ox-icalendar.el:
* lisp/ox-koma-letter.el:
* lisp/ox-latex.el:
* lisp/ox-man.el:
* lisp/ox-md.el:
* lisp/ox-odt.el:
* lisp/ox-org.el:
* lisp/ox-publish.el:
* lisp/ox-texinfo.el:
* lisp/ox.el:
---
 lisp/ob-C.el   |  3 +++
 lisp/ob-R.el   |  3 +++
 lisp/ob-awk.el |  4 
 lisp/ob-calc.el|  4 
 lisp/ob-clojure.el |  4 
 lisp/ob-comint.el  |  4 
 lisp/ob-core.el|  4 
 lisp/ob-css.el |  4 
 lisp/ob-ditaa.el   |  4 
 lisp/ob-dot.el |  4 
 lisp/ob-emacs-lisp.el  |  2 ++
 lisp/ob-eshell.el  |  3 +++
 lisp/ob-eval.el|  3 +++
 lisp/ob-exp.el |  4 
 lisp/ob-forth.el   |  4 
 lisp/ob-fortran.el |  4 
 lisp/ob-gnuplot.el |  4 
 lisp/ob-groovy.el  |  4 
 lisp/ob-haskell.el |  3 +++
 lisp/ob-java.el|  4 
 lisp/ob-js.el  |  4 
 lisp/ob-julia.el   |  4 
 lisp/ob-latex.el   |  4 
 lisp/ob-lilypond.el|  4 
 lisp/ob-lisp.el|  4 
 lisp/ob-lob.el |  4 
 lisp/ob-lua.el |  4 
 lisp/ob-makefile.el|  3 +++
 lisp/ob-matlab.el  |  4 
 lisp/ob-maxima.el  |  4 
 lisp/ob-ocaml.el   |  4 
 lisp/ob-octave.el  |  4 
 lisp/ob-org.el |  4 
 lisp/ob-perl.el|  3 +++
 lisp/ob-plantuml.el|  4 
 lisp/ob-processing.el  |  4 
 lisp/ob-python.el  |  4 
 lisp/ob-ref.el |  4 
 lisp/ob-ruby.el|  4 
 lisp/ob-sass.el|  4 
 lisp/ob-scheme.el  |  4 
 lisp/ob-screen.el  |  4 
 lisp/ob-sed.el |  4 
 lisp/ob-shell.el   |  3 +++
 lisp/ob-sql.el |  4 
 lisp/ob-sqlite.el  |  4 
 lisp/ob-table.el   |  4 
 lisp/ob-tangle.el  |  3 +++
 lisp/ob.el |  4 
 lisp/oc-basic.el   |  3 +++
 lisp/oc-biblatex.el|  4 
 lisp/oc-bibtex.el  |  4 
 lisp/oc-csl.el |  4 
 lisp/oc-natbib.el  |  4 
 lisp/oc.el |  3 +++
 lisp/ol-bbdb.el|  3 +++
 lisp/ol-bibtex.el  |  3 +++
 lisp/ol-docview.el |  2 ++
 lisp/ol-doi.el |  3 +++
 lisp/ol-eshell.el  |  2 ++
 lisp/ol-eww.el |  4 
 lisp/ol-gnus.el|  3 +++
 lisp/ol-info.el|  3 +++
 lisp/ol-irc.el |  3 +++
 lisp/ol-man.el |  3 +++
 lisp/ol-mhe.el |  3 +++
 lisp/ol-rmail.el   |  3 +++
 lisp/ol-w3m.el |  3 +++
 lisp/ol.el |  3 +++
 lisp/org-agenda.el |  3 +++
 lisp/org-archive.el|  3 +++
 lisp/org-attach-git.el |  3 +++
 lisp/org-attach.el |  3 +++
 lisp/org-capture.el|  3 +++
 lisp/org-clock.el  |  3 +++
 lisp/org-colview.el|  3 +++
 lisp/org-compat.el |  3 +++
 lisp/org-crypt.el  |  3 +++
 lisp/org-ctags.el  |  3 +++
 lisp/org-cycle.el  |  3 +++
 lisp/org-datetree.el   |  3 +++
 lisp/org-duration.el   |  3 +++
 lisp/org-element.el|  2 ++
 lisp/org-entities.el   |  3 +++
 lisp/org-faces.el  |  3