Browse Source

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.
Carsten Dominik 13 years ago
parent
commit
54a9cb0d99
6 changed files with 24 additions and 17 deletions
  1. 3 1
      lisp/ob-calc.el
  2. 2 2
      lisp/org-agenda.el
  3. 6 2
      lisp/org-compat.el
  4. 1 1
      lisp/org-exp.el
  5. 7 7
      lisp/org-footnote.el
  6. 5 4
      lisp/org.el

+ 3 - 1
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

+ 2 - 2
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
 				".*:\\("

+ 6 - 2
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
 

+ 1 - 1
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))

+ 7 - 7
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

+ 5 - 4
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))