#pragma section-numbers off
Win用Emacs
以下は.emacsの内容。
ほとんど使用しないため設定はかなり古くていいかげんです。
{{{
;Last Update: <2002/01/11 (Fri) 16:18:20 sakito@s2.xrea.com>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 日本語の設定
;;;
(cd "d:/")
(set-language-environment "Japanese")
;(require 'un-define)
;(require 'un-tools)
;(set-keyboard-coding-system 'sjis)
;(set-terminal-coding-system 'sjis)
;(setq file-name-coding-system 'sjis)
;(setq-default buffer-file-coding-system 'ISO-2022-JP)
;(set-clipboard-coding-system 'sjis-dos)
;(set-w32-system-coding-system 'sjis)
;((setq network-coding-system-alist
; '(("nntp" . (junet-unix . junet-unix))
; (110 . (no-conversion . no-conversion))
; (25 . (no-conversion . no-conversion))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 環境設定
;;;
;;Shell設定
(setq shell-file-name "c:/cygwin/bin/bash.exe")
(setenv "SHELL" shell-file-name)
(setq explicit-shell-file-name shell-file-name)
;(setq explicit-sh-args '("-login" "-i"))
(setq explicit-bash-args '("-login" "-i"))
(setq shell-command-switch "-c")
(setq win32-quote-process-args t)
;;coding system setting
(add-hook 'shell-mode-hook
(lambda ()
(set-buffer-process-coding-system 'undecided-dos 'sjis-unix)))
;;M delete
(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t)
;;Highlighting on. modefied 言語色設定
(require 'font-lock)
(global-font-lock-mode t)
;; hilit19
(require 'hilit19)
;;動的略語展開で大文字小文字を区別
(setq debbrev-case-fold-search nil)
;;バックアップファイルの保存位置指定
(setq backup-by-copying t)
(fset 'make-backup-file-name
'(lambda (file)
(concat (expand-file-name "d:/tmp/")
(file-name-nondirectory file))))
;;印刷設定
(define-process-argument-editing "/notepad¥¥.exe$"
(lambda (x)
(general-process-argument-editing-function x nil t)))
(setq print-region-function
'(lambda (start end &rest dummyargs)
(let ((tmpfile
(unix-to-dos-filename
(concat (or (getenv "TMP") (getenv "TEMP")) "/"
(make-temp-name "L") ".tmp"))))
(if (file-exists-p tmpfile)
(signal 'file-error
'("The temporary file that I try to create has been exists!")
))
(write-region start end tmpfile nil nil 'sjis-dos)
(call-process "notepad" nil nil nil "/p" tmpfile)
(delete-file tmpfile))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 画面設定
;;;
;;フレーム設定
(setq default-frame-alist
(append (list '(foreground-color . "black")
'(background-color . "light goldenrod yellow")
'(BORDER-color . "white")
'(cursor-color . "orange")
'(width . 80)
'(height . 40)
'(top . 80)
'(left . 120)
'(vertical-scroll-bars .nil)
'(font . "sakito-fontset")
)
default-frame-alist))
;;mode line color
(set-face-foreground 'modeline "snow")
(set-face-background 'modeline "black")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 編集設定
;;;
;;フォント
(defvar bdf-font-directory "d:/home/bdf/")
(defvar bdf-font-name-prefix "bdffont16-")
;; 日本語表示の場合
(setq bdf-font-file-alist
'((ascii "8x16.bdf" 0)
(latin-iso8859-1 "non-cjk/etl16-latin1.bdf" 1)
(latin-iso8859-2 "non-cjk/etl16-latin2.bdf" 1)
(latin-iso8859-3 "non-cjk/etl16-latin3.bdf" 1)
(latin-iso8859-4 "non-cjk/etl16-latin4.bdf" 1)
(japanese-jisx0212 "jpn/mincho16.bdf" 0)
(japanese-jisx0208 "jpn/jiskan16.bdf" 0)
(latin-jisx0201 "jpn/8x16rk.bdf" 0)
(katakana-jisx0201 "jpn/8x16rk.bdf" 1)
))
(new-fontset
"sakito-fontset"
(mapcar
(lambda (x)
(let* ((charset (car x))
(filename
(expand-file-name (nth 1 x) bdf-font-directory))
(encoding (nth 2 x))
(fontname
(concat bdf-font-name-prefix (symbol-name charset))))
(w32-add-font fontname
(cons
(cons 'encoding-type encoding)
'((default-ascent . 0)
(relative-compose . 0)
(overhang . 0)
(base . 14)
(height . 16)
(width . 8))))
(w32-change-font-logfont
fontname 0 (list 'bdf-font filename))
(cons charset fontname)))
bdf-font-file-alist))
;; Bold
(w32-change-font-logfont
(concat bdf-font-name-prefix "ascii") 1 (list 'bdf-font
(concat bdf-font-directory "non-cjk/etl16b-latin1.bdf")))
;; italic
(w32-change-font-logfont
(concat bdf-font-name-prefix "ascii") 2 (list 'bdf-font
(concat bdf-font-directory "non-cjk/etl16i-latin1.bdf")))
;; Bold itaric
(w32-change-font-logfont
(concat bdf-font-name-prefix "ascii") 3 (list 'bdf-font
(concat bdf-font-directory "non-cjk/etl16i-latin1.bdf")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;;好みの設定
;;;
;;Shift カーソルでリージョン選択
(pc-selection-mode)
;; 1行づつスクロールする
(setq scroll-conservatively 1)
;;現在のモードを表示
(show-paren-mode t)
;;TAB幅
(setq-default tab-width 4)
;;新規行を作成しない
(setq next-line-add-newlines nil)
;;カーソル行数を表示
(line-number-mode t)
(column-number-mode t)
;;カーソル位置記憶
(require 'saveplace)
(setq-default save-place t)
(setq save-place-file "d:/etc/places.txt")
;;起動時のmessageを表示しない
(setq inhibit-startup-message t)
;; C-x C-b でバッファリストを開く時に、ウィンドウを分割しない
(global-set-key "¥C-x¥C-b" 'buffer-menu)
;;cygwin-mount.el
(require 'cygwin32-mount)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; アプリケーションの設定
;;;
(if (not (memq 'time-stamp write-file-hooks))
(setq write-file-hooks
(cons 'time-stamp write-file-hooks)))
;skk
(require 'skk-autoloads)
(global-set-key "¥C-x¥C-j" 'skk-mode)
(global-set-key "¥C-xj" 'skk-auto-fill-mode)
(global-set-key "¥C-xt" 'skk-tutorial)
(setq skk-large-jisyo "d:/etc/SKK-JISYO.L")
(setq skk-number-style 0)
(setq date-ad 1)
;;epo
(autoload 'epo "epo" "Editing Process Organizer" t)
;;epoan
(require 'epoan)
;;psgml
;(autoload 'sgml-mode "psgml" "Major mode to edit SGML files " t)
;(autoload 'xml-mode "psgml" "Major mode to edit XML files" t)
;(setq auto-mode-alist
; (append (list (cons "¥¥.xml¥¥'" 'xml-mode))
; auto-mode-alist))
;(autoload 'xml-mode "psgml" nil t)
;w3
;(require 'w3-auto)
;(setenv "MAILCAPS" "~/.mailcap")
;(setq w3-default-homepage "http://web1.ibjsystems.co.jp/")
;(setq url-personal-mail-adress "no@foo.spam.org")
;(setq url-automatic-caching t)
;(setq url-standalone-mode t)
;(setq url-be-asynchronous t)
;;;; YaTeX & yahtml (野鳥)
;; yatex-modeを起動させる設定
(setq auto-mode-alist
(cons (cons "¥¥.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
;; yahtml-modeを使う人は以下も加える
(setq auto-mode-alist
(cons (cons "¥¥.html$" 'yahtml-mode) auto-mode-alist))
(autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t)
;; 1 = Shift JIS, 2 = JIS, 3 = EUC
;; defaultはそれぞれ2
(setq YaTeX-kanji-code 3) ; euc3
(setq yahtml-kanji-code 1) ; jis
(add-hook 'yahtml-mode-hook
'(lambda ()
;; “更新日”の自動更新
(set (make-local-variable 'time-stamp-start) "更新日:[ ¥t]+¥"")
(set (make-local-variable 'time-stamp-format)
"%:y/%02m/%02d %02H:%02M:%02S")
(set (make-local-variable 'time-stamp-line-limit) 30)
;; auto time-stamp
(add-hook 'local-write-file-hooks 'time-stamp)
(auto-fill-mode)))
; (make-local-variable 'time-stamp-start)
; (setq time-stamp-start "更新日:[ ¥t]+¥¥¥¥?[¥"<]+")
; (setq time-stamp-start "Last Update:[ ¥t]+¥¥¥¥?[¥"<]+")
; (make-local-variable 'time-stamp-format)
; (setq time-stamp-format
; '(time-stamp-yyyy/mm/dd time-stamp-hh:mm:ss))
; (add-hook 'local-write-file-hooks 'time-stamp)
; ))
;;SmartDoc mode setting
(setq auto-mode-alist
(append '(("¥¥.sdoc$" .sdoc-mode)) auto-mode-alist))
(setq sgml-quick-keys t)
(autoload 'sdoc-mode "sdoc-mode" nil t)
(add-hook 'sdoc-mode-hook
'(lambda ()
;; “”の自動更新
(set (make-local-variable 'time-stamp-start) "")
(set (make-local-variable 'time-stamp-end) "")
(set (make-local-variable 'time-stamp-format)
"%04Y/%02m/%02d (%3a) %02H:%02M:%02S sakito@s2.xrea.com")
(set (make-local-variable 'time-stamp-line-limit) 30)
;; auto time-stamp
(add-hook 'local-write-file-hooks 'time-stamp)
(auto-fill-mode)))
;;Python mode setting
(setq auto-mode-alist
(append '(("¥¥.py$" .python-mode)) auto-mode-alist))
(autoload 'python-mode "python-mode" nil t)
;; pcl-cvsの設定
;; 起動はM-x cvs-examine
;(load-file "d:/bin/Meadow/1.14/site-lisp/pcl-cvs/pcl-cvs-startup.el")
(add-hook 'cvs-mode-hook
(lambda ()
(collection-set-goal-column cvs-buffer-name 38)))
;; log はどのコードで書くか決めて、固定にしておかないと危険です
;; (euc-japan でも sjis でも良いんけど)
(modify-coding-system-alist 'process "cvs" '(undecided . euc-japan))
;; pserver ではなく local repository を使うための設定。詳細は、
;; meadow-users-jp メーリングリストの
;; Subject: about pcl-cvs X-ML-COUNT: 1870
;; Date: Sat, 29 Jan 2000 01:45:18 +0900 で始まる thread を参照のこと。
;;
(if (featurep 'meadow)
(define-process-argument-editing
"/cvs¥¥.exe¥¥'"
(lambda (x)
(let ((command (car x))
(argument (cdr x)))
(setq argument (cygnus-process-argument-quoting argument))
(concat
(unix-to-dos-filename command) " "
(unix-to-dos-argument (mapconcat (function concat) argument " ")
nil nil nil nil))))))
;;; ----------------------------------------------------------------
;;; time-stamp.el (2000/11/20)
;;; ----------------------------------------------------------------
;;; 最終更新日の%04Y/%02m/%02d (%3a) %02H:%02M:%02S sakito@s2.xrea.com自
動挿入
;;; ファイルの先頭から 8 行以内にlast updated : last updated : <>
;;; と書いてあれば、セーブ時に自動的に日付が挿入されます
;(require 'time-stamp)
;(add-hook 'write-file-hooks 'time-stamp)
;(setq time-stamp-active t)
;(setq time-stamp-format "%04Y/%02m/%02d (%3a) %02H:%02M:%02S
sakito@s2.xrea.com")
;(setq time-stamp-start "Last Update:[ ¥t]+¥¥¥¥?[¥"<]+")
;(setq time-stamp-format '(time-stamp-month-dd-yyyy time-stamp-hh:mm:ss))
;(setq time-stamp-format "%04y/%02m/%02d")
;; (setq time-stamp-line-limit 10000) と書いておくと、1万行以内で OK
;(setq time-stamp-end " ¥¥|$")
(defun time-stamp-date ()
"Return the current time as a string in ¥"¥(Date¥)¥" form."
; (format-time-string "[%04Y/%02m/%02d] %02H:%02M:%02S"))
(format-time-string "%04Y/%02m/%02d [%02H:%02M:%02S]"))
(defun insert-date nil
"Insert Date."
(interactive)
(insert (time-stamp-date)))
;; キーバインド変更
(define-key global-map "¥C-c¥C-i" 'insert-date)
;; ----------------------------------------------------------------
;; auto-insert
;; ----------------------------------------------------------------
(require 'autoinsert)
; [test]:2000/11/28
(add-hook 'find-file-hooks 'auto-insert)
;; pcl-cvsが作るテンポラリファイルのバッファでは(auto-insert)しない
(defadvice auto-insert (around deactivate-autoinsert-for-cvs-temp-buffer
first activate)
"Deactivate autoinsert feature for pcl-cvs work buffer."
(or (string-match "pcl-cvs¥.[0-9a-zA-Z]+¥¥'" (buffer-file-name))
(string-match "Mail/draft" (buffer-file-name))
; (string-match "¥¥+draft/[0-9]+" (buffer-name))
ad-do-it)
nil)
;; テンプレートとなるファイルがあるディレクトリ
;; 末尾に"/"が必要なので注意
(setq auto-insert-directory "~/autoinsert/")
;; 質問しないで auto-insertを実行する
(setq auto-insert-query nil)
;; 下請け関数
;; 簡単な置換を実行した後
;; "EDIT_HERE"まで進んで"EDIT_HERE"自体は削除する
;; buffer-modified-p は、変数 auto-insertを見て
;; 仕様に従って設定される
;; 98.5.28 (Thu)
(defun auto-insert-expand-abbrev-and-set-point (template-file)
"Advance to edit point after auto-insert"
(insert-file-contents (concat auto-insert-directory template-file))
; (let ((replace-alist '(
; ("" . (format-time-string "%04Y/%02m/%02d (%3a)"))
; ("" . (file-name-nondirectory (buffer-file-name)))
; ("" . "secret")
; ("" . (concat "Time-stamp: <" (time-stamp-string) ">");)
; ("" . user-mail-address)))
)
; (case-replace nil)
; pat sexp)
;; 定型の置換
; (while replace-alist
; (setq pat (car (car replace-alist))
; evaled (eval (cdr (car replace-alist))))
; (goto-char (point-min))
; (while (re-search-forward pat nil t)
; (replace-match evaled 'fixedcase 'literal))
; (setq replace-alist (cdr replace-alist))))
;; 編集位置まで進む
; (goto-char (point-min))
; (and (search-forward "" nil t)
; (replace-match ""))
; (set-buffer-modified-p (eq auto-insert t)))
(setq auto-insert-alist
(append '(
;;========================================[2001/05/12]
;; yahtml-mode
((yahtml-mode . "yahtml document")
. (lambda nil (auto-insert-expand-abbrev-and-set-point
"html-insert.html")))
;;========================================2002/01/11 [09:31:43]
;; sdoc-mode
((sdoc-mode . "SmartDoc document")
. (lambda nil (auto-insert-expand-abbrev-and-set-point
"sdoc-insert.sdoc")))
;;code
(provide '" (file-name-sans-extension (file-name-nondirectory
(buffer-file-name))) ")
;;; " (file-name-nondirectory (buffer-file-name)) " ends here")
)
auto-insert-alist))
;(cd "~/")
}}}
背景が暗い場合に以下を設定
{{{
;; background が暗いときに設定
(setq frame-background-mode 'dark)
;; 起動時のframeに有効とする
(frame-update-face-colors (selected-frame))
}}}
----
CategoryEmacs
CategoryLink