OSXWS-10.6-x の cocoa emacs 設定ファイル
ユーザーの初期設定ファイルを読む直前に osxws.el がロードされる: "/usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws.el"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws.el for MacOS X WorkShop
;; KOBAYASHI Taizo <xxxxxxx@xxxxxxx>
;; Time-stamp:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; setting the MacOS X WorkShop flag
(defconst osxws-emacs-flag t
"This is Emacs of MacOS X WorkShop.")
(setq emacs-build-system
(concat emacs-build-system " - MacOS X WorkShop - 10.6 "))
(setq report-emacs-bug-address "osxws@xxxx.xx.xxx-u.ac.jp")
(defcustom osxws-default t
"A boolean for all OSX Workshop default settings"
:type 'boolean)
(defcustom osxws-default-base t
"A boolean for loading osxws-setting section 0 (fundamental configurations)"
:type 'boolean)
(defcustom osxws-default-language_japanese t
"A boolean for loading osxws-setting section 1 (language for Japanese)"
:type 'boolean)
(defcustom osxws-default-appearance t
"A boolean for loading osxws-setting section 2 (appearance)"
:type 'boolean)
(defcustom osxws-default-keyboard t
"A boolean for loading osxws-setting section 3 (keyboard/keybinding)"
:type 'boolean)
(defcustom osxws-default-shell t
"A boolean for loading osxws-setting section 4 (shell-command)"
:type 'boolean)
(defcustom osxws-default-inlinepatch t
"A boolean for loading osxws-setting section 5 (inline patch)"
:type 'boolean)
(defcustom osxws-default-cocoaemacs t
"A boolean for loading osxws-setting section 6 (Cocoa Emacs)"
:type 'boolean)
(defcustom osxws-default-else t
"A boolean for loading osxws-setting section 7 (anything else)"
:type 'boolean)
(defcustom osxws-default-mew t
"A boolean for loading osxws-setting for Mew"
:type 'boolean)
(defcustom osxws-default-yatex t
"A boolean for loading osxws-setting for YaTeX"
:type 'boolean)
(if (file-exists-p (concat user-emacs-directory "setup_osxws_default.el"))
(load-file (concat user-emacs-directory "setup_osxws_default.el")))
(when osxws-default
(message "Starting osxws-default ...")
(load-file "/usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-default.el")
(if osxws-default-yatex
(load-file "/usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-default-yatex.el")
))
(setq custom-file "~/.emacs.d/custom_osxws.el")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; buffer-file-coding-system: utf-8-unix
;; End:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ~/.emacs.d/setup_osxws_default.el ;; .emacs for MacOS X WorkShop ;; Time-stamp: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; MacOS X WorkShop provides the default setting for Emacs. ;; The setting is written in the following file: ;; /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-default.el ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; You can inactivate all by setting the variable osxws-defaul to nil. ;; (setq osxws-default nil) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; You can inactivate each section of the setting by setting ;; the variables osxws-defaul-* to nil. ;;(setq osxws-default-base nil) ;;(setq osxws-default-language_japanese nil) <--- en では有効に設定 ;;(setq osxws-default-appearance nil) ;;(setq osxws-default-keyboard nil) ;;(setq osxws-default-shell nil) ;;(setq osxws-default-inlinepatch nil) ;;(setq osxws-default-cocoaemacs nil) ;;(setq osxws-default-else nil) ;;(setq osxws-default-mew nil) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; You can inactivate the default setting for YaTeX by ;;(setq osxws-default-yatex nil) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; buffer-file-coding-system: utf-8-unix ;; End:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ~/.emacs.d/init.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; You can edit this file as you like! ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; no start up message ;;(setq inhibit-startup-screen t) ;; window mode setting (when (eq window-system 'ns) ;; window size ;;(setq default-frame-alist ;; (append ;; '((width . 100) (height . 40)) ;; default-frame-alist)) ;; Color-thema (require 'color-theme) (color-theme-dark-blue2) ;; Transparency3 (add-to-list 'default-frame-alist '(alpha . (100 80))) ;; (alpha . (<active frame> <non active frame>)) ) ;; input special and control characters by "Option" ;; (setq ns-option-modifier 'none) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; buffer-file-coding-system: utf-8-unix ;; End:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws-default.el for MacOS X WorkShop
;; Time-stamp: <2011-03-08 08:20:57 seto>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 0 fundamental configurations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-base
;; path setting
(setq exec-path
(append
(list "/usr/osxws/bin" "~/bin") exec-path))
(setenv "PATH"
(concat '"/usr/osxws/bin:~/bin:" (getenv "PATH")))
;; save the position before you editing.
(require 'saveplace)
(setq-default save-place t)
(setq save-place-file "~/Library/Application Support/OSXWS/emacs-places.txt")
;; copy foo to foo~ as a backup file
(setq backup-by-copying t)
;; deleting files goes to OS's trash folder
;;(setq delete-by-moving-to-trash t)
;; start emacsclient server
;(server-start)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 1 language configurations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-language_japanese
;; japanese settings for Cocoa Emacs Package
(set-language-environment 'Japanese)
(prefer-coding-system 'utf-8-unix)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 2 appearance setting
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-appearance
;; hide tool-bar and menu-bar
(if window-system
(tool-bar-mode 0)
(menu-bar-mode 0))
;; show the corresponding paren
(show-paren-mode)
;; do not font scaling
(setq scalable-fonts-allowed nil)
;;; show the present time on status bar
(when (equal current-language-environment "Japanese")
(setq dayname-j-alist
'(("Sun" . "日") ("Mon" . "月")
("Tue" . "火") ("Wed" . "水")
("Thu" . "木") ("Fri" . "金")
("Sat" . "土")))
(setq display-time-string-forms
'((format "%s年%s月%s日(%s) %s:%s %s"
year month day
(cdr (assoc dayname dayname-j-alist))
24-hours minutes
load))))
(display-time)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 3 keyboard/keybinding
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-keyboard
;; emulation of the standard CUA key bindings (Mac GUI)
(cua-selection-mode t)
;; behavior of "Command + Cursor" to the default of MacOS X
;; default : ns-next-frame in ns-win.el
(define-key global-map [s-left] 'move-beginning-of-line)
;; default : ns-prev-frame in ns-win.el
(define-key global-map [s-right] 'move-end-of-line)
(define-key global-map [s-up] 'backward-page)
(define-key global-map [s-down] 'forward-page)
;; font resize short cut (Command +/-/0)
(global-set-key [(s ?+)] (lambda () (interactive) (text-scale-increase 1)))
(global-set-key [(s ?-)] (lambda () (interactive) (text-scale-decrease 1)))
(global-set-key [(s ?0)] (lambda () (interactive) (text-scale-increase 0)))
;; Delete the following character by fn + delete
(define-key global-map [kp-delete] 'delete-char)
;; fix yen key problem on JIS keyboard
;; Ando-san's code (see [Macemacsjp-users 1126])
(define-key global-map [2213] nil)
(define-key global-map [67111077] nil)
(define-key function-key-map [2213] [?\\])
(define-key function-key-map [67111077] [?\C-\\])
(define-key global-map [3420] nil)
(define-key global-map [67112284] nil)
(define-key function-key-map [3420] [?\\])
(define-key function-key-map [67112284] [?\C-\\])
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 4 shell-command
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-shell
;; hide password
(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt)
;; escape sequence
(autoload 'ansi-color-for-comint-mode-on "ansi-color"
"Set `ansi-color-for-comint-mode' to t." t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 5 inline-patch by Hashimoto-san
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-inlinepatch
(when window-system
(setq default-input-method "MacOSX")
(add-hook 'minibuffer-setup-hook 'mac-change-language-to-us)
;;(mac-add-ignore-shortcut '(control))
(mac-add-key-passed-to-system 'shift)
(mac-set-input-method-parameter "com.apple.inputmethod.Kotoeri.Roman" `title "あ")
(mac-set-input-method-parameter "com.apple.inputmethod.Kotoeri.Roman" `cursor-type 'box)
(mac-set-input-method-parameter "com.apple.inputmethod.Kotoeri.Japanese" `cursor-color "red"))
;; start up by Command-Space
(global-set-key [(s \ )] 'toggle-input-method)
;; start up by Shift-Space
(global-set-key [?\S-\ ] 'toggle-input-method)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 6 CocoaEmacs window mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-cocoaemacs
(when window-system
;; if display-height is less than 900, set font size 12pt.
(let* ((size (if (< (display-pixel-height) 900) 12 14))
(asciifont "Menlo")
(jpfont "Hiragino Maru Gothic ProN")
(h (* size 10))
(fontspec (font-spec :family asciifont))
(jp-fontspec (font-spec :family jpfont)))
(set-face-attribute 'default nil :family asciifont :height h)
(set-fontset-font nil 'japanese-jisx0213.2004-1 jp-fontspec)
(set-fontset-font nil 'japanese-jisx0213-2 jp-fontspec)
(set-fontset-font nil 'katakana-jisx0201 jp-fontspec) ; 半角カナ
(set-fontset-font nil '(#x0370 . #x03FF) fontspec) ; ギリシャ文字
)
(setq face-font-rescale-alist
'(("^-apple-hiragino.*" . 1.2)
(".*osaka-bold.*" . 1.2)
(".*osaka-medium.*" . 1.2)
(".*courier-bold-.*-mac-roman" . 1.0)
(".*monaco cy-bold-.*-mac-cyrillic" . 0.9)
(".*monaco-bold-.*-mac-roman" . 0.9)
("-cdac$" . 1.3)))
;;----------------------------------------------------------
;; smart-dnd
(require 'smart-dnd)
;; yahtml-mode:
(add-hook
'yahtml-mode-hook
'(lambda ()
(smart-dnd-setup
'(
("\\.gif\\'" . "<img src=\"%R\">\n")
("\\.jpg\\'" . "<img src=\"%R\">\n")
("\\.png\\'" . "<img src=\"%R\">\n")
("\\.css\\'" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"%R\">\n" )
("\\.js\\'" . "<script type=\"text/javascript\" src=\"%R\"></script>\n" )
(".*" . "<a href=\"%R\">%f</a>\n")))))
;; yatex-mode:
(add-hook
'yatex-mode-hook
'(lambda ()
(smart-dnd-setup
'(
("\\.tex\\'" . "\\input{%r}\n")
("\\.cls\\'" . "\\documentclass{%f}\n")
("\\.sty\\'" . "\\usepackage{%f}\n")
("\\.eps\\'" . "\\includegraphics[clip]{%r}\n")
("\\.ps\\'" . "\\includegraphics[clip]{%r}\n")
("\\.pdf\\'" . "\\includegraphics[clip]{%r}\n")
("\\.jpg\\'" . "\\includegraphics[clip]{%r}\n")
("\\.png\\'" . "\\includegraphics[clip]{%r}\n")
("\\.bst\\'" . "\\bibliographystyle{%n}\n")
("\\.bib\\'" . "\\bibliography{%n}\n")))))
;; C/C++ mode:
(add-hook
'c-mode-common-hook
'(lambda () (smart-dnd-setup '(("\\.h\\'" . "#include <%f>")))))
;;----------------------------------------------------------
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 7 anything else
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-else
;; The number of lines to scroll a window by when point moves out
(setq scroll-step 1)
;; Time Stamp
;; If you put 'Time-stamp: <>' or 'Time-stamp: ""' on
;; top 8 lines of the file, the '<>' or '""' are filled with the date
;; at saving the file.
(require 'time-stamp)
(if (not (memq 'time-stamp write-file-functions))
(setq write-file-functions
(cons 'time-stamp write-file-functions)))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; buffer-file-coding-system: utf-8-unix
;; End:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws-default-yatex.el for MacOS X WorkShop
;; Time-stamp: <2011-03-10 17:13:00 tkoba>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq auto-mode-alist
(cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
;; platex with Skim
(setq tex-command "platex2pdf"
dvi2-command "open -a Skim")
;; pdflatex with Skim
;(setq tex-command "pdflatex -synctex=1"
; dvi2-command "open -a TeXShop")
;; platex with TeXShop
;(setq tex-command "~/Library/TeXShop/bin/platex2pdf-euc"
; dvi2-command "open -a TeXShop")
;; pdflatex with TeXShop
;(setq tex-command "pdflatex"
; dvi2-command "open -a TeXShop")
(setq dviprint-command-format "dvips %s | lpr"
YaTeX-inhibit-prefix-letter t
YaTeX-kanji-code 4 ; (1 JIS, 2 SJIS, 3 EUC, 4 UTF-8)
YaTeX-use-AMS-LaTeX t ; AMS-LaTeX
section-name "documentclass"
makeindex-command "mendex -U"
bibtex-command "jbibtex -kanji=utf8"
YaTeX-skip-default-reader t
YaTeX-latex-message-code 'utf-8
YaTeX-use-font-lock t
)
(add-hook 'skk-mode-hook
(lambda ()
(if (eq major-mode 'yatex-mode)
(progn
(define-key skk-j-mode-map "\\" 'self-insert-command)
(define-key skk-j-mode-map "$" 'YaTeX-insert-dollar)
))
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; yahtml
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq auto-mode-alist
(cons (cons "\\.html$" 'yahtml-mode) auto-mode-alist))
(autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t)
(add-to-list 'auto-mode-alist '("\\.htm\\'" . yahtml-mode))
(setq yahtml-www-browser "open"
yahtml-lint-program "htmllint"
yahtml-kanji-code 4)
(add-hook 'yahtml-mode-hook
'(lambda ()
(auto-fill-mode -1)
))
;;;; <p> </p>
(setq yahtml-always-/p t)
;;;; <li> </li>
(setq yahtml-always-/li t)
;; End:
変更前
現在のOSXWS-10.6(α版)に以下の設定ファイルが反映されました。ホームディ レクトリにあったEmacs関連の設定ファイルは全て /.emacs.d/に移動し、ファイ ル名も以下のように変更されました。
基本的に採用する方向です。詳細やバグなどのご指摘をいただければ幸いで
す。-Tkoba
OSXWSのEmacs は起動時に /usr/osxws/etc/emacs-[EMACSVER]/site-start.d/を読みに行きます。
$ cat /usr/osxws/etc/emacs-[EMACSVER]/site-start.d/20apel-init.el
(require 'path-util)
$ cat /usr/osxws/etc/emacs-[EMACSVER]/site-start.d/51semi-init.el
(require 'mime-setup)
$ cat /usr/osxws/etc/emacs-[EMACSVER]/site-start.d/53aspell-init.el
;; 日本語交じりの文書を扱う
;; http://web.archive.org/web/20011214075400/http://queen.heart.ne.jp/cgi-bin/browse?msgid=%3cyosuu1vq6t93.fsf@jpl.org%3e&ym=200111
;; http://www.matsusaka-u.ac.jp/~okumura/texfaq/qa/3898.html
;;(eval-after-load "ispell"
;; '(add-to-list 'ispell-skip-region-alist '("[^\000-\377]+")))
;; ↑この設定がなくても、日本語交じりの文書をスペルチェックできるようです。-Seto
;; ispell の代わりに aspell を使う
(setq-default ispell-program-name "aspell")
$ cat /usr/osxws/etc/emacs-[EMACSVER]/site-start.d/90emacs-lisps-init.el
;; crontab-mode
(autoload 'crontab-mode "crontab-mode" "Major mode for editing crontabs." t)
(add-to-list 'auto-mode-alist '("\\.cron\\(tab\\)?\\'" . crontab-mode))
;; css-mode
(autoload 'css-mode "css-mode" "Major mode for editing CSS style sheets." t)
(add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
;; htmlize
(autoload 'htmlize-buffer "htmlize" "Convert buffer to html." t)
(autoload 'htmlize-region "htmlize" "Convert region to html." t)
;; php-mode
(autoload 'php-mode "php-mode" "Major mode for editing PHP code." t)
(add-to-list 'auto-mode-alist '("\\.php[s34]?\\'" . php-mode))
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . php-mode))
(add-to-list 'auto-mode-alist '("\\.inc\\'" . php-mode))
;; mac-key-mode
;; (autoload 'mac-key-mode "mac-key-mode" "Mac-style key-binding mode." t)
;; mac-key-mode はCocoaに対応するまで外しています。
;; mac-print-mode
(autoload 'mac-print-mode "mac-print-mode" nil t)
(autoload 'mac-print-buffer "mac-print-mode" nil t)
;; php-mode
(autoload 'php-mode "php-mode" "Major mode for editing PHP code." t)
(add-to-list 'auto-mode-alist '("\\.php[s34]?\\'" . php-mode))
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . php-mode))
(add-to-list 'auto-mode-alist '("\\.inc\\'" . php-mode))
;; smart-dnd
(autoload 'smart-dnd-setup "smart-dnd" "Configurable drag-n-drop feature." t)
;; yaml-mode
(autoload 'yaml-mode "yaml-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
; end
$ cat /usr/osxws/etc/emacs-[EMACSVER]/site-start.d/99osxws.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws.el for MacOS X WorkShop
;; KOBAYASHI Taizo <xxxxxxx@xxxxxxx>
;; Time-stamp:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; setting the MacOS X WorkShop flag
(defconst osxws-emacs-flag t
"This is Emacs of MacOS X WorkShop.")
(setq emacs-build-system
(concat
emacs-build-system
" - MacOS X WorkShop - 10.6 "))
(setq osxws-emacs-version
(progn
(string-match "\\.[0-9]+$" emacs-version)
(substring emacs-version 0 (match-beginning 0))))
(setq osxws-emacslisps-elc-path
(concat "/usr/osxws/share/emacs-"
osxws-emacs-version "/site-lisp/emacs-lisps/"))
(setq osxws-emacslisps-path "/usr/osxws/share/emacs/site-lisp/emacs-lisps/")
(setq report-emacs-bug-address "osxws@xxxxxxxxxxx")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; buffer-file-coding-system: junet-unix
;; End:
http://emacs.g.hatena.ne.jp/sakito/20100216 の方針に従って以下を 追加しました。-Seto
Emacsの初期設定は、 /.emacs、 /.emacs.el、 /emacs.d/init.el の順 で、最初に見つかったファイルを読み込みます。ここではホームディレ クトリに .emacs と .emacs.el がないものと仮定て、 init.el では OSXWS の Emacs かそれ以外かを判定して初期設定ファイルを読み込むよ うにします。Carbon Emacs パッケージなど OSXWS 以外の Emacs 利用す る場合は、 /emacs.d/init_for_other_emacs.el (このファイル名は 1つの例)に設定を書く事が出来ます。M-x customize を使用して設定値 を保存するときに、.emacs が自動で作られないように custom-file を 指定しました。custom_for_other_emacs.el は最初に M-x customize を使用したときにファイルが作成されます。
$ cat ~/.emacs.d/init.el
(cond
((boundp 'osxws-emacs-flag)
;; for Mac OS X WorkShop
(setq user-init-file "~/.emacs.d/init_osxws.el")
(setq custom-file "~/.emacs.d/custom_osxws.el"))
(t
;; for others
(setq user-init-file "~/.emacs.d/init_for_other_emacs.el")
(setq custom-file "~/.emacs.d/custom_for_other_emacs.el"))
)
(if (file-exists-p (expand-file-name user-init-file))
(load-file (expand-file-name user-init-file)))
(if (file-exists-p (expand-file-name user-init-file))
(load-file (expand-file-name custom-file)))
OSXWS 固有の設定をここで読み込みます。また、ユーザーのカスタマイ ズはこのファイルの後半に書き込まれる事を想定し、その設定例(一部 はコメントアウト)が置かれています。
$ cat ~/.emacs.d/init_osxws.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ~/.emacs.d/init_osxws.el
;; .emacs for MacOS X WorkShop
;; Time-stamp: <2008-07-03 18:24:55 tkoba>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq user-init-file "~/.emacs.d/init_osxws.el")
;; Section 0 fundamental configurations
(load-file (concat osxws-emacslisps-path "osxws-sec0.el"))
;; Section 1 language setting
(load-file (concat osxws-emacslisps-path "osxws-sec1.el"))
;; Section 2 appearance setting
(load-file (concat osxws-emacslisps-path "osxws-sec2.el"))
;; Section 3 keyboard/keybindig setting
(load-file (concat osxws-emacslisps-path "osxws-sec3.el"))
;; Section 4 shell-command setting
(load-file (concat osxws-emacslisps-path "osxws-sec4.el"))
;; Section 5 inline-patch setting
(load-file (concat osxws-emacslisps-path "osxws-sec5.el"))
;; Section 6 CarbonEmacs window mode setting
(load-file (concat osxws-emacslisps-path "osxws-sec6.el"))
;; Section 7 anything else setting
(load-file (concat osxws-emacslisps-path "osxws-sec7.el"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Edit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Startup-message
;; Once you are familiar with the contents of the startup screen,
;; you may inhibit the startup screen.
;; YaTeX
(if (file-exists-p "~/.emacs.d/yatex.el")
(load-file "~/.emacs.d/yatex.el"))
;; Mew 6.2 - Messaging in the Emacs World
(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
(if (file-exists-p "~/.emacs.d/mew.el")
(load-file "~/.emacs.d/mew.el"))
;; 起動時にメッセージ画面を表示しない
(setq inhibit-startup-message t)
;; CarbonEmacs window mode setting
(when (eq window-system 'ns)
;; window size
;;(setq default-frame-alist
;; (append
;; '((width . 100) (height . 40) (top . 0) (left . 520))
;; (vertical-scroll-bars . nil)
;; default-frame-alist))
;; Color-thema
(require 'color-theme)
(color-theme-dark-blue2)
;; Transparency3
(add-to-list
'default-frame-alist
'(alpha . (100 80))) ;; (alpha . (<active frame> <non active frame>))
)
;; Command + カーソルキーを OSX 標準の動作にする
;; default : ns-next-frame in ns-win.el
(define-key global-map [s-left] 'move-beginning-of-line)
(define-key global-map [s-right] 'move-end-of-line)
(define-key global-map [s-up] 'backward-page)
(define-key global-map [s-down] 'forward-page)
;;; show the present time on status bar
(when (equal (substring (shell-command-to-string "defaults read -g AppleLocale") 0 2) "ja")
(setq dayname-j-alist
'(("Sun" . "日") ("Mon" . "月") ("Tue" . "火") ("Wed" . "水")
("Thu" . "木") ("Fri" . "金") ("Sat" . "土")))
(setq display-time-string-forms
'((format "%s年%s月%s日(%s) %s:%s %s"
year month day
(cdr (assoc dayname dayname-j-alist))
24-hours minutes
load))))
(display-time)
;; End Edit:
$ cat ~/.emacs.d/custom_osxws.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; customize saves customizations here in Emacs of MacOS X WorkShop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq custom-file "~/.emacs.d/custom_osxws.el")
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec0.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; osxws.el for MacOS X WorkShop ;; Time-stamp: <2010-01-28 12:33:04 tkoba> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Section 0 fundamental configurations ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; path setting (setq exec-path (append (list "/usr/osxws/bin" "~/bin") exec-path)) (setenv "PATH" (concat '"/usr/osxws/bin:~/bin:" (getenv "PATH"))) ;;; save the position before you editing. (require 'saveplace) (setq-default save-place t) (setq save-place-file "~/Library/Application Support/OSXWS/emacs-places.txt") ;; copy foo to foo~ as a backup file (setq backup-by-copying t) ;; deleting files goes to OS's trash folder (setq delete-by-moving-to-trash t) ;;; start emacsclient server (server-start) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; buffer-file-coding-system: junet-unix ;; End:
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec1.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws.el for MacOS X WorkShop
;; Time-stamp: <2010-01-28 12:34:19 tkoba>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 1 language configurations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; japanese settings for Carbon Emacs Package
(when
(equal (substring (shell-command-to-string "defaults read -g AppleLocale") 0 2) "ja")
(set-language-environment 'Japanese)
(prefer-coding-system 'utf-8-unix)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; buffer-file-coding-system: junet-unix
;; End:
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec2.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; osxws.el for MacOS X WorkShop ;; Time-stamp: <2008-10-01 12:09:09 tkoba> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Section 2 appearance setting ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; hide tool-bar (tool-bar-mode 0) ;;; show the corresponding paren (show-paren-mode) ;;; do not font scaling (setq scalable-fonts-allowed nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; buffer-file-coding-system: junet-unix ;; End:
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec3.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; osxws.el for MacOS X WorkShop ;; Time-stamp: <2010-01-28 12:41:44 tkoba> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Section 3 keyboard/keybinding ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; emulation of the standard CUA key bindings (Mac GUI) (cua-selection-mode t) ;;; revert [Home] Key and [End] Key (define-key global-map [home] 'beginning-of-buffer) (define-key global-map [end] 'end-of-buffer) ;; fn + delete でカーソル位置の文字を削除 (define-key global-map [kp-delete] 'delete-char) ;; fix yen key problem on JIS keyboard ;; Ando-san's code (see [Macemacsjp-users 1126]) (define-key global-map [2213] nil) (define-key global-map [67111077] nil) (define-key function-key-map [2213] [?\\]) (define-key function-key-map [67111077] [?\C-\\]) (define-key global-map [3420] nil) (define-key global-map [67112284] nil) (define-key function-key-map [3420] [?\\]) (define-key function-key-map [67112284] [?\C-\\]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; buffer-file-coding-system: junet-unix ;; End:
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec4.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; osxws.el for MacOS X WorkShop ;; Time-stamp: <2008-07-03 18:11:33 tkoba> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Section 4 shell-command ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; hide password (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt) ;;; escape sequence (autoload 'ansi-color-for-comint-mode-on "ansi-color" "Set `ansi-color-for-comint-mode' to t." t) (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; buffer-file-coding-system: junet-unix ;; End:
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec5.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; osxws.el for MacOS X WorkShop ;; Time-stamp: <2008-10-01 12:08:33 tkoba> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Section 5 inline-patch by Hashimoto-san ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (when (eq window-system 'ns) (setq default-input-method "MacOSX") (add-hook 'minibuffer-setup-hook 'mac-change-language-to-us) ;; (mac-add-ignore-shortcut '(control)) (mac-set-input-method-parameter "com.apple.inputmethod.Kotoeri.Roman" `title "あ") (mac-set-input-method-parameter "com.apple.inputmethod.Kotoeri.Roman" `cursor-type 'box) (mac-set-input-method-parameter "com.apple.inputmethod.Kotoeri.Japanese" `cursor-color "red")) ;; start up by Command-Space (global-set-key [(alt \ )] 'toggle-input-method) ;; start up by Shift-Space (global-set-key [?\S-\ ] 'toggle-input-method) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Local Variables: ;; mode: emacs-lisp ;; buffer-file-coding-system: junet-unix ;; End:
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec6.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws.el for MacOS X WorkShop
;; Time-stamp: <2008-07-03 18:17:15 tkoba>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 6 CocoaEmacs window mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when (eq window-system 'ns)
;; if display-height is less than 900, set font size 12pt.
(let* ((fontsize (if (< (display-pixel-height) 900) 12 14))
(hira-fontsize (+ fontsize 2)))
(create-fontset-from-ascii-font
(concat "Menlo-" (number-to-string fontsize) ":weight=normal:slant=normal") nil "menlomarugo")
(set-fontset-font "fontset-menlomarugo"
'unicode
(font-spec :family "Hiragino Maru Gothic ProN" :size hira-fontsize)
nil
'append)
(set-fontset-font "fontset-menlomarugo"
'(#x0080 . #x024F)
(font-spec :family "Menlo")
nil
'prepend)
(add-to-list 'default-frame-alist '(font . "fontset-menlomarugo")))
;;----------------------------------------------------------
;; smart-dnd
(require 'smart-dnd)
;; yahtml-mode:
(add-hook
'yahtml-mode-hook
'(lambda ()
(smart-dnd-setup
'(
("\\.gif\\'" . "<img src=\"%R\">\n")
("\\.jpg\\'" . "<img src=\"%R\">\n")
("\\.png\\'" . "<img src=\"%R\">\n")
("\\.css\\'" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"%R\">\n" )
("\\.js\\'" . "<script type=\"text/javascript\" src=\"%R\"></script>\n" )
(".*" . "<a href=\"%R\">%f</a>\n")))))
;; yatex-mode:
(add-hook
'yatex-mode-hook
'(lambda ()
(smart-dnd-setup
'(
("\\.tex\\'" . "\\input{%r}\n")
("\\.cls\\'" . "\\documentclass{%f}\n")
("\\.sty\\'" . "\\usepackage{%f}\n")
("\\.eps\\'" . "\\includegraphics[clip]{%r}\n")
("\\.ps\\'" . "\\includegraphics[clip]{%r}\n")
("\\.pdf\\'" . "\\includegraphics[clip]{%r}\n")
("\\.jpg\\'" . "\\includegraphics[clip]{%r}\n")
("\\.png\\'" . "\\includegraphics[clip]{%r}\n")
("\\.bst\\'" . "\\bibliographystyle{%n}\n")
("\\.bib\\'" . "\\bibliography{%n}\n")))))
;; C/C++ mode:
(add-hook
'c-mode-common-hook
'(lambda () (smart-dnd-setup '(("\\.h\\'" . "#include <%f>")))))
;;----------------------------------------------------------
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; buffer-file-coding-system: junet-unix
;; End:
http://emacs.g.hatena.ne.jp/sakito/20100127 に従った設定方法に変 更しました。
font の設定は Snow Leopard と Cocoa Emacs の組み合わせを想定しま した。
OSXWS10.6 が Leopard を対象とする場合は、リンク先のように対応する 必要があるかもしれません。 http://d.hatena.ne.jp/setoryohei/20100915
$ cat /usr/osxws/share/emacs/site-lisp/emacs-lisps/osxws-sec7.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws.el for MacOS X WorkShop
;; Time-stamp: <2008-07-03 18:18:18 tkoba>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Section 7 anything else
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The number of lines to scroll a window by when point moves out
(setq scroll-step 1)
;;; Time Stamp
;;; If you put 'Time-stamp: <>' or 'Time-stamp: ""' on
;;; top 8 lines of the file, the '<>' or '""' are filled with the date
;;; at saving the file.
(require 'time-stamp)
(if (not (memq 'time-stamp write-file-functions))
(setq write-file-functions
(cons 'time-stamp write-file-functions)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; buffer-file-coding-system: junet-unix
;; End:
init_osxws.elから読み込まれます。
$ cat ~/.emcas.d/yatex.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ~/.emcas.d/yatex.el for MacOS X WorkShop
;; KOBAYASHI Taizo <xxxxxxxxx@xxxxxx.com>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; yatex の設定
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq auto-mode-alist
(cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
;;; platex と Skim
(setq tex-command "platex2pdf"
dvi2-command "open -a Skim")
;;; pdflatex と Skim
;;(setq tex-command "pdflatex -synctex=1"
;; dvi2-command "open -a Skim")
;;; platex と TeXShop
;;(setq tex-command "~/Library/TeXShop/bin/platex2pdf-euc"
;; dvi2-command "open -a TeXShop")
;;; pdflatex と TeXShop
;;(setq tex-command "pdflatex"
;; dvi2-command "open -a TeXShop")
(setq dviprint-command-format "dvips %s | lpr"
YaTeX-inhibit-prefix-letter t
YaTeX-kanji-code 4 ; (1 JIS, 2 SJIS, 3 EUC, 4 UTF-8)
YaTeX-use-AMS-LaTeX t ; AMS-LaTeX
section-name "documentclass"
makeindex-command "mendex -U"
bibtex-command "jbibtex -kanji=utf8"
YaTeX-skip-default-reader t
YaTeX-latex-message-code 'utf-8
YaTeX-use-font-lock t
)
(add-hook 'skk-mode-hook
(lambda ()
(if (eq major-mode 'yatex-mode)
(progn
(define-key skk-j-mode-map "\\" 'self-insert-command)
(define-key skk-j-mode-map "$" 'YaTeX-insert-dollar)
))
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; yahtml の設定
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq auto-mode-alist
(cons (cons "\\.html$" 'yahtml-mode) auto-mode-alist))
(autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t)
(add-to-list 'auto-mode-alist '("\\.htm\\'" . yahtml-mode))
(setq yahtml-www-browser "open"
yahtml-lint-program "htmllint"
yahtml-kanji-code 4)
(add-hook 'yahtml-mode-hook
'(lambda ()
(auto-fill-mode -1)
))
;;;; 常に<p>をいれたら</p>
(setq yahtml-always-/p t)
;;;; 常に<li>をいれたら</li>
(setq yahtml-always-/li t)
;; End:
YaTeX のMLで議論されていた YaTeX-inhibit-prefix-letter ですが、広 瀬さんが推奨されている t に変更してみました。(慣れるのは大変です が)
Skim と Emacs の連携。
TeXのソースに \usepackage{pdfsync} を書いておき、pdflatex
-synctex=1 でタイプセットすると、Skimからシフト+コマンド+クリッ
クで Emacs の対応箇所にジャンプします。OSXWSだと、emacsclientが
/usr/osxws/bin/以下にあるため、環境設定の Syncのところを以下のよ
うに設定する必要があります。
Preset: Custom Command: /usr/osxws/bin/emacsclient Arguments: --no-wait +%line "%file"
また、Skim.app/Contents/SharedSupport/displayline を使って、 xdvi-search.elのようなものを書けば、エディタのカーソル箇所から対 応する場所のプレビューを表示させることもできるはずですね。
http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=TeX_and_PDF_Synchronization
http://mactex-wiki.tug.org/wiki/index.php?title=SyncTeX#Carbon_Emacs.2FSkim
OSXWS-10.6-x の変更点
;; deleting files goes to OS's trash folder (setq delete-by-moving-to-trash t)
Cocoa Emacs では mac-key-mode なしでも、OSX の標準的なショートカッ トがデフォルトで設定されているみたいです。fn+deleteキーやCommand +カーソルキーの振る舞いなど、標準の動作から抜けている部分を補っ てみました。Command- 右、左については、「ウインドウのフォーカスの 移す」がデフォルトで設定されていましたので、そのカスタマイズとい うことでローカルの osxws.el で設定しました。-Seto
Section 3 への追加
;; fn + delete でカーソル位置の文字を削除 (define-key global-map [kp-delete] 'delete-char)
osxws.el への追加
;; default : ns-next-frame in ns-win.el (define-key global-map [s-left] 'move-beginning-of-line) ;; default : ns-prev-frame in ns-win.el (define-key global-map [s-right] 'move-end-of-line) (define-key global-map [s-up] 'backward-page) (define-key global-map [s-down] 'forward-page)
osxws-emacs-version と osxws-emacslisps-path を 99osxws.el で設定 しました。 init_osxws.el で設定を読み込む時に使います。
既にコメントアウトされている設定を試しに取り除いてみました。-Seto
Sec0
;(set-clipboard-coding-system 'utf-8) ;(set-terminal-coding-system 'utf-8) ; 'euc-jp-unix) ;(set-language-environment 'Japanese) ;(set-default-coding-systems 'utf-8) ;(set-keyboard-coding-system 'utf-8) ; (if window-system 'sjis-mac 'utf-8)) ;(load "menu-tree")
Sec2
;(require 'paren) ;;; colorizing mark region ;; (setq transient-mark-mode t) ;;; show line number ;; (line-number-mode t)
Sec3
;; (setq ns-control-modifier 'control) ;; (setq ns-option-modifier 'meta) ;; C. fix: Unicode => Japanese mapping ;; Thanks to saiki-san (see [macemacsjp-users 870]) ;; register circle around digits to cjk table (by Ando-san) ;(defadvice utf-translate-cjk-load-tables ; (after my-ad-circled-digit activate) ; (dotimes (i 20) ; (let ((unicode (+ #x2460 i)) ; (char (+ 54433 i))) ; (if (utf-translate-cjk-substitutable-p unicode) ; (puthash unicode char ucs-unicode-to-mule-cjk)) ; (puthash char unicode ucs-mule-cjk-to-unicode)))) ;; prevent to use half-width marks (by Nanba-san) ;(utf-translate-cjk-set-unicode-range ; '((#x2e80 . #xd7a3) ; (#xff00 . #xffef) ; (#xa7 . #xa7) ; ; (#xb0 . #xb1) ; ; (#xb4 . #xb4) ; ; (#xb6 . #xb6) ; ; (#xd7 . #xd7) ; ; (#xf7 . #xf7) ; ; (#x370 . #x3ff) ; Greek ; (#x400 . #x4ff) ; Cyrillic ; (#x2000 . #x206f) ; punctuation mark ; (#x2103 . #x2103) ; centigrade degree ; (#x212b . #x212b) ; angstrom ; (#x2190 . #x21ff) ; Arrow ; (#x2200 . #x22ff) ; mathematical symbol ; (#x2300 . #x23ff) ; engineering symbol ; (#x2460 . #x2473) ; number in circle ; (#x2500 . #x257f) ; ruled line ; (#x25a0 . #x25ff) ; mosaic fragment ; (#x2600 . #x26ff) ; other symbol ; )) ;; C. end
Sec6
;; Transparency3 ;; (setq frame-alpha-lower-limit 20) ;; anti alias (drag and drop) ;; (setq ns-antialias-text t)
Sec7
;; No adding newline at end of buffer ;; (setq next-line-add-newlines nil)
YaTeX と Mew の設定は /.emacs.d/osxws.el に移動しました。
;;; YaTeX
(if (file-exists-p "~/.yatex.el")
(load-file "~/.yatex.el"))
;; Mew 6.2 - Messaging in the Emacs World
(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
(if (file-exists-p "~/.mew.el")
(load-file "~/.mew.el"))
display-time のフォーマットの設定を /.emacs.d/osxws.el に移動し ました。設定されたフォーマットを、後から読まれる.emacs.d/osxws.el などで再設定することは簡単ですが、Emacsのデフォルトのフォーマット に戻す方法が簡単でないため、このようなカスタマイズはユーザーが編 集可能なところに置くべきと判断しました。-Seto
;;; show the present time on status bar
(when (equal (substring (shell-command-to-string "defaults read -g AppleLocale") 0 2) "ja")
(setq dayname-j-alist
'(("Sun" . "日") ("Mon" . "月") ("Tue" . "火") ("Wed" . "水")
("Thu" . "木") ("Fri" . "金") ("Sat" . "土")))
(setq display-time-string-forms
'((format "%s年%s月%s日(%s) %s:%s %s"
year month day
(cdr (assoc dayname dayname-j-alist))
24-hours minutes
load))))
(display-time)
sec3 から以下を取り除きました。ns-command-modifier はデフォルトの 'super のままにしておくと、Cocoa Emacs のデフォルトで OSX の基本 的なショートカットが使えるみたいです。また、銭谷さんに確認したと ころ、mac-key-mode は現在のところCarbon Emacs専用とのことでした。
;;; use "command" keys as alt (setq ns-command-modifier 'alt) ;;; mac-key-mode ;; (short cut of OSX applications) (when (or (eq window-system 'mac) (eq window-system 'ns)) (require 'mac-key-mode) (mac-key-mode 1))
コメント
$ sudo apt-get remove aspell した後に、
$ sudo apt-get install [抜けたパッケージ]
してください。-Tkoba