diff --git a/ChangeLog b/ChangeLog index d633f770c..ca4af7a9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-28 Stefan Monnier + + * inf-haskell.el (subst-char-in-string, make-temp-file): + Add fallback definitions for XEmacs-21.4. + 2008-02-28 Greg Steuck (tiny change) * inf-haskell.el (inferior-haskell-find-haddock): Jump to the symbol diff --git a/inf-haskell.el b/inf-haskell.el index 4f90166b3..4091165a0 100644 --- a/inf-haskell.el +++ b/inf-haskell.el @@ -38,6 +38,26 @@ (require 'haskell-mode) (eval-when-compile (require 'cl)) +;; XEmacs compatibility. + +(unless (fboundp 'subst-char-in-string) + (defun subst-char-in-string (fromchar tochar string &optional inplace) + ;; This is Haskell-mode, we don't want no stinkin' `aset'. + (apply 'string (mapcar (lambda (c) (if (eq c fromchar) tochar c)) string)))) + +(unless (fboundp 'make-temp-file) + (defun make-temp-file (prefix &optional dir-flag) + (catch 'done + (while t + (let ((f (make-temp-name (expand-file-name prefix (temp-directory))))) + (condition-case () + (progn + (if dir-flag (make-directory f) + (write-region "" nil f nil 'silent nil)) + (throw 'done f)) + (file-already-exists t))))))) + + ;; Here I depart from the inferior-haskell- prefix. ;; Not sure if it's a good idea. (defcustom haskell-program-name