Pārlūkot izejas kodu

More work on simplifying compatibility code

Carsten Dominik 15 gadi atpakaļ
vecāks
revīzija
e0ca9a5bdf
5 mainītis faili ar 20 papildinājumiem un 13 dzēšanām
  1. 8 0
      lisp/ChangeLog
  2. 2 3
      lisp/org-agenda.el
  3. 5 6
      lisp/org-clock.el
  4. 3 0
      lisp/org-colview.el
  5. 2 4
      lisp/org.el

+ 8 - 0
lisp/ChangeLog

@@ -1,5 +1,13 @@
 2010-04-21  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* 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'.
 

+ 2 - 3
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)

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

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

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