目次 ↑
~/.emacs.d/init.el が読み込まれないという不具合がある(対応方法は後述)
(add-to-list 'load-path "~/.emacs.d") (load "init")
Buffer `hogehoge' still has clients; kill it? (yes or no)
REM REM Emacs クライアント/サーバ REM REM ・%HOME%\.emacs または %HOME%\.emacs.d\init.el に以下の4行を追加しておくこと: REM REM (server-start) REM (remove-hook REM 'kill-buffer-query-functions REM 'server-kill-buffer-query-function) REM REM 参考URL: REM http://d.hatena.ne.jp/hirukiyo/20091204/1259938895 REM http://aki.issp.u-tokyo.ac.jp/itoh/hiChangeLog/html/clsearch.cgi?from=10&cat=Emacs REM set EMACS_BIN=%~dp0\emacs\23.1\bin set EMACS_SERVER=%EMACS_BIN%\emacs.exe set EMACS_CLIENT=%EMACS_BIN%\emacsclientw.exe set ALTERNATE_EDITOR=%EMACS_BIN%\runemacs.exe set HOME=%~d0\home set EMACS_SERVER_FILE=%HOME%\.emacs.d\server\server set ARG=%1 if not exist %EMACS_SERVER_FILE% goto SERVER if "%ARG%"=="" goto NOP goto CLIENT :SERVER %EMACS_SERVER% %ARG% %2 %3 %4 %5 %6 %7 %8 %9 if exist %EMACS_SERVER_FILE% del %EMACS_SERVER_FILE% goto END :CLIENT %EMACS_CLIENT% %ARG% %1 %2 %3 %4 %5 %6 %7 %8 %9 goto END :NOP goto END :END
; Ctrl + Alt + R で org-remember
^!r::
IfWinNotExist, ahk_class Emacs
{
;; Emacsサーバが起動していなかったらまずそれを起動する(ウィンドウは最小化)
Run, %comspec% /c C:\path\to\emacs.bat --iconic, , min
WinWait, ahk_class Emacs
}
;; Emacsクライアントでのorg-remember専用ウィンドウを起動する
Run, C:\path\to\emacs.bat -e "(remember-other-frame)"
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; system settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; client/server
(server-start)
(remove-hook
'kill-buffer-query-functions
'server-kill-buffer-query-function)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; encodings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Unicodeをメインにする場合の設定
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'sjis)
(setq default-buffer-file-coding-system 'utf-8)
;; MS-Windows shell-mode
(add-hook
'shell-mode-hook
'(lambda ()
(set-buffer-process-coding-system 'sjis 'sjis)))
;; MS Windows clipboard
(set-clipboard-coding-system 'utf-16le-dos)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; directories
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; default directory
(setq default-directory "~/")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; apperance (generic)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; color-theme
(add-to-list 'load-path "~/lib/emacs/color-theme")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-clarity)))
;; *NOTE* another favorite color-theme:
;; color-theme-hober
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; apperance (NTEmacsJP-specific)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; splash screen
(setq inhibit-startup-message t)
;; window transparency (*heavy*)
;(set-alpha '(85 35))
;; fonts
(add-to-list 'load-path "~/lib/emacs/fixed-width-fontset")
(if (eq window-system 'w32) (require 'ntemacs-font))
(fixed-width-set-fontset "msgothic" 14)
;; window title/size
(setq frame-title-format (format "emacs@%s : %%f" (system-name)))
(setq initial-frame-alist
(append
'( (top . 10)
(left . 20)
(width . 161) ; C-x 3 -> 80 + 1 + 80
(height . 65))
initial-frame-alist))
;; lose the UI
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
;(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
;(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
;;; --- end of settings ---
;; fonts -- fixed-width-fontset は不要
;(add-to-list 'load-path "~/lib/emacs/fixed-width-fontset")
;(if (eq window-system 'w32) (require 'ntemacs-font))
;(fixed-width-set-fontset "msgothic" 14)
;; fonts -- Windowsの日本語フォントを直接指定(IME使用時に文字幅がちょっと変わるのは我慢する)
(set-default-font "MS ゴシック-10")
(set-fontset-font (frame-parameter nil 'font)
'japanese-jisx0208
'("MS ゴシック" . "unicode-bmp"))
;; デフォルトフォントを全てのフレームに指定する
;; http://www.bookshelf.jp/texi/emacs-man/21-3/jp/emacs_20.html
(add-to-list 'default-frame-alist '(font . "MS ゴシック-10"))
/.emacs に全ての設定を書くやりかたはもう古い、~/.emacs.d/init.el を使うべき(移行中)
~/.emacs.d/init.el をバイトコンパイルしておくと起動が速くなる