From c41409c530e714ee13bdd119c3f955e2ffbda67f Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 17 Oct 2010 18:35:02 +0200 Subject: [PATCH] Enhance XEmacs compatibility * lisp/org-list.el (org-list-search-unenclosed-generic): Replace call to booleanp. * lisp/org-compat.el (org-decompose-region): New defsubst. * lisp/org.el (org-toggle-pretty-entities): (org-unfontify-region): Use `org-decompose-region'. --- lisp/org-compat.el | 9 +++++++++ lisp/org-list.el | 2 +- lisp/org.el | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 4383bec67..298ce476a 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -162,6 +162,15 @@ If DELETE is non-nil, delete all those overlays." (let ((x (org-get-x-clipboard-compat value))) (if x (org-no-properties x))))) +(defsubst org-decompose-region (beg end) + "Decompose from BEG to END." + (if (featurep 'xemacs) + (let ((modified-p (buffer-modified-p)) + (buffer-read-only nil)) + (remove-text-properties beg end '(composition nil)) + (set-buffer-modified-p modified-p)) + (decompose-region beg end))) + ;; Miscellaneous functions (defun org-add-hook (hook function &optional append local) diff --git a/lisp/org-list.el b/lisp/org-list.el index baa89af42..737cfb128 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -343,7 +343,7 @@ Arguments SEARCH, RE, BOUND and NOERR are similar to those in (while t ;; 1. No match: return to origin or bound, depending on NOERR. (unless (funcall search re bound noerr) - (throw 'exit (and (goto-char (if (booleanp noerr) origin bound)) + (throw 'exit (and (goto-char (if (memq noerr '(t nil)) origin bound)) nil))) ;; 2. Match not in block or protected: return point. Else ;; skip the block and carry on. diff --git a/lisp/org.el b/lisp/org.el index 17bce2532..6ea9d259f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5543,7 +5543,7 @@ needs to be inserted at a specific position in the font-lock sequence.") (message "Entities are displayed as UTF8 characers") (save-restriction (widen) - (decompose-region (point-min) (point-max)) + (org-decompose-region (point-min) (point-max)) (message "Entities are displayed plain")))) (defun org-fontify-entities (limit) @@ -5643,7 +5643,7 @@ If KWD is a number, get the corresponding match group." (inhibit-read-only t) (inhibit-point-motion-hooks t) (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename) - (decompose-region beg end) + (org-decompose-region beg end) (remove-text-properties beg end (if org-indent-mode