emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to compare org-mode version to current file needs
@ 2011-03-16 12:42 Olaf.Hamann
  2011-03-16 14:21 ` Eric S Fraga
  2011-03-17  7:18 ` Bastien
  0 siblings, 2 replies; 6+ messages in thread
From: Olaf.Hamann @ 2011-03-16 12:42 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to compare org-mode version to current file needs
  2011-03-16 12:42 how to compare org-mode version to current file needs Olaf.Hamann
@ 2011-03-16 14:21 ` Eric S Fraga
  2011-03-17  7:18 ` Bastien
  1 sibling, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2011-03-16 14:21 UTC (permalink / raw)
  To: Olaf.Hamann; +Cc: emacs-orgmode

"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)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to compare org-mode version to current file needs
  2011-03-16 12:42 how to compare org-mode version to current file needs Olaf.Hamann
  2011-03-16 14:21 ` Eric S Fraga
@ 2011-03-17  7:18 ` Bastien
  2011-03-17  8:38   ` Olaf.Hamann
  1 sibling, 1 reply; 6+ messages in thread
From: Bastien @ 2011-03-17  7:18 UTC (permalink / raw)
  To: Olaf.Hamann; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to compare org-mode version to current file needs
  2011-03-17  7:18 ` Bastien
@ 2011-03-17  8:38   ` Olaf.Hamann
  2011-03-17  9:12     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Olaf.Hamann @ 2011-03-17  8:38 UTC (permalink / raw)
  To: Bastien, Emacs-orgmode mailing list

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?
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to compare org-mode version to current file needs
  2011-03-17  8:38   ` Olaf.Hamann
@ 2011-03-17  9:12     ` Bastien
  2011-03-17 10:08       ` Olaf.Hamann
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2011-03-17  9:12 UTC (permalink / raw)
  To: Olaf.Hamann; +Cc: Emacs-orgmode mailing list

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to compare org-mode version to current file needs
  2011-03-17  9:12     ` Bastien
@ 2011-03-17 10:08       ` Olaf.Hamann
  0 siblings, 0 replies; 6+ messages in thread
From: Olaf.Hamann @ 2011-03-17 10:08 UTC (permalink / raw)
  To: Bastien; +Cc: Emacs-orgmode mailing list

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-17 10:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-16 12:42 how to compare org-mode version to current file needs Olaf.Hamann
2011-03-16 14:21 ` Eric S Fraga
2011-03-17  7:18 ` Bastien
2011-03-17  8:38   ` Olaf.Hamann
2011-03-17  9:12     ` Bastien
2011-03-17 10:08       ` Olaf.Hamann

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).