From e0ca9a5bdf0dc61e3c117891b3b6b3f8dc6bc4fd Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 21 Apr 2010 09:03:30 +0200 Subject: [PATCH] More work on simplifying compatibility code --- lisp/ChangeLog | 8 ++++++++ lisp/org-agenda.el | 5 ++--- lisp/org-clock.el | 11 +++++------ lisp/org-colview.el | 3 +++ lisp/org.el | 6 ++---- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 57ddae3eb..31d7f6432 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2010-04-21 Carsten Dominik + * org-colview-xemacs.el: Make sure this file is never loaded into + Emacs. Remove all tests for XEmacs. + + * org-colview.el: Make sure this file is never loaded into XEmacs. + + * org-agenda.el (org-highlight, org-unhighlight): Use direct + overlay calls. + * org.el (org-key): Apply the translations defined in `org-xemacs-key-equivalents'. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 9dd7d19db..c68038da3 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5878,12 +5878,11 @@ so that the date SD will be in that range." (defun org-highlight (begin end &optional buffer) "Highlight a region with overlay." - (funcall (if (featurep 'xemacs) 'set-extent-endpoints 'move-overlay) - org-hl begin end (or buffer (current-buffer)))) + (move-overlay org-hl begin end (or buffer (current-buffer)))) (defun org-unhighlight () "Detach overlay INDEX." - (funcall (if (featurep 'xemacs) 'detach-extent 'delete-overlay) org-hl)) + (org-detach-overlay org-hl)) ;; FIXME this is currently not used. (defun org-highlight-until-next-command (beg end &optional buffer) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b971a75a7..d1805e66d 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -759,11 +759,10 @@ was started." (goto-char (match-end 0))) nil)))))) (let (char-pressed) - (if (featurep 'xemacs) - (progn - (message (concat (funcall prompt-fn clock) - " [(kK)eep (sS)ubtract (C)ancel]? ")) - (setq char-pressed (read-char-exclusive))) + (when (featurep 'xemacs) + (message (concat (funcall prompt-fn clock) + " [(kK)eep (sS)ubtract (C)ancel]? ")) + (setq char-pressed (read-char-exclusive))) (while (or (null char-pressed) (and (not (memq char-pressed '(?k ?K ?s ?S ?C ?i))) (or (ding) t))) @@ -771,7 +770,7 @@ was started." (read-char (concat (funcall prompt-fn clock) " [(kK)p (sS)ub (C)ncl (i)gn]? ") nil 45))) - (and (not (eq char-pressed ?i)) char-pressed)))))) + (and (not (eq char-pressed ?i)) char-pressed))))) (default (floor (/ (org-float-time (time-subtract (current-time) last-valid)) 60))) (keep (and (memq ch '(?k ?K)) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 6cb701005..f80c91221 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -36,6 +36,9 @@ (declare-function org-agenda-redo "org-agenda" ()) (declare-function org-agenda-do-context-action "org-agenda" ()) +(when (featurep 'xemacs) + (error "Do not load this file into XEmacs, use 'org-colview-xemacs.el'.")) + ;;; Column View (defvar org-columns-overlays nil diff --git a/lisp/org.el b/lisp/org.el index eb16a4d25..0eaf326c2 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4356,7 +4356,7 @@ The following commands are available: ;; we switch another buffer into org-mode. (if (featurep 'xemacs) (when (boundp 'outline-mode-menu-heading) - ;; Assume this is Greg's port, it used easymenu + ;; Assume this is Greg's port, it uses easymenu (easy-menu-remove outline-mode-menu-heading) (easy-menu-remove outline-mode-menu-show) (easy-menu-remove outline-mode-menu-hide)) @@ -16999,9 +16999,7 @@ With prefix arg UNCOMPILED, load the uncompiled versions." "Display the given MESSAGE as a warning." (if (fboundp 'display-warning) (display-warning 'org message - (if (featurep 'xemacs) - 'warning - :warning)) + (if (featurep 'xemacs) 'warning :warning)) (let ((buf (get-buffer-create "*Org warnings*"))) (with-current-buffer buf (goto-char (point-max)) -- 2.11.4.GIT