Difference between revisions of "Talk:Haskell mode for Emacs"

From HaskellWiki
Jump to navigation Jump to search
(request for help making haskell-mode work in Win XP XEmacs)
 
(Add some hints...)
Line 2: Line 2:
   
 
Do you have any hints on how to correct this problem?
 
Do you have any hints on how to correct this problem?
  +
:That's a bit thorny isn't it? "charsetp" is supposed to be defined in Xemacs21 - it just tells if something is a charset object. However, the only place i see it being used in the Haskell mode code is in <code>haskell-font-lock.el</code>, line 135 in my version. You could just comment out the entire sequence that uses it Lines 135 through 141 and part of line 126. The revised code would like like: (replaces lines 115 to 143)
  +
<pre-lisp>
  +
(defcustom haskell-font-lock-symbols nil
  +
"Display \\ and -> and such using symbols in fonts.
  +
This may sound like a neat trick, but be extra careful: it changes the
  +
alignment and can thus lead to nasty surprises w.r.t layout.
  +
If t, try to use whichever font is available. Otherwise you can
  +
set it to a particular font of your preference among `japanese-jisx0208'
  +
and `unicode'."
  +
:group 'haskell
  +
:type '(choice (const nil)
  +
(const t)
  +
(const unicode)
  +
)
  +
  +
(defconst haskell-font-lock-symbols-alist
  +
(append
  +
;; Prefer single-width Unicode font for lambda.
  +
(and (fboundp 'decode-char)
  +
(memq haskell-font-lock-symbols '(t unicode))
  +
(list (cons "\\" (decode-char 'ucs 955))))
  +
;; The symbols can come from a JIS0208 font.
  +
;; (and (fboundp 'make-char) (charsetp 'japanese-jisx0208)
  +
;; (memq haskell-font-lock-symbols '(t japanese-jisx0208))
  +
;; (list (cons "not" (make-char 'japanese-jisx0208 34 76))
  +
;; (cons "\\" (make-char 'japanese-jisx0208 38 75))
  +
;; (cons "->" (make-char 'japanese-jisx0208 34 42))
  +
;; (cons "<-" (make-char 'japanese-jisx0208 34 43))
  +
;; (cons "=>" (make-char 'japanese-jisx0208 34 77))))
  +
;; Or a unicode font.
  +
(and (fboundp 'decode-char)
  +
</pre-lisp>
  +
:[[User:BrettGiles|BrettGiles]] 02:16, 25 April 2007 (UTC)

Revision as of 02:16, 25 April 2007

I have installed a fresh "sumo" version of XEmacs for Windows XP (version 21.4.19, from the xemacs.org site itself) and have updated its packages, as well. Apparently, the XEmacs people have included the fixes to haskell-indent.el and haskell-font-lock.el you mention here, which is good; but nevertheless when I try to load up haskell-mode, XEmacs bombs with the unhelpful message "Symbol's function definition is void: charsetp".

Do you have any hints on how to correct this problem?

That's a bit thorny isn't it? "charsetp" is supposed to be defined in Xemacs21 - it just tells if something is a charset object. However, the only place i see it being used in the Haskell mode code is in haskell-font-lock.el, line 135 in my version. You could just comment out the entire sequence that uses it Lines 135 through 141 and part of line 126. The revised code would like like: (replaces lines 115 to 143)

<pre-lisp> (defcustom haskell-font-lock-symbols nil

 "Display \\ and -> and such using symbols in fonts.

This may sound like a neat trick, but be extra careful: it changes the alignment and can thus lead to nasty surprises w.r.t layout. If t, try to use whichever font is available. Otherwise you can set it to a particular font of your preference among `japanese-jisx0208' and `unicode'."

 :group 'haskell
 :type '(choice (const nil)

(const t) (const unicode)

         )

(defconst haskell-font-lock-symbols-alist

 (append
  ;; Prefer single-width Unicode font for lambda.
  (and (fboundp 'decode-char)

(memq haskell-font-lock-symbols '(t unicode)) (list (cons "\\" (decode-char 'ucs 955))))

  ;; The symbols can come from a JIS0208 font.
 ;; (and (fboundp 'make-char) (charsetp 'japanese-jisx0208)
(memq haskell-font-lock-symbols '(t japanese-jisx0208))
(list (cons "not" (make-char 'japanese-jisx0208 34 76))
(cons "\\" (make-char 'japanese-jisx0208 38 75))
(cons "->" (make-char 'japanese-jisx0208 34 42))
(cons "<-" (make-char 'japanese-jisx0208 34 43))
(cons "=>" (make-char 'japanese-jisx0208 34 77))))
  ;; Or a unicode font.
  (and (fboundp 'decode-char)

</pre-lisp>

BrettGiles 02:16, 25 April 2007 (UTC)