Commit Graph

302 Commits

Author SHA1 Message Date
Bastien Guerry 372a3ecda8 New compatibility macro `org-with-silent-modifications'
* org-macs.el: Don't define `with-silent-modifications' for
emacsen that don't have it.

* org-compat.el (org-with-silent-modifications): New
compatibility macro.

* org.el (org-refresh-category-properties)
(org-refresh-properties, org-entry-blocked-p)
(org-agenda-prepare-buffers):
* org-indent.el (org-indent-remove-properties)
(org-indent-add-properties):
* org-colview.el (org-columns-display-here)
(org-columns-remove-overlays, org-columns-quit)
(org-columns-edit-value, org-columns-compute-all)
(org-columns-compute, org-agenda-colview-compute):
* org-clock.el (org-clock-sum): Use the compatibility macro
`org-with-silent-modifications' instead of
`with-silent-modifications'.

Thanks to Achim for a preliminary patch.
2013-02-25 11:44:27 +01:00
Bastien Guerry 5ea1322c99 org-compat.el (org-file-equal-p): New compatibility function
* org-compat.el (org-file-equal-p): New compatibility function.

* ox.el (org-export-output-file-name): Use the new function.

Thanks to Mark Edgington for reporting this.
2013-02-19 18:01:03 +01:00
Bastien Guerry 7369cada30 Merge branch 'maint' 2013-01-13 11:17:56 +01:00
Bastien Guerry e8f5b0ad72 Delete `org-condition-case-unless-debug'
* org-compat.el (org-condition-case-unless-debug): Delete.

* org-odt.el (org-odt-cleanup-xml-buffers): Use
`condition-case' instead of `org-condition-case-unless-debug',
which is now deleted.
2013-01-13 09:27:08 +01:00
Bastien Guerry 3a5a4ddd41 Revert "Backwards compatibility: don't defalias special forms"
This reverts commit b63275350f.
2013-01-13 09:24:43 +01:00
Bastien Guerry 04eb4b08c3 Revert "Compatibility: Use org-define-obsolete-{function,variable}-alias"
This reverts commit 305f29776f.
2013-01-13 09:19:24 +01:00
Achim Gratz 409ee8a2f2 Compatibility: XEmacs does not have user-emacs-directory, use user-init-directory instead
* lisp/org-compat.el (user-emacs-directory): If not bound, define as an alias to
  `user-init-directory´ so that XEmacs continues to be happy with Org.
2013-01-12 18:24:18 +01:00
Bastien Guerry 72bc144c15 Update Copyright lines to match Emacs format. 2013-01-08 15:04:32 +01:00
Achim Gratz 305f29776f Compatibility: Use org-define-obsolete-{function,variable}-alias
* lisp/org-compat.el (org-define-obsolete-function-alias,
  org-define-obsolete-variable-alias): Introduce new compatibility
  macros to obsolete functions and variables.

* lisp/org-agenda.el, lisp/org-clock.el, lisp/org-id.el,
  lisp/org-lparse.el, lisp/org-protocol.el lisp/org.el: Use
  `org-define-obsolete-{function,variable}-alias´instead of
  `define-obsolate{function,variable}-alias´.
2013-01-06 18:29:05 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Bastien Guerry 1b4e396b6b Merge branch 'maint-fixes' into maint 2012-12-24 14:01:25 +01:00
Achim Gratz b63275350f Backwards compatibility: don't defalias special forms
* lisp/org-compat.el (org-condition-case-unless-debug): Do not use
  defalias for special forms, the Emacs 22 byte-compiler does not
  recognize them correctly when compiling macros.  Use a macro instead
  and rely on macro expansion.  That however makes the decision at
  compile time, which should be acceptable in this case since it only
  affects debugging.
2012-12-24 14:01:14 +01:00
Bastien Guerry 58999598ed New compatibility function `org-delete-directory'
* org-compat.el (org-delete-directory): New compatibility
function for Emacs 22, where `delete-directory' does not
support recursive deletion.

* org-odt.el (org-odt-cleanup-xml-buffers): Use the new
compatibility function.

Thanks to Achim and Jambunathan for suggesting this.
2012-12-24 13:51:48 +01:00
Achim Gratz b508943d32 org-compat: new macro org-no-popups
* lisp/org-compat.el (org-no-popups): New wrapper macro which
  let-binds the correct variables to suppress popup windows depending
  on the Emacs version in use.  This is a compile-time decision when
  byte-compiling.

* lisp/org.el (org-get-location, org-switch-to-buffer-other-window):
  Use the wrapper `org-no-popups´ to let-bind the correct variables
  for suppression of popup windows.
2012-12-20 12:57:52 +01:00
Bastien Guerry 23e2346c4c org-compat.el: Fix bug: don't use `eval-when-compile' when aliasing `user-error'.
* org-compat.el: Fix bug: don't use `eval-when-compile' when
aliasing `user-error'.

Thanks to Bernt Hansen for reporting this bug.
2012-12-19 17:43:57 +01:00
Achim Gratz b9ea74a195 Backwards compatibility for `user-error´
* lisp/org-compat.el (user-error): Defalias to `error´ for Emacsen
  that don't have it.
2012-12-19 15:33:29 +01:00
Achim Gratz d56ad98544 fix a possible (wrong-type-argument stringp nil) error
* lisp/org-compat.el: Make sure that file-name-directory is getting a
  stringp.  This avoids a possible "(wrong-type-argument stringp nil)"
  error when the library in question does not exist.
2012-10-07 18:11:33 +02:00
Achim Gratz c5977e7e9d Revert "org-compat.el: New compatibility function `org-random'"
This reverts commit 7719734dd7.

* lisp/org-id.el: Do not use (random t), we just want a new random
  number, not a re-seeding of the PRNG for which (random t) doesn't
  provide enough entropy anyway.  Even if (random) would always
  produce the same sequence, the other components going into the MD5
  hash ensure that the result will be unique.
2012-09-11 21:42:38 +02:00
Bastien Guerry 7719734dd7 org-compat.el: New compatibility function `org-random'
* org-compat.el (org-random): New compatibility function.

* org-id.el (org-id-uuid): Use it.
2012-09-03 13:16:52 +02:00
Bastien Guerry 4bde726bbb * org-compat.el (org-check-version): Autoload. 2012-08-26 20:04:41 +02:00
Achim Gratz bf352eceda Rename utils/ to mk/, move some files to mk/ and make the requisite changes throughout
* Makefile: Include default.mk and targets.mk from mk/ where they've
  been moved to.

* README_maintainer: Rename utils to make throughout.

* doc/Makefile: Rename utils to make throughout.

* doc/org.texi: Remove reference to utils/, x11idle.c is now in
  contrib/scripts.

* mk/make_emacs_changelog: Add mk/ to list of directories not to be
  reported in Emacs' ChangeLog.  Also retain utils/ and re-add
  UTILITIES; add a comment explaining why these need to stay.

* mk/default.mk: Rename utils to make throughout.  Include version.mk
  from mk/ where it's been moved to.

* mk/targets.mk: Rename utils to make throughout.

* mk/server.mk: Rename utils to make throughout.  Only put those files
  from mk/ into the archives that are needed outside the server:
  default.mk targets.mk version.mk and org-fixup.el.

* lisp/org-compat.el: Rename utils to make throughout.

* .gitignore:  Rename utils to make throughout.
2012-08-26 15:27:19 +02:00
Bastien Guerry 0c8e87b8d2 Rename UTILITIES/ to utils/ 2012-08-23 12:47:10 +02:00
Bastien Guerry cacb08334a Merge branch 'org-no-properties' 2012-08-15 14:43:35 +02:00
Bastien Guerry b62604236d Replace `org-labels' by `let*'
* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Replace
`org-labels' by `let*'.

* org-bibtex.el (org-bibtex-headline): Ditto.

* org-compat.el: Delete `org-labels'.
2012-08-15 09:56:35 +02:00
Bastien Guerry 722e0e0c83 Remove `org-substring-no-properties' and some redundant code
* org-macs.el (org-no-properties): Allow a new parameter
`restricted' to restrict the properties removal to those in
`org-rm-props'.  The default is now to remove all properties.

* org-compat.el (org-substring-no-properties): Remove unused
defun.

* org-remember.el (org-remember-apply-template): Remove
redundant removal of text properties.
(org-remember-apply-template): Use `org-no-properties'.

* org-capture.el (org-capture-fill-template): Remove redundant
removal of text properties.
(org-capture-fill-template): Use `org-no-properties'.

* org-gnus.el (org-gnus-open, org-gnus-follow-link): Use
`org-no-properties'.
2012-08-15 09:35:21 +02:00
Eric Schulte 37e19ea2d0 Revert "Don't use `org-labels'"
This reverts commit 9d4e1517b6.
2012-08-13 08:17:46 -06:00
Eric Schulte 9d4e1517b6 Don't use `org-labels'
Reworking the previous commit which attempted to remove org-labels.

* org-compat.el (org-labels): Remove.

* org-bibtex.el (org-bibtex-headline): Don't use `org-labels'.

* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto.
2012-08-13 07:42:17 -06:00
Bastien Guerry 525e96a97e Revert "Don't use `org-labels'"
This reverts commit ba16c3c6f5.
2012-08-13 06:37:57 +02:00
Bastien Guerry 70dd1196d2 Massive code clean-up.
Delete trailing whitespaces.
Indent all sexps correctly.
Sentences end with double spaces.
2012-08-11 19:10:44 +02:00
Bastien Guerry ba16c3c6f5 Don't use `org-labels'
* org-compat.el (org-labels): Remove.

* org-bibtex.el (org-bibtex-headline): Don't use `org-labels'.

* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto.
2012-08-11 10:43:56 +02:00
Bastien Guerry baaa4873c7 org-compat.el (org-flet): Remove alias
* org-compat.el (org-flet): Remove alias.
2012-08-10 17:45:16 +02:00
Eric Schulte 63b5f8f2e8 replace flet/labels with org-flet/org-labels
This patch ensure Org-mode will build on all supported versions of
Emacs, after the renaming of the cl macros behind the cl- prefix in the
recent Emacs trunk.

* lisp/org-compat.el (org-flet): Compatibility function now that flet
  has been removed from cl-macs.
  (org-labels): Compatibility function now that labels has been removed
  from cl-macs.
* lisp/ob-R.el (org-compat): Require org-compat.
* lisp/ob-comint.el: Require org-compat.
* lisp/ob-exp.el (org-babel-exp-do-export): Switch to compatibility
  function.
* lisp/ob-gnuplot.el (org-babel-expand-body:gnuplot): Switch to
  compatibility function.
* lisp/ob-lob.el (org-babel-lob-get-info): Switch to compatibility
  function.
  (org-babel-lob-execute): Switch to compatibility function.
* lisp/ob-python.el (org-babel-python-evaluate-session): Switch to
  compatibility function.
* lisp/ob-ref.el (org-babel-ref-index-list): Switch to compatibility
  function.
* lisp/ob-sh.el (org-babel-sh-var-to-string): Switch to compatibility
  function.
* lisp/ob-tangle.el (org-babel-load-file): Switch to compatibility
  function.
  (org-babel-tangle): Switch to compatibility function.
  (org-babel-spec-to-string): Switch to compatibility function.
* lisp/ob.el (org-babel-view-src-block-info): Switch to compatibility
  function.
  (org-babel-execute-src-block): Switch to compatibility function.
  (org-babel-edit-distance): Switch to compatibility function.
  (org-babel-switch-to-session-with-code): Switch to compatibility
  function.
  (org-babel-sha1-hash): Switch to compatibility function.
  (org-babel-balanced-split): Switch to compatibility function.
  (org-babel-join-splits-near-ch): Switch to compatibility function.
  (org-babel-get-rownames): Switch to compatibility function.
  (org-babel-format-result): Switch to compatibility function.
  (org-babel-insert-result): Switch to compatibility function.
  (org-babel-examplize-region): Switch to compatibility function.
  (org-babel-merge-params): Switch to compatibility function.
  (org-babel-noweb-p): Switch to compatibility function.
  (org-babel-expand-noweb-references): Switch to compatibility function.
* lisp/org-bibtex.el (org-bibtex-headline): Switch to compatibility
  function.
  (org-bibtex-fleshout): Switch to compatibility function.
  (org-bibtex-read): Switch to compatibility function.
  (org-bibtex-write): Switch to compatibility function.
* lisp/org-exp-blocks.el (org-export-blocks-preprocess): Switch to
  compatibility function.
* lisp/org-exp.el (org-export-format-source-code-or-example): Switch to
  compatibility function.
* lisp/org-macs.el (org-called-interactively-p): Indentation fix.
* lisp/org-mouse.el (org-mouse-timestamp-today): Switch to compatibility
  function.
  (org-mouse-set-priority): Switch to compatibility function.
  (org-mouse-popup-global-menu): Switch to compatibility function.
  (org-mouse-context-menu): Switch to compatibility function.
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data): Switch to
  compatibility function.
  (org-plot/gnuplot-script): Switch to compatibility function.
* lisp/org.el (org-entry-get): Switch to compatibility function.
  (org-fill-paragraph): Switch to compatibility function.
  (org-auto-fill-function): Switch to compatibility function.
2012-07-25 09:23:57 -06:00
Jambunathan K f4148cf525 Merge origin/maint 2012-07-19 19:29:24 +05:30
Jambunathan K 16d23c07dd org-compat.el: Augment earlier commit
* lisp/org-compat.el (org-condition-case-unless-debug): Alias
to `condition-case' when both `condition-case-no-debug' and
`condition-case-unless-debug' is unavailable.
2012-07-19 19:15:42 +05:30
Bastien Guerry 7cc0eda245 New alias `org-condition-case-unless-debug'.
* org-odt.el (org-odt-cleanup-xml-buffers): Use the new alias.

* org-compat.el: Alias `org-condition-case-unless-debug' to
`condition-case-unless-debug' or `condition-case-no-debug'.
2012-07-19 19:00:12 +05:30
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
Bastien Guerry 1fe42fd0bc New alias `org-condition-case-unless-debug'.
* org-odt.el (org-odt-cleanup-xml-buffers): Use the new alias.

* org-compat.el: Alias `org-condition-case-unless-debug' to
`condition-case-unless-debug' or `condition-case-no-debug'.
2012-07-12 10:30:33 +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
Bastien Guerry b3f60f791e Convert compatibility defun to a macro.
* lisp/org-compat.el (org-find-library-name): Convert into a macro to
  avoid compilation of a function from XEmacs in Emacs and vice versa.

Based on a not fully working proposal by A. Gratz to the orgmode
mailing list:
http://lists.gnu.org/archive/html/emacs-orgmode/2012-04/msg00009.html
2012-05-01 10:40:15 +02:00
Bastien Guerry 69d2d4e130 org-compat.el: Silent the byte-compiler about a warning related to XEmacs support.
* org-compat.el (org-find-library-name): Silent the
byte-compiler about a warning related to XEmacs support.
2012-04-28 19:16:59 +02:00
Bastien Guerry 5c38bf0ef7 Fix copyright and authors lines. 2012-04-02 00:53:28 +02:00
Bastien Guerry 6e306f65ff Fix copyright years in maint. 2012-03-17 16:31:04 +01:00
Bastien Guerry de42649f7b Manually revert maint to e85080.
e85080 is the last correct commit in the maint branch
before releasing 7.8.04.  The 7.8.05 release should be
done from this commit.
2012-03-17 16:28:46 +01:00
Bastien Guerry 38c5045725 Fix copyright years. 2012-03-17 14:36:25 +01:00
Bastien Guerry 6e534f9c61 Manually revert back to commit e85080.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.

This commit reverts back the maint branch to its state before
merging the master branch.  From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
2012-03-17 14:34:01 +01:00
Bastien Guerry fadca5e8eb Fix typos and spelling mistakes.
Thanks to Paul Eggert for this fixes in Emacs trunk.
2012-01-10 11:56:15 +01:00
Bastien Guerry e44d2975ff Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
Carsten Dominik 54a9cb0d99 Maintain XEmacs compatibility
* lisp/ob-calc.el (featurep): Require calc-store.
* lisp/org-agenda.el (org-agenda-list-stuck-projects): Fix regexp
special handling.
* lisp/org-compat.el (fboundp): Support for XEmacs.
* lisp/org-exp.el (org-export): Protect XEmacs from `(redisplay)' call.
* lisp/org-footnote.el (org-footnote-re): Optimize macro processing.
* lisp/org.el (org-set-autofill-regexps): Xemacs compatibility.

Patch by Michael Sperber, checked and slightly modified by Carsten.
2011-10-21 22:36:53 +02:00
Martin Rudalics 4a8634e1a5 org-compat.el: Remove LABEL argument from pop-to-buffer-same-window call.
* org-compat.el (org-pop-to-buffer-same-window): Remove LABEL
argument from pop-to-buffer-same-window call.
2011-09-02 18:18:56 +02:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00