emacs の init.el

Windows 10 上で利用している emacs が,TeX のソース編集をしていると頻繁に 

resource exhausted ! Save current buffer and restart emacs !

と表示されて作業の一時中断を余儀なくされることが頻発したため,~/.emacs.d/init.el をクリーンアップして,意味の分かるところだけを残すようにした(設定された機能の半分も使ってないのでは?)。以下がその minimum init.el

 

;; 日本語の設定 (UTF-8)
(set-language-environment 'Japanese)
(prefer-coding-system 'utf-8)

;; 各行横に行番号を表示
(global-linum-mode t)
(set-face-attribute 'linum nil
:foreground "#800"
:height 0.9)

;; 行番号・桁番号の表示
(line-number-mode t)
(column-number-mode t)

;; 対応するカッコをハイライト表示する
(show-paren-mode 1)

;; autosave on
(auto-save-mode t)

;; モードラインに現在時刻を表示
(display-time)

;; Font の設定
(set-face-attribute 'default nil :family "Inconsolata" :height 110)
;(set-face-attribute 'default nil :family "Consolas" :height 104)
(set-fontset-font nil 'japanese-jisx0208 (font-spec :family "MeiryoKe_Console"))
(setq face-font-rescale-alist '*1
(global-set-key (kbd "C-t") 'other-window-or-split)

;; YaTeX
(setq auto-mode-alist
(cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
(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.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(ansi-color-names-vector
["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"])
'(custom-enabled-themes (quote (manoj-dark))))
(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.
)

*1:"MeiryoKe_Console" . 1.08)))

;; 起動時のウィンドウサイズ、色などを設定
(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 . 80) ; ウィンドウの幅(文字数)
'(height . 40) ; ウィンドウの高さ(文字数)
)
default-frame-alist)))
(setq initial-frame-alist default-frame-alist )

;; バッファの同一ファイル名を区別する
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)

;;; 現在行を目立たせる
(global-hl-line-mode)

;; Window 分割を画面サイズに従って計算する
(defun split-window-vertically-n (num_wins)
(interactive "p")
(if (= num_wins 2)
(split-window-vertically)
(progn
(split-window-vertically
(- (window-height) (/ (window-height) num_wins)))
(split-window-vertically-n (- num_wins 1)))))
(defun split-window-horizontally-n (num_wins)
(interactive "p")
(if (= num_wins 2)
(split-window-horizontally)
(progn
(split-window-horizontally
(- (window-width) (/ (window-width) num_wins)))
(split-window-horizontally-n (- num_wins 1)))))

;; Window 分割・移動を C-t で
(defun other-window-or-split ()
(interactive)
(when (one-window-p)
(if (>= (window-body-width) 270)
(split-window-horizontally-n 3)
(split-window-horizontally)))
(other-window 1