Talk:Haskell mode for Emacs

From HaskellWiki
Revision as of 22:37, 11 January 2010 by Ilya Sigalov (talk | contribs)
Jump to navigation Jump to search

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)

Thank you for your advice: it worked fully. One thing, however: you should change line 126 to two closing parentheses, not one as you note above. Tamayo 19:30, 27 April 2007 (UTC)

You may also need to erase (or recompile) haskell-font-lock.elc file, which is a byte compiled version of haskell-font-lock.el.

Ilya_Sigalov 02:16, 25 April 2007 (UTC)