emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: orgmode@grierwhite.com
Cc: emacs-orgmode@gnu.org
Subject: Re: can't find org-version?
Date: Tue, 04 Sep 2012 13:15:32 -0400	[thread overview]
Message-ID: <7390.1346778932@alphaville.americas.hpqcorp.net> (raw)
In-Reply-To: Message from "Christopher J. White" <orgmode@grierwhite.com> of "Tue\, 04 Sep 2012 07\:34\:35 PDT." <5046117B.9050400@grierwhite.com>

Christopher J. White <orgmode@grierwhite.com> wrote:

> So in version 7.8 and earlier, org-version is both a variable and a
> function.  The function is not useful to coders because it displays
> the version string as a message:
> 
> (org-version)
> "Org-mode version 7.8.03 (release_7.8.03.437.g60ca.dirty)"
> 
> org-version
> "7.8.03"
> 
> I used org-version as a variable because there was an incompatibility
> between 7.7 and 7.8 for the function
> org-export-remove-or-extract-drawers.
> 
> So, what is the proper way to get the version number in 7.9?  It seems
> awkward to me that all clients would have to require something other
> than just "org" to get the version number, but I can live with that.
> 
> What I don't want to do, though, is mess around with testing for the
> existence of various functions and variables just to figure out where
> to get the version number from.
> 

Disregard my previous email: in 7.7 (and maybe 7.8), org-version (the function)
does not return a simple "7.7".

Here is a snippet of code that works in those two and in 7.9.1 as well:

(setq version (if (boundp 'org-version)
	          org-version
	         (org-version))

It does not meet your requirements in the last paragraph above, but it's
not too bad.

I just hope that I haven't missed anything this time.

Nick

> Why not just keep the variable org-version around just like in 7.8 and
> earlier?
> 
> Otherwise, can someone please post a code snippet that gets me the
> version string "7.8.03" that will work with 7.7, 7.8 and 7.9?
> 
> ...cj
> 
> On 9/4/12 6:13 AM, Giovanni Ridolfi wrote:
> > Da: Nick Dokos <nicholas.dokos@hp.com>
> >
> > Inviato: Martedì 4 Settembre 2012 14:04
> >
> >> Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> wrote:
> >>> Would you please try to add (require 'org-install) instead of (require 'org)  and see if org-toodledo works?
> >>>
> >>>> As mentioned in one of the above threads, the version of a package is pretty fundamental
> >>>>    and I'd expect it to be provided by the base require.
> >>>
> >>> The variable org-version *is indeed provided* but not in the file your code expects it.
> >>>
> >> Is it? I can only find a function named org-version, not a variable.
> >
> > Hi, Nick,
> >
> > you're right, therfore, obviously ;-) I was wrong.
> >
> > The function is org-version and it gets its arguments from  the variables
> > org-release
> > and
> > org-git-version
> > defined in the file  lisp/org-version.el
> >
> > thanks for pointing it up.
> >
> > cheers,
> > Giovanni
> >
> >
> >
> 

  parent reply	other threads:[~2012-09-04 17:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03  3:46 can't find org-version? Benjamin Slade
2012-09-03  7:23 ` Giovanni Ridolfi
2012-09-03 13:30   ` Suvayu Ali
2012-09-03 14:45   ` Benjamin Slade
2012-09-03 14:48   ` Christopher J. White
2012-09-04 11:14     ` Giovanni Ridolfi
2012-09-04 11:55       ` Suvayu Ali
2012-09-04 12:04       ` Nick Dokos
2012-09-04 13:13         ` Giovanni Ridolfi
2012-09-04 14:34           ` Christopher J. White
2012-09-04 14:59             ` Nick Dokos
2012-09-04 17:15             ` Nick Dokos [this message]
2012-09-04 20:03               ` Christopher J. White
2012-09-06 17:31                 ` Achim Gratz
2012-09-06 17:43                   ` Bastien
2012-09-06 18:09                     ` Achim Gratz
2012-09-06 18:20                     ` Achim Gratz
2012-09-06 19:14                       ` Bastien
2012-09-06  6:55 ` Achim Gratz
2012-09-06 17:50   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7390.1346778932@alphaville.americas.hpqcorp.net \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=orgmode@grierwhite.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).