[MLton-commit] r6788

Vesa Karvonen vesak at mlton.org
Thu Aug 21 13:39:45 PDT 2008


Fixed to also work with XEmacs 21.4 although the dynamic mode-line
indicator is currently not supported.

----------------------------------------------------------------------

U   mlton/trunk/ide/emacs/bg-build-mode.el

----------------------------------------------------------------------

Modified: mlton/trunk/ide/emacs/bg-build-mode.el
===================================================================
--- mlton/trunk/ide/emacs/bg-build-mode.el	2008-08-21 19:42:04 UTC (rev 6787)
+++ mlton/trunk/ide/emacs/bg-build-mode.el	2008-08-21 20:39:41 UTC (rev 6788)
@@ -5,6 +5,8 @@
 
 (require 'compile)
 (require 'bg-build-util)
+(if (string-match "XEmacs" emacs-version)
+    (require 'overlay))
 
 ;; This is a minor mode for ``handsfree'' background batch building.  See
 ;; http://mlton.org/EmacsBgBuildMode for further information.
@@ -14,6 +16,7 @@
 ;;      - E.g. grep for saved files from given file
 ;; XXX: Locate project file(s) automatically
 ;; XXX: Context menu to the mode line indicator
+;; XXX: `mode-line-format' (XEmacs 21.4) support
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Prelude
@@ -379,7 +382,8 @@
                   bg-build-finished-builds)
             (bg-build-parse-messages)
             (set (make-local-variable 'bg-build-messages)
-                 (or (and (hash-table-p compilation-locs)
+                 (or (and (boundp 'compilation-locs)
+                          (hash-table-p compilation-locs)
                           (let ((entries nil))
                             (maphash
                              (function
@@ -586,7 +590,6 @@
 
 (defvar bg-build-status ""
   "Mode line status indicator for BGB mode")
-(add-to-list 'mode-line-modes '(t bg-build-status))
 
 (defun bg-build-status-update ()
   (let ((buffer (get-buffer bg-build-status-buffer-name)))
@@ -729,10 +732,15 @@
   :global t
   (remove-hook
    'after-save-hook (function bg-build-after-save-hook))
+  (when (boundp 'mode-line-modes)
+    (setq mode-line-modes
+          (remove '(t bg-build-status) mode-line-modes)))
   (when (bg-build-mode-enabled-in-some-buffer)
     (add-hook
      'after-save-hook
-     (function bg-build-after-save-hook))))
+     (function bg-build-after-save-hook))
+    (when (boundp 'mode-line-modes)
+      (add-to-list 'mode-line-modes '(t bg-build-status)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Finalization




More information about the MLton-commit mailing list