Skip to content

Commit

Permalink
(subst-char-in-string, make-temp-file): Add fallback definitions for …
Browse files Browse the repository at this point in the history
…XEmacs.

Ignore-this: 278567bec9e094a6619e584b7712ce01

darcs-hash:20080228231110-c2f2e-9564658f22ed392c5a7432f7e5f6eccba564c0bf.gz
  • Loading branch information
monnier committed Feb 28, 2008
1 parent 6787449 commit ea4986a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2008-02-28 Stefan Monnier <monnier@iro.umontreal.ca>

* inf-haskell.el (subst-char-in-string, make-temp-file):
Add fallback definitions for XEmacs-21.4.

2008-02-28 Greg Steuck <greg@nest.cx> (tiny change)

* inf-haskell.el (inferior-haskell-find-haddock): Jump to the symbol
Expand Down
20 changes: 20 additions & 0 deletions inf-haskell.el
Expand Up @@ -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
Expand Down

0 comments on commit ea4986a

Please sign in to comment.