Hello, is there any org-mode expression for saying "this org-file needs org-version > xxx" which will compare current needs of the file to used orgmode at org-file startup and present a little message to the user? I think, it could be done with an emacs-lisp block comparing org-version to a certain string, but I have to express this org-file needs org-version >= "Org-mode version 7.5 (release_7.5.47.g4d9f2.dirty)" and I don't know what or how to compare (string compare or git timeline or so?). Thank you very much in advance, Olaf
"Olaf.Hamann" <O.Hamann@gmx.net> writes: > Hello, > > is there any org-mode expression for saying "this org-file needs > org-version > xxx" > which will compare current needs of the file to used orgmode at > org-file startup > and present a little message to the user? not that I know of. > I think, it could be done with an emacs-lisp block comparing > org-version to a certain string, > but I have to express > > this org-file needs org-version >= "Org-mode version 7.5 > (release_7.5.47.g4d9f2.dirty)" > > and I don't know what or how to compare (string compare or git > timeline or so?). You might want to compare against the string =org-version= (as opposed to the output from the function of the same name). This will be the last release version and will not include the number of commits etc from that release onwards. I would think that comparing to an actual release should be the finest granularity you should use? -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.55.g87c42.dirty)
Hi Olaf,
"Olaf.Hamann" <O.Hamann@gmx.net> writes:
> is there any org-mode expression for saying "this org-file needs
> org-version > xxx"
No. In what case is it useful? Org tries to be backward compatible
and can export any _old_ .org formatted file I can think of.
Do you have an example where it is needed?
--
Bastien
Hi Bastien,
I'm using head of git repository and Eric Schulte has just added a
feature to org-babel,
which I do use very often (expanding macros in src blocks).
Tangling without that new feature produce corrupt code files.
So I would like to give a hint to myself (as I run different Emacse in
various virtual machines) and perhaps to colleques,
if they would like to use the org-file as well.
So if that feature will be still included in next stable org-mode
release, I can compare to string =org-version= less or greater 7.5
but in the meantime I would like to compare to a certain git revision.
I have to take a look into git manual, right?
Thank you very much
Olaf
Am 17.03.2011 08:18, schrieb Bastien:
> Hi Olaf,
>
> "Olaf.Hamann"<O.Hamann@gmx.net> writes:
>
>> is there any org-mode expression for saying "this org-file needs
>> org-version> xxx"
> No. In what case is it useful? Org tries to be backward compatible
> and can export any _old_ .org formatted file I can think of.
>
> Do you have an example where it is needed?
>
Hi Olaf, "Olaf.Hamann" <O.Hamann@gmx.net> writes: > I'm using head of git repository and Eric Schulte has just added a feature > to org-babel, > which I do use very often (expanding macros in src blocks). > Tangling without that new feature produce corrupt code files. now I understand, thanks. > So I would like to give a hint to myself (as I run different Emacse in > various virtual machines) and perhaps to colleques, > if they would like to use the org-file as well. Just say "This file needs Org development version" and remove this message when it is not true anymore (after the next release). > So if that feature will be still included in next stable org-mode release, (Note that, historically, I think all the features from the git dev version go to the release.) > I can compare to string =org-version= less or greater 7.5 > but in the meantime I would like to compare to a certain git revision. > > I have to take a look into git manual, right? I don't see the real need for something complicated. Just say that the .org file needs current head until it's not true anymore. If you don't want to have to update this message, say (insert "This file needs " (org-version)) If the needed version is a release version, it will look like This file needs Org-mode version 7.5 (release_7.5) otherwise it will look like This file needs Org-mode version 7.5 (release_7.5.71.g58e351) where the ".71.g58e351" say it's one of the git commit in current development version. HTH, -- Bastien
Am 17.03.2011 10:12, schrieb Bastien:
> [...]
> I don't see the real need for something complicated. Just say that the
> .org file needs current head until it's not true anymore. If you don't
> want to have to update this message, say
>
> (insert "This file needs " (org-version))
> [..]
Pragmatical, easy to implement solution, Bastien, thank you very much.
What I was thinking about meanwhile is:
* write an emacs-lisp function to check whether the needed
variable/function is available
** if not, throw an error
* attach that function to org-babel-pretangle-hook
So now I can choose between two solutions to this problem,
thanks to the list for answering my question.
Regards,
Olaf