Emacs在Windows上的漂亮希腊问题

时间:2009-11-27 18:00:13

标签: emacs

我想让 http://www.emacswiki.org/emacs/PrettyGreek在Windows上为emacs 21.3.1工作。从 http://ftp.gnu.org/gnu/intlfonts/下载欧洲字体后,我在我的.emacs中添加了以下内容:

; ======= Pretty Greek Characters =======

(setq bdf-directory-list '("D:/emacs/intlfonts/European"))

(setq w32-bdf-filename-alist (w32-find-bdf-fonts bdf-directory-list))

(create-fontset-from-fontset-spec 
 "-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf,
greek-iso8859-7:-*-*-medium-r-normal-*-16-*-*-*-c-*-iso8859-7" t)

(defun pretty-greek ()
  (let ((greek '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta" "theta" "iota" "kappa" "lambda" "mu" "nu" "xi" "omicron" "pi" "rho" "sigma_final" "sigma" "tau" "upsilon" "phi" "chi" "psi" "omega")))
    (loop for word in greek
          for code = 225 then (+ 1 code)
          do  (let ((greek-char (make-char 'greek-iso8859-7 code))) 
                (font-lock-add-keywords nil
                                        `((,(concatenate 'string "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[a-zA-Z]")
                                           (0 (progn (decompose-region (match-beginning 2) (match-end 2))
                                                     nil)))))
                (font-lock-add-keywords nil 
                                        `((,(concatenate 'string "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[^a-zA-Z]")
                                           (0 (progn (compose-region (match-beginning 2) (match-end 2)
                                                                     ,greek-char)
                                                     nil)))))))))

(add-hook 'lisp-mode-hook 'pretty-greek)
(add-hook 'emacs-lisp-mode-hook 'pretty-greek)
(add-hook 'python-mode-hook 'pretty-greek)
(add-hook 'csharp-mode-hook 'pretty-greek)

然而,当我尝试alpha beta gamma时,我会得到正/负字符,上标2和上标3.有没有人知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

我从Emacs 21升级到Emacs 23,现在代码工作正常。过渡实际上并不是太痛苦,无论如何我都需要进行过渡。