Commit graph

12 commits

Author SHA1 Message Date
Bastien Guerry 6e2838745c org-fixup.el (org-fixup): Fix tiny typo. 2012-08-08 10:05:41 +02:00
Achim Gratz 6fbc226ca5 further cleanup for org version
* UTILITIES/org-fixup.el (org-make-org-version): Provide feature
  'org-version.
* lisp/org-compat.el (org-check-version): New macro.  Check if
  org-version.el exists and provide autoloads to that. Otherwise check
  if org-fixup.el exists and use it to provide definitions.  Finally
  if nothing worked, complain about a botched installation and provide
  fallback definitions.
* lisp/org.el: Use org-check-version.

This should finally provide the correct behaviour in all supported
use-cases as well as a few corner scenarios that were reported on the
mailing list and allow to always build on Git, ELPA and Emacs Bzr
correctly.  The file org-version.el must be added to the Emacs sources
and should be re-generated each time orgmode Git is synced to Emacs
Bzr (it would be best to automate this).

Note that the internal functions (org-release) and (org-git-release)
are not autoloaded when org-version is not present and become only
available when org.el is loaded.  This should pose no problem since
they are only used by (org-version), which is autoloaded from org.el.
2012-07-15 13:53:53 +02:00
Achim Gratz 6762c7ea60 Clean-up for build system support and a fix for org-version.
* UTILITIES/org-fixup.el: Clean up and add doc strings.
* UTILITIES/org-fixup.el (org-make-autoloads): Add optional arguments
  and implementation for comopiling and force compiling.
* UTILITIES/org-fixup.el (org-make-autoloads-compile,
  org-make-autoloads-compile-force): Convenience definitions with
  pre-selected arguments, avoids complicated quoted on invocation from
  command line.
* UTILITIES/org-fixup.el (org-fixup): Add "-git" to git version when
  run from a bare Git worktree.  Give message instead of returning
  string inside quoted progn for easier tracing.
* lisp/org.el: Fix a subtle error resulting in version functions
  sometimes not being defined and byte-compiling failing.  Always
  compile in fallback definitions into org.elc -- org-fixup either
  provides re-definitions at compile-time or checks org-version.el and
  then the git work tree when run uncompiled.  So the fallback
  definitions will only come into effect when org-fixup is not
  available.
2012-07-14 20:42:18 +02:00
Achim Gratz b050afa06f Let the user override the version strings produced in org-fixup.
* UTILITIES/org-fixup.el (org-fixup): Let the user override the
  version strings produced in org-fixup whith strings stored in
  org-fake-release and org-fake-git-version.  Skip loading them from a
  pre-existing org-version.el or trying to determine them from git in
  this case.  This is predominantly useful if Git is not available,
  but the user wants to install from a Git tarball which is missing a
  pre-configured org-version.el file.
2012-07-11 22:20:52 +02:00
Achim Gratz 0db8233460 replace the remaining occurences of sed with emacs scripts, implement mkdir with install
* UTILITIES/org-fixup.el (org-make-local-mk): New function to create a
  local.mk template from default.mk.

* UTILITIES/org-fixup.el (org-make-letterformat): New function to
  replace the format string for A4 with one for Letter.

* default.mk: Few cosmetic changes to the template section.  Add
  definition MAKE_LOCAL_MK for call to org-make-local-mk.  Remove
  definition for SED, which is not used anymore.  Implement MKDIR with
  'install -d' by default.  Since both CP and MKDIR are now
  implemented with install, this reduces the number of external
  dependencies.  Add mode settings to both invocations of install to
  keep the modes of installed files sane even if umask is set to a
  strange value.

* targets.mk: Remove sed script and use $(MAKE_LOCAL_MK) instead.

* doc/Makefile: Remove sed script and replace with emacs script.  This
  script can not be placed into a variable since it would expand $<
  and $@ in the context of the "card" target rather than the pattern
  rule.
2012-05-30 12:30:21 +02:00
Achim Gratz c656052326 use load instead of require in org-fixup.el
* UTILITIES/org-fixup.el: Use load instead of require so that the
  current definitions are used regardless of any previous provision of
  the requested feature.
2012-05-25 01:25:02 +02:00
Achim Gratz 372948a88f use only relative paths for better compatibility with mixed Cygwin/NTEmacs installations
* UTILITIES/org-fixup.el(org-make-org-install): Use relative filenames
  throughout, and query Emacs for directory names where a full path is
  required.  This avoids Cygwin/POSIX paths being misinterpreted by a
  stock NTEmacs.  Use the same regex as (org-reload) for enumerating
  the files to byte-compile.

* default.mk: Factor out standard load-path for Emacs started in lisp/
  into BATCHL and use this in defaults.  Make all paths to be
  interpreted by Emacs relative so Cygwin and NTEmacs can coexist.
2012-05-21 15:34:25 +02:00
Achim Gratz 7b33d9f56b make functions in org-fixup.el more robust, add full build functionality
* UTILITIES/org-fixup.el(org-make-org-version): Use temporary buffer.

* UTILITIES/org-fixup.el(org-make-org-install): Use temporary buffer.

* UTILITIES/org-fixup.el(org-make-autoloads): New function, generates
  autoload files using (org-make-org-version)
  and (org-make-org-install).  Uses (org-fixup) to determine version
  strings.

* UTILITIES/org-fixup.el(org-make-autoloads-compile): New function,
  generates autoload files using (org-make-autoloads) and
  byte-compiles files in lisp.  Optional argument forces
  re-compilation of all files.

* UTILITIES/org-fixup.el(org-fixup): Clean up whitespace and correct the
  unwind form.
2012-05-19 20:04:34 +02:00
Achim Gratz 4ea1573b9d Remove "release_" prefix from org-version when org-fixup is run
* UTILITIES/org-fixup.el: Remove "release_" prefix from org-version
  when it is established from git.
2012-05-18 07:45:47 +02:00
Achim Gratz 4f29c630d8 XEmacs compatibility improvements
* lisp/org-compat.el (org-find-library-dir): rename
  org-find-library-name (misleading) and implement with a function
  that exists identically in Emacs/XEmacs.

* UTILITIES/org-fixup.el: change calls to org-find-library-dir.
  Simplify invocations of git, use the same arguments as in targets.mk
  and use only functions that work the same in EMacs and XEmacs.

* lisp/org-exp-blocks.el: change calls to org-find-library-dir.

* lisp/org.el: change calls to org-find-library-dir.  Make require for
  noutline fail silently because it is missing from XEmacs.
2012-05-18 07:45:45 +02:00
Achim Gratz e7d2e4e186 ensure that M-x org-version always delivers something useful
* UTILITIES/org-fixup.el (org-make-org-version): change defconst to
  defun for org-release and org-git-version and close over those
  variables (do not make them global anymore).

* UTILITIES/org-fixup.el (org-fixup): check for org-version.el or try
  to use git to get the version from the worktree (code uses parts of
  the former implementation from org.el).

* lisp/org.el (org-version): use functions instead of global variables
  to get the version strings and remove the defvaralias to
  org-version.  Warn when encountering a mixed installation (org and
  org-install.el should be found in the same directory).

Supported use-cases:

1) Org uninstalled (and possibly uncompiled) from Git or tarball.

1a) No org-version.el or org-install.el exists in worktree.  Partially
supported configuration, org version is determined from git if
possible via UTILITIES/org-fixup.el.  However, Emacs versions
delivered with orgmode will provide autoloads that may or may not work
with that version of org (mixed installation).  If such a situation is
encountered, warn the user.  It can work if the autoloads from the
installation match the ones that would be generated for the worktree,
which generelly is only the case if there is a relatively recent
installation in site-lisp.

1b) Autoload file org-install.el exists in worktree.  Fully supported
configuration, org version is determined from git if possible via
UTILITIES/org-fixup.el.

1c) Both org-version.el or org-install.el exist in worktree.
Recommended configuration for 1), org version is taken from
org-version.el (git never gets invoked).

2) Org installed.  Both org-version.el and org-install.el must exist
in install directory.  Only supported configuration for 2), org
version is taken from org-version.el (git never gets invoked since
UTILITIES/org-fixup.el is not available).

Any unsupported configuration should still yield a version string, but
it will contain "N/A" to alert the user about a botched org
installation.
2012-05-18 07:45:45 +02:00
Achim Gratz df89e3cd0c cleanup in lisp/Makefile, targets; create org-fixup.el, remove version definition
* UTILITIES/org-fixup.el: new file, has functions to create
  org-version.el and org-install.el, now use by the build system.

* lisp/Makefile: delete said definitions, now sourced from toplevel
  make.  "clean" and "cleanall" should do the same thing here, make
  them aliases, ditto for "all" and "compile".  Both autoload files
  must be .PHONY and depend only on each other for correct ordering.
  Make "compile-dirty" actually do that again (i.e. no implied
  "clean", but "cleanauto").  Remove autoload files directly after
  install, so that they will only be present when explicitly requested
  by "autoloads".  Create "org-version.el" before compilation as it is
  mandatory.  Remove $(ORG_MAKE_INSTALL) and $(ORG_MAKE_VERSION),
  source from default.mk/local.mk.

* default.mk: move definitions for $(ORG_MAKE_INSTALL) and
  $(ORG_MAKE_VERSION) here so that they can be more easily configured.
  Remove definition of "org-release" from $(BATCH) and $(BTEST), now
  sourced from "org-version.el".

* targets.mk: target reorganization, introduce "stop" targets to
  prevent cleaning of org-version.el.  Use new targets for "oldorg" to
  make it more robust in case of errors.  New target "cleanutils" to
  remove any "*.elc" files that may have been produced there and add
  this target to "cleanall". Do the same in cleancontrib.
2012-05-18 07:45:44 +02:00