diff --git a/lisp/org-compat.el b/lisp/org-compat.el index bfd4f8eb2..573b9ff71 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -89,6 +89,30 @@ any other entries, and any resulting duplicates will be removed entirely." (t specs))) (put 'org-compatible-face 'lisp-indent-function 1) +(defun org-version-check (version feature level) + (let* ((v1 (mapcar 'string-to-number (split-string version "[.]"))) + (v2 (mapcar 'string-to-number (split-string emacs-version "[.]"))) + (rmaj (or (nth 0 v1) 99)) + (rmin (or (nth 1 v1) 99)) + (rbld (or (nth 2 v1) 99)) + (maj (or (nth 0 v2) 0)) + (min (or (nth 1 v2) 0)) + (bld (or (nth 2 v2) 0))) + (if (or (< maj rmaj) + (and (= maj rmaj) + (< min rmin)) + (and (= maj rmaj) + (= min rmin) + (< bld rbld))) + (if (eq level :predicate) + ;; just return if we have the version + nil + (let ((msg (format "Emacs %s or greater is recommended for %s" + version feature))) + (display-warning 'org msg level) + t)) + t))) + ;;;; Emacs/XEmacs compatibility ;; Keys diff --git a/lisp/org-indent.el b/lisp/org-indent.el index 70618cb93..48b10b74c 100644 --- a/lisp/org-indent.el +++ b/lisp/org-indent.el @@ -130,10 +130,11 @@ FIXME: How to update when broken?" (cond ((org-bound-and-true-p org-inhibit-startup) (setq org-indent-mode nil)) + ((and org-indent-mode (featurep 'xemacs)) + (message "org-indent-mode does not work in XEmacs - refused to turn it on") + (setq org-indent-mode nil)) ((and org-indent-mode - (or (< emacs-major-version 23) - (and (= emacs-major-version 23) - (< emacs-minor-version 2)))) + (not (org-version-check "23.1.50" "Org Indent mode" :predicate))) (message "org-indent-mode is can crash Emacs 23.1 - refused to turn it on!") (ding) (sit-for 1)