term タグ別の記事一覧

最近のemacs設定ファイル

 最近の.emacs。とりあえずバックアップ代わりにここで公開。

;; -*- coding: euc-jp -*-(custom-set-variables  ;; custom-set-variables was added by Custom.  ;; If you edit it by hand, you could mess it up, so be careful.  ;; Your init file should contain only one such instance.  ;; If there is more than one, they won't work right. '(c-default-style (quote ((c-mode . "k&r;") (c++-mode . "k&r;") (java-mode . "java") (awk-mode . "awk") (other . "gnu")))) '(case-fold-search t) '(current-language-environment "English") '(save-place t nil (saveplace)) '(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))) '(tool-bar-mode nil nil (tool-bar)) '(transient-mark-mode t) '(uniquify-buffer-name-style (quote forward) nil (uniquify)))(custom-set-faces  ;; custom-set-faces was added by Custom.  ;; If you edit it by hand, you could mess it up, so be careful.  ;; Your init file should contain only one such instance.  ;; If there is more than one, they won't work right. );; .emacs.el;; 選択範囲の色を指定(set-face-background 'region "SkyBlue")(set-face-foreground 'region "black");; 起動時のウィンドウサイズ、色などを設定(if (boundp 'window-system)    (setq default-frame-alist          (append (list                   '(foreground-color . "black")  ; 文字色                   '(background-color . "white")  ; 背景色                   '(border-color     . "white")  ; ボーダー色                   '(mouse-color      . "black")  ; マウスカーソルの色                   '(cursor-color     . "black")  ; カーソルの色                   '(cursor-type      . box)      ; カーソルの形状                   '(top . 60) ; ウィンドウの表示位置(Y座標)                   '(left . 140) ; ウィンドウの表示位置(X座標)                   '(width . 50) ; ウィンドウの幅(文字数)                   '(height . 45) ; ウィンドウの高さ(文字数)                   )                  default-frame-alist)))(setq initial-frame-alist default-frame-alist )(global-set-key "\C-h" 'delete-backward-char)(prefer-coding-system 'utf-8-unix);;(autoload 'cperl-mode "cperl" "Perl editing mode." t)(require 'cperl-mode)(setq auto-mode-alist      (append '(("\\.pl$" . cperl-mode)		("\\.pm$" . cperl-mode)		("\\.mm$" . objc-mode)) auto-mode-alist));; Turn on tabs(setq indent-tabs-mode t)(setq-default indent-tabs-mode t);; Set the tab width(setq default-tab-width 4)(setq tab-width 4)(setq c-basic-indent 4);;python-mode(add-hook 'python-mode-hook	  '(lambda();;	     (setq indent-tabs-mode t)	     (setq indent-level 4)	     (setq python-indent 4)	     (setq tab-width 4)));;c-mode(add-hook 'c-mode-hook	  '(lambda()         (setq tab-width 4)         (setq indent-tabs-mode nil)         (setq c-basic-offset 4)));; キーワードのカラー表示を有効化;; 「t」の部分を「nil」にするとカラー表示をOffにできる(global-font-lock-mode t);; テキストエンコーディングとしてUTF-8を優先的に使用する;; 「utf-8」の部分を「cp932」とするとCP932(Windows用Shift JIS)優先となる(prefer-coding-system 'utf-8);; 起動時のメッセージを表示しない;;「t」を「nil」にするとメッセージが表示される(setq inhibit-startup-message t);; 選択範囲をハイライトする;;「t」を「nil」にするとハイライトなしに(setq-default transient-mark-mode t);;; 行番号・桁番号をモードラインに表示する・しない設定(line-number-mode t) ; 行番号。tなら表示、nilなら非表示(column-number-mode t) ; 桁番号。tなら表示、nilなら非表示;; 対応するカッコを色表示する(show-paren-mode 1);; オートセーブOff;; 「nil」を「t」にするとOnに(auto-save-mode nil);; バックアップファイルを作る;; 「nil」を「t」にするとバックアップファイルを作らない(setq backup-inhibited nil);; モードラインに現在時刻を表示する(display-time);; カレントディレクトリをホームディレクトリに設定;; ""内は任意のディレクトリを指定可能(cd "~/"); Emacsバージョン別の設定; for NTEmacs(if (string-match "Emacs 22" (emacs-version))	(progn; イタリックやボールドフォントを標準フォントから作成する(setq w32-enable-synthesized-fonts t); 使用するフォントを指定 for NTEmacs; 「myfont」という名前で新たなフォントセットを定義; 英字フォントとしてメイリオ、14ポイントを使用(create-fontset-from-ascii-font "-outline-メイリオ-normal-r-normal-normal-14-*-*-*-*-*-iso8859-1" nil "myfont"); myfontの日本語フォントとしてメイリオを使用; フォントサイズは英字のサイズに合わせる(set-fontset-font "fontset-myfont"                  'japanese-jisx0208				  '("メイリオ" . "jisx0208-sjis")); myfontのカタカナフォントとしてメイリオを使用; フォントサイズは英字のサイズに合わせる(set-fontset-font "fontset-myfont"                  'katakana-jisx0201                  '("メイリオ" . "jisx0201-katakana")); 定義したフォントセットを登録(setcdr (assoc 'font default-frame-alist) "fontset-myfont"); NTEmacsの設定ここまで	  ) t); for Meadow(if (string-match "Emacs 21" (emacs-version))	(progn; 日本語環境設定(set-language-environment "Japanese")(mw32-ime-initialize)(setq default-input-method "MW32-IME"); フォントセットを追加(w32-add-font     "Meiryo 14"     '((spec	((:char-spec ascii :height any)	 strict	 (w32-logfont "Meiryo" 0 -14 400 0 nil nil nil 0 1 3 0))	((:char-spec ascii :height any :weight bold)	 strict	 (w32-logfont "Meiryo" 0 -14 700 0 nil nil nil 0 1 3 0)	 ((spacing . -1)))	((:char-spec ascii :height any :slant italic)	 strict	 (w32-logfont "Meiryo" 0 -14 400 0   t nil nil 0 1 3 0))	((:char-spec ascii :height any :weight bold :slant italic)	 strict	 (w32-logfont "Meiryo" 0 -14 700 0   t nil nil 0 1 3 0)	 ((spacing . -1)))	((:char-spec japanese-jisx0208 :height any)	 strict	 (w32-logfont "Meiryo" 0 -14 400 0 nil nil nil 128 1 3 0))	((:char-spec japanese-jisx0208 :height any :weight bold)	 strict	 (w32-logfont "Meiryo" 0 -14 700 0 nil nil nil 128 1 3 0)	 ((spacing . -1)))	((:char-spec japanese-jisx0208 :height any :slant italic)	 strict	 (w32-logfont "Meiryo" 0 -14 400 0   t nil nil 128 1 3 0))	((:char-spec japanese-jisx0208 :height any :weight bold :slant italic)	 strict	 (w32-logfont "Meiryo" 0 -14 700 0   t nil nil 128 1 3 0)	 ((spacing . -1)))))); 起動時およびnew-frame時のフレーム(ウィンドウ)の設定。(add-to-list 'default-frame-alist '(font . "Meiryo 14")); IMEのフォントを設定(let ((logfont '(w32-logfont "Meiryo" 0 -14 400 0 nil nil nil 128 1 3 0)))  (modify-frame-parameters (selected-frame) (list (cons 'ime-font logfont)))  (add-to-list 'default-frame-alist (cons 'ime-font logfont))  ); Meadowの設定ここまで	  ) t)