OSXWS-10.7-1 の変更点
OSXWS-10.7-1 の emacs 設定ファイル
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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.7 "))
(setq report-emacs-bug-address "osxws@xxxxxxxxxxxx")
(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: junet-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:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; 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)
;;(setq trash-directory "~/.Trash")
;;; start emacsclient server
(require 'server)
(unless (server-running-p) (server-start))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Section 1 language configurations (for Japanese)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-language_japanese
;;; japanese settings for Cocoa Emacs
(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)))
;;; revert [Home] Key and [End] Key
(define-key global-map [home] 'beginning-of-buffer)
(define-key global-map [end] 'end-of-buffer)
;;; 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
;;;; Font setting
;;; 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) ; half-width KaTaKaNa
(set-fontset-font nil '(#x0080 . #x024F) fontspec) ; Accented Latin
(set-fontset-font nil '(#x0370 . #x03FF) fontspec) ; Greek
)
(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)))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Mew 6.3 - Messaging in the Emacs World
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when osxws-default-mew
(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"))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Local Variables:
;; mode: emacs-lisp
;; buffer-file-coding-system: utf-8-unix
;; End:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; osxws-default-yatex.el for MacOS X WorkShop
;; Time-stamp:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
;; use \C-c \C- instead of \C-c [yatex:04567]
(unless (boundp 'YaTeX-inhibit-prefix-letter)
(setq YaTeX-inhibit-prefix-letter t))
;; use our own scripts for typesetting
(setq YaTeX-typeset-auto-rerun nil)
(setq auto-mode-alist
(append
'(("\\.\\(tex\\|sty\\|cls\\|fd\\|ind\\|idx\\|ltx\\|clo\\|bbl\\)$" .
yatex-mode)) auto-mode-alist))
(setq YaTeX-kanji-code nil ; (1 JIS, 2 SJIS, 3 EUC, 4 UTF-8)
YaTeX-latex-message-code 'utf-8
YaTeX-use-LaTeX2e t ; AMS-LaTeX
YaTeX-use-AMS-LaTeX t ; AMS-LaTeX
YaTeX-use-font-lock t
YaTeX-skip-default-reader t
tex-command "latex2pdf"
dvi2-command "open -a Skim"
makeindex-command "makeindex2pdf"
bibtex-command "bibtex2pdf"
dviprint-command-format "pdvips %s | lpr"
)
(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)
))
))
;;; Indent
;;; http://www.hit.ac.jp/~wachi/misc/latexindent.html
(autoload 'latex-indent-command "latex-indent"
"Indent current line accroding to LaTeX block structure.")
(autoload 'latex-indent-region-command "latex-indent"
"Indent each line in the region according to LaTeX block structure.")
;;;; Skim PDF indicating cursor
;;; pdflatex/platex -synctex=1
;;; switch from Emacs to Skim: C-c s
(defun skim-forward-search ()
(interactive)
(let* ((ctf (buffer-name))
(mtf)
(pf)
(ln (format "%d" (line-number-at-pos)))
(cmd "/Applications/OSXWS/Skim.app/Contents/SharedSupport/displayline")
(args))
(if (YaTeX-main-file-p)
(setq mtf (buffer-name))
(progn
(if (equal YaTeX-parent-file nil)
(save-excursion
(YaTeX-visit-main t)))
(setq mtf YaTeX-parent-file)))
(setq pf (concat (car (split-string mtf "\\.")) ".pdf"))
(setq args (concat ln " " pf " " ctf))
(message args)
(process-kill-without-query
(start-process-shell-command "displayline" nil cmd args))))
;;; YaTeX key bindings
(add-hook 'yatex-mode-hook
'(lambda ()
(require 'yatexprc)
(turn-off-auto-fill) ; no auto fill
(define-key YaTeX-mode-map [?\s-t] 'YaTeX-typeset-buffer)
(define-key YaTeX-mode-map [?\s-b] 'YaTeX-typeset-buffer)
(define-key YaTeX-mode-map [?\s-P] 'YaTeX-preview)
(define-key YaTeX-mode-map [?\s-R] 'skim-forward-search)
(define-key YaTeX-mode-map (kbd "C-c s") 'skim-forward-search)
(define-key YaTeX-mode-map [?\s-B]
(lambda () (interactive)
(YaTeX-call-builtin-on-file "BIBTEX" bibtex-command)))
(define-key YaTeX-mode-map [?\s-I]
(lambda () (interactive)
(YaTeX-call-builtin-on-file "MAKEINDEX" makeindex-command)))
(define-key YaTeX-mode-map "\t" 'latex-indent-command)
(define-key YaTeX-mode-map (kbd "C-c TAB") 'latex-indent-region-command)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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:
コメント