Meadow2
Meadow2 Official
(1)インストールはネットワークインストールが楽
(2)環境変数(W2K)
環境変数HOMEが設定されていればそれが優先されるが、インストールするとき、別のHOMEディレクトリを入力するとレジストリ[HKEY-LOCAL-MACHINE]-[SOFTWARE]-[GNU]-[Meadow]-[2.00b1]-[Environment]に格納される。
HOME c:\cygwin\home\xxx(3).emacsをHOMEに作成
このファイルはインストールしたディレクトリの直下にdot.emacsというサンプルがあるので、それを元にすると楽
;;;; -*- mode: lisp-interaction; syntax: elisp; coding: iso-2022-7bit -*-
;;;;
;;;; Copyright (C) 2001 The Meadow Team
;; Author: Koichiro Ohba <koichiro@meadowy.org>
;; Kyotaro HORIGUCHI <horiguti@meadowy.org>
;; Hideyuki SHIRAI <shirai@meadowy.org>
;; KOSEKI Yoshinori <kose@meadowy.org>
;; and The Meadow Team.
;; ;;; Mule-UCS の設定
;; ;; ftp://ftp.m17n.org/pub/mule/Mule-UCS/
;; ;; (set-language-environment) の前に設定します
;; (require 'un-define)
;; (setq bitmap-alterable-charset 'tibetan-1-column)
;; (require 'jisx0213)
;;---------------------------------------------------------
;; 日本語環境設定
;;---------------------------------------------------------
(set-language-environment "Japanese")
;;---------------------------------------------------------
;; 一時マークモードの自動有効化
;;---------------------------------------------------------
(setq-default transient-mark-mode t)
;;---------------------------------------------------------
;; 右端で折り返さない
;;---------------------------------------------------------
(setq truncate-lines t)
(setq truncate-partial-width-windows t)
;;---------------------------------------------------------
;; dired でディレクトリを先頭に表示
;;---------------------------------------------------------
(setq ls-lisp-dirs-first t)
;;---------------------------------------------------------
;; バックアップファイルの作成場所を固定
;;---------------------------------------------------------
(setq make-backup-files t)
(setq backup-directory-alist
(cons (cons "\\.*$" (expand-file-name "~/bak"))
backup-directory-alist))
;;---------------------------------------------------------
;; C-,, C-.でバッファを切り替え
;;---------------------------------------------------------
(defun my-select-visible (blst n)
(let ((buf (nth n blst)))
(cond ((= n (- (length blst) 1)) (other-buffer))
((not (= (aref (buffer-name buf) 0) ? )) buf)
(t (my-select-visible blst (+ n 1))))))
(defun my-grub-buffer ()
(interactive)
(switch-to-buffer (my-select-visible
(reverse (cdr (assq 'buffer-list (frame-parameters)))) 0)))
(global-set-key [?\C-,] 'my-grub-buffer)
(global-set-key [?\C-.] 'bury-buffer)
;;---------------------------------------------------------
;; HOME と END キーでバッファーの先頭/最後へ移動
;;---------------------------------------------------------
(global-set-key [home] 'beginning-of-buffer)
(global-set-key [end] 'end-of-buffer)
;;---------------------------------------------------------
;;navi2chの設定
;;---------------------------------------------------------
(autoload 'navi2ch "navi2ch" "Navigator for 2ch for Emacs" t)
;;---------------------------------------------------------
;; IMEの設定
;;---------------------------------------------------------
(mw32-ime-initialize)
(setq default-input-method "MW32-IME")
(setq-default mw32-ime-mode-line-state-indicator "[--]")
(setq mw32-ime-mode-line-state-indicator-list '("[--]" "[あ]" "[--]"))
(add-hook 'mw32-ime-on-hook
(function (lambda () (set-cursor-height 2))))
(add-hook 'mw32-ime-off-hook
(function (lambda () (set-cursor-height 4))))
;; y/n に答えるときには、IME を自動的にオフにする
(wrap-function-to-control-ime 'y-or-n-p nil nil)
(wrap-function-to-control-ime 'yes-or-no-p nil nil)
;;---------------------------------------------------------
;; カーソルの設定
;;---------------------------------------------------------
;; ;; (set-cursor-type 'box) ; Meadow-1.10互換 (SKK等で色が変る設定)
;; ;; (set-cursor-type 'hairline-caret) ; 縦棒キャレット
;;; マウスカーソルを消す設定
(setq w32-hide-mouse-on-key t)
(setq w32-hide-mouse-timeout 5000)
;;---------------------------------------------------------
;;
;;---------------------------------------------------------
;;; font-lockの設定
(if window-system
(progn
(setq font-lock-support-mode 'lazy-lock-mode)
(global-font-lock-mode t)))
;;; TrueType フォント設定
(create-fontset-from-request "private-fontset"
'((width . 8)
(height . 16)
(fixed . t)
(italic . nil))
'((family . "MS ゴシック")
(family . "Courier New")))
; プロパティの設定
(change-fontset-from-request "private-fontset"
'((width . 8)
(height . 16)
(fixed . t)
(weight . 700) ;bold
(italic . nil))
'((family . "MS ゴシック")
(family . "Courier New"))
1)
(change-fontset-from-request "private-fontset"
'((width . 8)
(height . 16)
(fixed . t)
(italic . t)) ; italic
'((family . "MS 明朝")
(family . "Courier New"))
2)
(change-fontset-from-request "private-fontset"
'((width . 8)
(height . 16)
(fixed . t)
(weight . 700); bold
(italic . t)) ; italic
'((family . "MS 明朝")
(family . "Courier New"))
3)
;; ;;; BDF フォント設定
;; ;; intlfonts-1.2.tar.gz が必要です
;; ;; http://www.ring.gr.jp/archives/GNU/intlfonts/intlfonts-1.2.tar.gz
;; ;; http://ring.asahi-net.or.jp/archives/GNU/intlfonts/intlfonts-1.2.tar.gz
;; ;; ftp://ftp.m17n.org/pub/mule/intlfonts-1.2.tar.gz
;; ;; ftp://ftp.gnu.org/pub/gnu/intlfonts/intlfonts-1.2.tar.gz
;; ;; などから入手してください
;; ;; c:/MEADOW/intlfonts-1.2 と展開した場合の設定例となっています。
;; (defvar bdf-font-directory "c:/MEADOW/intlfonts-1.2")
;; (defvar bdf-font-name-prefix "bdffont16-")
;;
;; (defvar bdf-font-file-alist
;; '((ascii "European/lt1-16-etl.bdf" 0)
;; (latin-iso8859-1 "European/lt1-16-etl.bdf" 1) ; ISO8859-1
;; (latin-iso8859-2 "European/lt2-16-etl.bdf" 1) ; ISO8859-2
;; (latin-iso8859-3 "European/lt3-16-etl.bdf" 1) ; ISO8859-3
;; (latin-iso8859-4 "European/lt4-16-etl.bdf" 1) ; ISO8859-4
;; (cyrillic-iso8859-5 "European/cyr16-etl.bdf" 1) ; ISO8859-5
;; (arabic-iso8859-6 "Misc/arab16-0-etl.bdf" 0) ; ISO8859-6 ???
;; (greek-iso8859-7 "European/grk16-etl.bdf" 1) ; ISO8859-7
;; (hebrew-iso8859-8 "Misc/heb16-etl.bdf" 1) ; ISO8859-8
;; (latin-iso8859-9 "European/lt5-16-etl.bdf" 1) ; ISO8859-9
;; (thai-tis620 "Asian/thai16.bdf" 1) ; TIS620
;; (katakana-jisx0201 "japanese.X/8x16rk.bdf" 1) ; JISX0201
;; (latin-jisx0201 "japanese.X/8x16rk.bdf" 0) ; JISX0201
;; (japanese-jisx0212 "japanese/jksp16.bdf" 0) ; JISX0212
;; (japanese-jisx0208-1978 "japanese/j78-16.bdf" 0); JISX0208.1978
;; (japanese-jisx0208 "japanese.X/jiskan16.bdf" 0) ; JISX0208.1983
;; ;; (japanese-jisx0213-1 "Japanese.X/jiskan16-2000-1.bdf" 0) ; JISX0213-2000(Plane 1) * Mule-UCS が必要です
;; ;; (japanese-jisx0213-2 "Japanese.X/jiskan16-2000-2.bdf" 0) ; JISX0213-2000(Plane 2) * Mule-UCS が必要です
;; (korean-ksc5601 "Korean.X/hanglm16.bdf" 0) ; KSC5601 mincho
;; ;; (korean-ksc5601 "Korean.X/hanglg16.bdf" 0) ; KSC5601 gothic
;; (chinese-gb2312 "Chinese.X/gb16fs.bdf" 0 ) ; GB2312 ???
;; (chinese-cns11643-1 "Chinese/cns1-16.bdf" 0) ; CNS11643.1992-1
;; (chinese-cns11643-2 "Chinese/cns2-16.bdf" 0) ; CNS11643.1992-2
;; (chinese-cns11643-3 "Chinese/cns3-16.bdf" 0) ; CNS11643.1992-3
;; (chinese-cns11643-4 "Chinese/cns4-16.bdf" 0) ; CNS11643.1992-4
;; (chinese-cns11643-5 "Chinese/cns5-16.bdf" 0) ; CNS11643.1992-5
;; (chinese-cns11643-6 "Chinese/cns6-16.bdf" 0) ; CNS11643.1992-6
;; (chinese-cns11643-7 "Chinese/cns7-16.bdf" 0) ; CNS11643.1992-7
;; (chinese-big5-1 "Chinese/taipei16.bdf" encode-big5-font) ; Big5
;; (chinese-big5-2 "Chinese/taipei16.bdf" encode-big5-font) ; Big5
;; (chinese-sisheng "Chinese/sish16-etl.bdf" 0) ; sisheng_cwnn ???
;; (vietnamese-viscii-lower "Asian/visc16-etl.bdf" encode-viscii-font) ; VISCII1.1
;; (vietnamese-viscii-upper "Asian/visc16-etl.bdf" encode-viscii-font) ; VISCII1.1
;; (arabic-digit "Misc/arab16-0-etl.bdf" 0) ; MuleArabic-0
;; (arabic-1-column "Misc/arab16-1-etl.bdf" 0) ; MuleArabic-1
;; (arabic-2-column "Misc/arab16-2-etl.bdf" 0) ; MuleArabic-2
;; (ipa "Misc/ipa16-etl.bdf" 1) ; MuleIPA
;; (ethiopic "Ethiopic/ethio16f-uni.bdf" encode-ethio-font) ; Ethiopic-Unicode
;; ;; (ascii-right-to-left "European/lt1-16-etl.bdf" 0) ; ISO8859-1 ;; ???
;; (indian-is13194 "Asian/isci16-mule.bdf" 0) ; IS13194-Devanagari
;; (indian-2-column "Asian/ind16-mule.bdf" 0) ; MuleIndian-2
;; (indian-1-column "Asian/ind1c16-mule.bdf" 0) ; MuleIndian-1
;; (lao "Asian/lao16-mule.bdf" 1) ; MuleLao-1
;; (tibetan "Asian/tib16-mule.bdf" 0) ; MuleTibetan-0
;; (tibetan-1-column "Asian/tib1c16-mule.bdf" 0) ; MuleTibetan-1
;; ))
;;
;; (defun w32-configure-bdf-font (fontset)
;; (new-fontset fontset
;; (mapcar
;; (lambda (x)
;; (let* ((charset (car x))
;; (filename (nth 1 x))
;; (encoding (nth 2 x))
;; (fontname
;; (concat bdf-font-name-prefix
;; (symbol-name charset))))
;; (w32-auto-regist-bdf-font
;; fontname
;; (expand-file-name filename bdf-font-directory)
;; encoding)
;; (cons charset fontname)))
;; bdf-font-file-alist)))
;;
;; (w32-configure-bdf-font "bdf-fontset")
;;
;; ;; bold, italic, bold itaric を追加。
;; ;; Bold
;; (w32-change-font-logfont "bdffont16-ascii" 1
;; (list 'bdf-font (expand-file-name "European/lt1-16b-etl.bdf" bdf-font-directory )))
;; ;; italic
;; (w32-change-font-logfont "bdffont16-ascii" 2
;; (list 'bdf-font (expand-file-name "European/lt1-16i-etl.bdf" bdf-font-directory )))
;; ;; Bold itaric
;; (w32-change-font-logfont "bdffont16-ascii" 3
;; (list 'bdf-font (expand-file-name "European/lt1-16bi-etl.bdf" bdf-font-directory )))
;; 初期フレームの設定
(setq default-frame-alist
(append (list '(foreground-color . "black")
'(background-color . "white")
'(background-color . "gray")
'(border-color . "black")
'(mouse-color . "white")
'(cursor-color . "black")
'(ime-font . (w32-logfont "MS ゴシック"
0 16 400 0 nil nil nil
128 1 3 49)) ; TrueType のみ
;; '(font . "bdf-fontset") ; BDF
'(font . "private-fontset"); TrueType
'(width . 100)
'(height . 37)
'(top . 50)
'(left . 50))
default-frame-alist))
;;---------------------------------------------------------
;; shell の設定
;;---------------------------------------------------------
;;; Cygwin の bash を使う場合
(setq explicit-shell-file-name "bash")
(setq shell-file-name "sh")
(setq shell-command-switch "-c")
;; ;;; Virtually UN*X!にある tcsh.exe を使う場合
;; (setq explicit-shell-file-name "tcsh.exe")
;; (setq shell-file-name "tcsh.exe")
;; (setq shell-command-switch "-c")
;; ;;; WindowsNT に付属の CMD.EXE を使う場合。
;; (setq explicit-shell-file-name "CMD.EXE")
;; (setq shell-file-name "CMD.EXE")
;; (setq shell-command-switch "\\/c")
;; ;;; coding-system の設定
;;(modify-coding-system-alist 'process ".*sh\\.exe" 'undecided-dos)
;;; coding-system の設定
(add-hook 'shell-mode-hook
(lambda ()
(set-buffer-process-coding-system 'undecided-dos 'sjis-unix)))
;;;shellモードの時の^M抑制
(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t)
;;; shell-modeでの補完 (for drive letter)
(setq shell-file-name-chars "~/A-Za-z0-9_^$!#%&{}@'`.,;()-")
;;---------------------------------------------------------
;;
;;---------------------------------------------------------
;;; argument-editing の設定
(require 'mw32script)
(mw32script-init)
;; ;;; browse-url の設定
(require 'browse-url)
(global-set-key [S-mouse-2] 'browse-url-at-mouse)
;;---------------------------------------------------------
;; 印刷の設定
;;---------------------------------------------------------
;; この設定で M-x print-buffer RET などでの印刷ができるようになります
;;
;; notepad に与えるパラメータの形式の設定
(define-process-argument-editing "notepad"
(lambda (x) (general-process-argument-editing-function x nil t)))
(defun w32-print-region (start end
&optional lpr-prog delete-text buf display
&rest rest)
(interactive)
(let ((tmpfile (convert-standard-filename (buffer-name)))
(w32-start-process-show-window t)
;; もし、dos 窓が見えていやな人は上記の `t' を `nil' にします
;; ただし、`nil' にすると Meadow が固まる環境もあるかもしれません
(coding-system-for-write w32-system-coding-system))
(while (string-match "[/\\]" tmpfile)
(setq tmpfile (replace-match "_" t nil tmpfile)))
(setq tmpfile (expand-file-name (concat "_" tmpfile "_")
temporary-file-directory))
(write-region start end tmpfile nil 'nomsg)
(call-process "notepad" nil nil nil "/p" tmpfile)
(and (file-readable-p tmpfile) (file-writable-p tmpfile)
(delete-file tmpfile))))
(setq print-region-function 'w32-print-region)
;;;
;;; end of file
;;;
□コーディングシステムの変更
C-x RET f euc-jp-unix
C-x RET f sjis-dos
□コーディングシステムを指定してファイルを開く
C-x RET c (code) C-x C-f (file name)
□ファイルを開くときのデフォルトのコーディングシステムをsjisに指定
.emacsの先頭に下記1行を追加。
-*- coding: japanese-shift-jis-dos -*-
□開くファイルの拡張子によってコーディングシステムをsjisに指定
.emacsの先頭に下記を追加。
(modify-coding-system-alist 'file "\\.txt$"
'japanese-shift-jis)
(modify-coding-system-alist 'file "\\.awk$"
'japanese-shift-jis)
(modify-coding-system-alist 'file "\\.log$"
'japanese-shift-jis)
□Meadowのバージョンを知る
scratchバッファで
(Meadow-version) と入力しC-j
□フォントの一覧
M-x list-faces-display
□画面の色の一覧
M-x list-colors-display
□矩形の操作
C-x r k矩形を削除して記憶するC-x r d矩形を記憶せずに削除するC-x r y最後に削除した矩形を挿入するC-x r c矩形としてマークした領域を記憶せず、クリアするC-x r oマークした領域に空の矩形を挿入するC-x r t矩形選択領域の各行に文字列を挿入 C-x r r [a-z]矩形領域をレジスタバッファにコピーC-x g [a-z]レジスタバッファから現在のポイント位置に挿入
□shellモードで日本語表示
(add-hook 'shell-mode-hook
(lambda ()
(set-buffer-process-coding-system 'sjis-dos
'sjis)))
□Meadow起動時にWanderlust起動
C:\Meadow\2.00b2\bin\RunMW32.exe -f wl
□Meadowを起動したときのカレントディレクトリをホームディレクトリに設定
ショートカットの「作業フォルダ」にホームディレクトリ(c:\cygwin\home\hoge)を設定すれば、
C-x C-f等やったときホームディレクトリがデフォルトになる。
□メジャーモード(php,html)の追加
http://sourceforge.net/projects/php-mode/ からphp-mode.elをダウンロードしロードパスの通ったフォルダに置く。
下記を.emacsに追加
;;php
(autoload 'php-mode "php-mode" "PHP mode" t)
(defcustom php-file-patterns (list "\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'")
"*List of file patterns for which to automatically invoke php-mode."
:type '(repeat (regexp :tag "Pattern"))
:group 'php)
(let ((php-file-patterns-temp php-file-patterns))
(while php-file-patterns-temp
(add-to-list 'auto-mode-alist
(cons (car php-file-patterns-temp) 'php-mode))
(setq php-file-patterns-temp (cdr php-file-patterns-temp))))
html-helper-mode.el http://www.santafe.edu/~nelson/tools/ からhtml-helpe-mode.elをダウンロードしロードパスの通ったフォルダに置く。
下記を.emacsに追加
;;html css
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
(setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist))
□ロードパス
1. subdirs.el が存在するディレクトリは、 自動的にロードパスに登録される。
2. ~/.emacs に直接記述する。
(setq load-path
(cons "パス" load-path))
複数のパスをまとめて登録する場合は、下記のように記述。
(setq load-path
(append '("パス1"
"パス2"
"パス3")
load-path))