summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2013-06-01 11:21:48 +0200
committerAchim Gratz <Stromeko@Stromeko.DE>2013-06-01 11:31:07 +0200
commitd36a933c6594b8aa010ba20de6608777d11b8b3c (patch)
tree8eacab6be2ca351329ca0cd79c88737499591599
parent0e42f1aae14cb17d52aea3702356514cae086698 (diff)
downloadorg-mode-d36a933c6594b8aa010ba20de6608777d11b8b3c.tar.gz
Compatibility: fix XEmacs compilation failures
* lisp/ob-eval.el, lisp/ob.el, lisp/org-macro.el, lisp/org-mhe.el: Require org-macs and org-compat as necessary. * lisp/ob-tangle.el: Declare function `org-store-link' and `org-open-link-from-string'. * lisp/org-compat.el: Extend eval-and-compile clause and add advices for functions that have different parameter lists in XEmacs. Add variable definitions that XEmacs lacks . * lisp/org-macs.el (declare-function): Define macro to use autoload instead for XEmacs. * lisp/ox-html.el, lisp/ox-odt.el: XEmacs does not have table.el, so use 'noerror on the require form. * lisp/ox-texinfo.el (org-texinfo-table-column-widths): Fix spliced argument list that XEmacs complains about by adding parenthesis. This fixes all compilation failures on XEmacs and warnings related to Org that indicate that XEmacs has compiled things wrongly (for instance it might have interpreted a function as a variable symbol). There are still many warnings that probably indicate serious problems.
-rw-r--r--lisp/ob-eval.el1
-rw-r--r--lisp/ob-tangle.el2
-rw-r--r--lisp/ob.el2
-rw-r--r--lisp/org-compat.el35
-rw-r--r--lisp/org-macro.el2
-rw-r--r--lisp/org-macs.el4
-rw-r--r--lisp/org-mhe.el1
-rw-r--r--lisp/ox-html.el2
-rw-r--r--lisp/ox-odt.el2
-rw-r--r--lisp/ox-texinfo.el2
10 files changed, 43 insertions, 10 deletions
diff --git a/lisp/ob-eval.el b/lisp/ob-eval.el
index 681362f..85a8c4e 100644
--- a/lisp/ob-eval.el
+++ b/lisp/ob-eval.el
@@ -27,6 +27,7 @@
;; shell commands.
;;; Code:
+(require 'org-macs)
(eval-when-compile (require 'cl))
(defvar org-babel-error-buffer-name "*Org-Babel Error Output*")
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 0c151ba..1753255 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -32,6 +32,8 @@
(declare-function org-edit-special "org" (&optional arg))
(declare-function org-link-escape "org" (text &optional table))
+(declare-function org-store-link "org" (arg))
+(declare-function org-open-link-from-string "org" (s &optional arg reference-buffer))
(declare-function org-heading-components "org" ())
(declare-function org-back-to-heading "org" (invisible-ok))
(declare-function org-fill-template "org" (template alist))
diff --git a/lisp/ob.el b/lisp/ob.el
index 6cacac7..827dd04 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -22,6 +22,8 @@
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
+(require 'org-macs)
+(require 'org-compat)
(require 'ob-eval)
(require 'ob-core)
(require 'ob-comint)
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index bd81f68..4b14231 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -113,18 +113,41 @@ any other entries, and any resulting duplicates will be removed entirely."
;;;; Emacs/XEmacs compatibility
-(defun org-defvaralias (new-alias base-variable &optional docstring)
- "Compatibility function for defvaralias.
+(eval-and-compile
+ (defun org-defvaralias (new-alias base-variable &optional docstring)
+ "Compatibility function for defvaralias.
Don't do the aliasing when `defvaralias' is not bound."
- (declare (indent 1))
- (when (fboundp 'defvaralias)
- (defvaralias new-alias base-variable docstring)))
+ (declare (indent 1))
+ (when (fboundp 'defvaralias)
+ (defvaralias new-alias base-variable docstring)))
-(eval-and-compile
(when (and (not (boundp 'user-emacs-directory))
(boundp 'user-init-directory))
(org-defvaralias 'user-emacs-directory 'user-init-directory)))
+ (when (featurep 'xemacs)
+ (defadvice custom-handle-keyword
+ (around org-custom-handle-keyword (symbol keyword value type)
+ activate preactivate)
+ "Remove custom keywords not recognized to avoid producing an error."
+ (cond
+ ((eq keyword :package-version))
+ (t ad-do-it)))
+ (defadvice define-obsolete-variable-alias
+ (around org-define-obsolete-variable-alias
+ (obsolete-name current-name &optional docstring)
+ activate preactivate)
+ "Declare arguments defined in later versions of Emacs."
+ ad-do-it)
+ (defadvice define-obsolete-function-alias
+ (around org-define-obsolete-function-alias
+ (obsolete-name current-name when &optional docstring)
+ activate preactivate)
+ "Declare arguments defined in later versions of Emacs."
+ ad-do-it)
+ (defvar customize-package-emacs-version-alist nil)
+ (defvar temporary-file-directory (temp-directory)))
+
;; Keys
(defconst org-xemacs-key-equivalents
'(([mouse-1] . [button1])
diff --git a/lisp/org-macro.el b/lisp/org-macro.el
index 153b3b1..fa74d83 100644
--- a/lisp/org-macro.el
+++ b/lisp/org-macro.el
@@ -37,12 +37,14 @@
;; {{{email}}} and {{{title}}} macros.
;;; Code:
+(require 'org-macs)
(declare-function org-element-at-point "org-element" (&optional keep-trail))
(declare-function org-element-context "org-element" (&optional element))
(declare-function org-element-property "org-element" (property element))
(declare-function org-element-type "org-element" (element))
(declare-function org-remove-double-quotes "org" (s))
+(declare-function org-mode "org" ())
(declare-function org-file-contents "org" (file &optional noerror))
(declare-function org-with-wide-buffer "org-macs" (&rest body))
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index cc837d0..0083d29 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -33,7 +33,9 @@
(eval-and-compile
(unless (fboundp 'declare-function)
- (defmacro declare-function (fn file &optional arglist fileonly)))
+ (defmacro declare-function (fn file &optional arglist fileonly)
+ `(autoload ',fn ,file)))
+
(if (>= emacs-major-version 23)
(defsubst org-char-to-string(c)
"Defsubst to decode UTF-8 character values in emacs 23 and beyond."
diff --git a/lisp/org-mhe.el b/lisp/org-mhe.el
index 48767b7..7d6e4ec 100644
--- a/lisp/org-mhe.el
+++ b/lisp/org-mhe.el
@@ -30,6 +30,7 @@
;;; Code:
+(require 'org-macs)
(require 'org)
;; Customization variables
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 949c3ba..facd84c 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -37,7 +37,7 @@
(require 'ox)
(require 'ox-publish)
(require 'format-spec)
-(eval-when-compile (require 'cl) (require 'table))
+(eval-when-compile (require 'cl) (require 'table nil 'noerror))
;;; Function Declarations
diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 28ca6cf..d33c1c3 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -27,7 +27,7 @@
(eval-when-compile
(require 'cl)
- (require 'table))
+ (require 'table nil 'noerror))
(require 'format-spec)
(require 'ox)
(require 'org-compat)
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 289ee46..ec542e6 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -1550,7 +1550,7 @@ a communication channel."
(nth count item))) counts)
(mapconcat (lambda (size)
(make-string size ?a)) (mapcar (lambda (ref)
- (apply 'max `,@ref)) (car counts))
+ (apply 'max `(,@ref))) (car counts))
"} {")))
(defun org-texinfo-table--org-table (table contents info)