summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2011-10-21 22:36:53 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2011-10-21 22:36:53 +0200
commit54a9cb0d99872d5bcd06db51abf72df67df66f7a (patch)
treec9db7a15b0c4ec8e2033d07733f86ec339b5ea7d
parenta1ebd4e2071da5edf3ba728acf908c98392ea29f (diff)
downloadorg-mode-54a9cb0d99872d5bcd06db51abf72df67df66f7a.tar.gz
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.
-rw-r--r--lisp/ob-calc.el4
-rw-r--r--lisp/org-agenda.el4
-rw-r--r--lisp/org-compat.el8
-rw-r--r--lisp/org-exp.el2
-rw-r--r--lisp/org-footnote.el14
-rw-r--r--lisp/org.el9
6 files changed, 24 insertions, 17 deletions
diff --git a/lisp/ob-calc.el b/lisp/ob-calc.el
index 45d9441..14d7d5d 100644
--- a/lisp/ob-calc.el
+++ b/lisp/ob-calc.el
@@ -29,7 +29,9 @@
(require 'ob)
(require 'calc)
(require 'calc-store)
-(unless (featurep 'xemacs) (require 'calc-trail))
+(unless (featurep 'xemacs)
+ (require 'calc-trail)
+ (require 'calc-store))
(eval-when-compile (require 'ob-comint))
(defvar org-babel-default-header-args:calc nil
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index cbe36af..476a4f0 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4316,8 +4316,8 @@ of what a project is and how to check if it stuck, customize the variable
"\\)\\>"))
(tags (nth 2 org-stuck-projects))
(tags-re (if (member "*" tags)
- (org-re (concat org-outline-regexp-bol
- ".*:[[:alnum:]_@#%]+:[ \t]*$"))
+ (concat org-outline-regexp-bol
+ (org-ref ".*:[[:alnum:]_@#%]+:[ \t]*$"))
(if tags
(concat org-outline-regexp-bol
".*:\\("
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 3577db6..c053758 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -251,8 +251,12 @@ Works on both Emacs and XEmacs."
(defun org-activate-mark ()
(when (mark t)
(setq mark-active t)
- (unless transient-mark-mode
- (setq transient-mark-mode 'lambda)))))
+ (when (and (boundp 'transient-mark-mode)
+ (not transient-mark-mode))
+ (setq transient-mark-mode 'lambda))
+ (when (boundp 'zmacs-regions)
+ (setq zmacs-regions t)))))
+
;; Invisibility compatibility
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index e03c141..9d63f99 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1029,7 +1029,7 @@ Pressing `1' will switch between these two options."
(setq r1 (read-char-exclusive)))
(error "No enclosing node with LaTeX_CLASS or EXPORT_TITLE or EXPORT_FILE_NAME")
)))))
- (redisplay)
+ (if (fboundp 'redisplay) (redisplay)) ;; XEmacs does not have/need (redisplay)
(and bpos (goto-char bpos))
(setq r2 (if (< r1 27) (+ r1 96) r1))
(unless (setq ass (assq r2 cmds))
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 76e7af3..d002271 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -71,13 +71,13 @@
;; their definition.
;;
;; `org-re' is used for regexp compatibility with XEmacs.
- (org-re (concat "\\[\\(?:"
- ;; Match inline footnotes.
- "fn:\\([-_[:word:]]+\\)?:\\|"
- ;; Match other footnotes.
- "\\(?:\\([0-9]+\\)\\]\\)\\|"
- "\\(fn:[-_[:word:]]+\\)"
- "\\)"))
+ (concat "\\[\\(?:"
+ ;; Match inline footnotes.
+ (org-re "fn:\\([-_[:word:]]+\\)?:\\|")
+ ;; Match other footnotes.
+ "\\(?:\\([0-9]+\\)\\]\\)\\|"
+ (org-re "\\(fn:[-_[:word:]]+\\)")
+ "\\)")
"Regular expression for matching footnotes.")
(defconst org-footnote-definition-re
diff --git a/lisp/org.el b/lisp/org.el
index 8ea691c..32264ed 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19843,10 +19843,11 @@ the functionality can be provided as a fall-back.")
;; through to `fill-paragraph' when appropriate.
(org-set-local 'fill-paragraph-function 'org-fill-paragraph)
;; Prevent auto-fill from inserting unwanted new items.
- (org-set-local 'fill-nobreak-predicate
- (if (memq 'org-fill-item-nobreak-p fill-nobreak-predicate)
- fill-nobreak-predicate
- (cons 'org-fill-item-nobreak-p fill-nobreak-predicate)))
+ (if (boundp 'fill-nobreak-predicate)
+ (org-set-local 'fill-nobreak-predicate
+ (if (memq 'org-fill-item-nobreak-p fill-nobreak-predicate)
+ fill-nobreak-predicate
+ (cons 'org-fill-item-nobreak-p fill-nobreak-predicate))))
;; Adaptive filling: To get full control, first make sure that
;; `adaptive-fill-regexp' never matches. Then install our own matcher.
(unless (local-variable-p 'adaptive-fill-regexp (current-buffer))