Created
January 30, 2010 06:39
-
-
Save kosh04/290458 to your computer and use it in GitHub Desktop.
xyzzy lispの基本的な色付け
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#| | |
;; lispkwd.l | |
;; ■参考リンク | |
;; Lisp でキーワードの色付け (キーワードファイルは ~/etc/lisp) | |
;; http://hie.s64.xrea.com/xyzzy/note/major_mode.html#lisp-mode | |
;; xyzzy Lisp のシンボルテーブルは大文字小文字を区別するが | |
;; Common Lisp はデフォルトでは setq/SETQ のように大文字小文字を区別しない. | |
;; LISP マシンなどの古いソースコードは全て大文字で書かれている場合があるので | |
;; どちらも色付けするならキーワードファイルの扱いは ignore-case の方がお得. | |
;; こんなやり方もある | |
;; http://lispuser.net/emacs/lisphacking.html#xyzzy-common-lisp | |
(add-hook '*lisp-mode-hook* | |
#'(lambda () | |
(make-local-variable 'keyword-hash-table) | |
(setf keyword-hash-table (load-keyword-file "Lisp" t)) | |
(make-local-variable 'regexp-keyword-list) | |
(setf regexp-keyword-list | |
(compile-regexp-keyword-list | |
'(("(" t (:color 14)) | |
(")" t (:color 14))))))) | |
|# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; -*- Mode: Lisp; Package: EDITOR; Encoding: Shift_JIS -*- | |
;;; | |
;;; This file is NOT part of xyzzy. | |
;;; | |
(provide "lispkwd") | |
(in-package "editor") | |
(defvar *lisp-keyword-hash-table* nil) | |
(defvar *lisp-keyword-file* "Lisp") | |
(defun use-lisp-keyword () | |
"Enable LISP keyword highlighting." | |
(and *lisp-keyword-file* | |
(null *lisp-keyword-hash-table*) | |
(setq *lisp-keyword-hash-table* | |
;; NOTE: Common Lisp symbols are Case-insensitive | |
(load-keyword-file *lisp-keyword-file* t))) | |
(when *lisp-keyword-hash-table* | |
(make-local-variable 'keyword-hash-table) | |
(setq keyword-hash-table *lisp-keyword-hash-table*))) | |
(add-hook '*lisp-mode-hook* 'use-lisp-keyword) | |
(add-hook '*lisp-interaction-mode-hook* 'use-lisp-keyword) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment