;;; -*- Emacs-Lisp -*- ;;; -*- coding: iso-2022-jp -*- ;;; ;;; Emacs/Mule の設定ファイル ;;; ;;; written by Masahito Ohtsuka ;;; Lastupdate: Sat Jun 10 22:49:40 2000. ;;; $Id: .emacs.el,v 1.2 2000/05/29 12:03:03 negi Exp negi $ ;;; デバッグ (setq debag-on-error t) ;;; メールアドレス (setq user-mail-address "negi@KU3G.org") (setq user-full-name "Masahito Ohtsuka") ;;; linux-version という変数に version 名を入れる (let ((buffer (get-buffer-create " *temp*"))) (set-buffer buffer) (progn (call-process "uname" nil t nil "-r") (setq linux-version (buffer-substring (point-min) (- (point-max) 1))) (kill-buffer buffer))) ;;; よく使うので明示的にロードしておく ;(require 'cl) ;(load-library "cl-macs") ;;; .save.. ってなファイルを作らない (setq auto-save-list-file-name nil) (setq auto-save-list-file-prefix nil) ;;; FLIM / SEMI / MULE のバージョンが漢字表示になる (setq rail-emulate-genjis t) (require 'rail) ;;; Emacs/W3 Configuration ;(add-path "~/lib/elisp/20/w3") (condition-case () (require 'w3-auto "w3-auto") (error nil)) (setq w3-honor-stylesheets nil w3-default-homepage "http://clotho/~negi/" w3-user-colors-take-precedence t ; back やらを無視 w3-right-margin 8 ; url-automatic-caching t ; url-standalone-mode t url-be-asynchronous t) ;;; MIME 関係 (load "mime-setup") (setq mime-setup-use-signature nil) ; signature は Gnus のものを使う ;;; load-path の追加 (add-path "~/lib/elisp/20") ;;; info-path の追加 (setq Info-default-directory-list (append '("/home/negi/lib/info/" "/home/negi/src/cvs/t-gnus/" "/usr/info" "/usr/lib/emacs") Info-default-directory-list)) ;;; emacsclient を使う ;(require 'gnuserv) ;(gnuserv-start) ;;; BBDB (setq mime-bbdb/use-mail-extr nil) (eval-after-load "mail-extr" '(require 'mime-bbdb)) (require 'bbdb) (bbdb-initialize 'message 'gnus) (setq gnus-bbdb/decode-field-body-function (function (lambda (field-body field-name) (eword-decode-string field-body)))) (setq bbdb-north-american-phone-numbers-p nil bbdb-use-pop-up nil bbdb-offer-save nil bbdb-pop-up-target-lines 3 bbdb/mail-auto-create-p nil bbdb/news-auto-create-p nil ; bbdb-quiet-about-name-mismatches t bbdb-use-alternate-names t bbdb-always-add-addresses t bbdb-new-nets-always-primary t bbdb-canonicalize-redundant-nets-p nil bbdb-pop-up-elided-display '(creation-date timestamp) bbdb-user-mail-names "negi\\|neko" ) (or window-system (setq bbdb-use-pop-up nil)) ;; 標準以外に収集するヘッダー・フィールド (setq bbdb-auto-notes-alist '(("X-Mailer" ("\\(xcite[^>]+> \\|\\)\\(.*\\)" mua 2)) ("User-Agent" ("\\(xcite[^>]+> \\|\\)\\(.*\\)" mua 2)) ("X-Newsreader" ("\\(xcite[^>]+> \\|\\)\\(.*\\)" mua 2)) ("X-Emacs" (".*" emacs 0)) ("X-Url" (".*" www 0)) ("X-Uri" (".*" www 0)) ("To" ("negi@" ml "direct")) ("X-Ml-Name" (".*" ml 0)) ("reply-to" ("^\\([^@]+\\)@" ml 1)))) ;; 登録済の人の、標準以外に収集するヘッダー・フィールドは自動的に ;; 収集するようになります。 ;(add-hook 'bbdb-notice-hook 'bbdb-auto-notes-hook) (setq bbdb-notice-hook 'bbdb-auto-notes-hook) (setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-20,20uB%]%) %s\n") (setq bbdb/gnus-summary-prefer-bbdb-data t) (setq bbdb/gnus-summary-prefer-real-names t) (setq bbdb/gnus-summary-known-poster-mark nil) ;; X-Face も収集 (setq bbdb-auto-notes-alist (append bbdb-auto-notes-alist (list (list "x-face" (list (concat "[ \t\n]*\\([^ \t\n]*\\)" "\\([ \t\n]+\\([^ \t\n]+\\)\\)?" "\\([ \t\n]+\\([^ \t\n]+\\)\\)?" "\\([ \t\n]+\\([^ \t\n]+\\)\\)?" "\\([ \t\n]+\\([^ \t\n]+\\)\\)?" ) 'face "\\1\\3\\5\\7\\9"))))) ;;; washing BBDB ;; (add-hook 'bbdb-mode-hook (lambda () (local-set-key "w" 'bbdb-wash-field-mua))) ;; (defun bbdb-wash-field-mua () "Wash mua field." (interactive) (let ((mua (bbdb-record-getprop (bbdb-current-record) 'mua)) key p (record (bbdb-current-record t))) (with-temp-buffer (insert mua) (goto-char (point-min)) (while (re-search-forward "\\([.b]\\)\\([0-9] \\)" nil t) (replace-match "\\10\\2")) (sort-lines t (point-min) (point-max)) (while (re-search-forward "\\([.b]\\)0\\([0-9] \\)" nil t) (replace-match "\\1\\2")) (goto-char (point-min)) (while (re-search-forward "^\\([^- /]+\\)[- /]" nil t) (forward-line) (setq p (point) key (buffer-substring (match-beginning 1) (match-end 1))) (while (looking-at key) (forward-line) (delete-region p (point)))) (goto-char (- (point-max) 1)) (and (looking-at "\n") (delete-char 1)) (bbdb-record-putprop record 'mua (buffer-substring (point-min) (point-max)))) (bbdb-redisplay-one-record record))) ;;; 引用パッケージ mu-cite の設定 (autoload 'mu-cite-original "mu-cite" nil t) (setq message-cite-function 'mu-cite-original) (add-hook 'mail-citation-hook (function mu-cite-original)) (setq cited-prefix-regexp "^[^ \t>]*[>]*[ \t##]*[:||]?[ \t##]?") ;; Gnus のグループパラメータで設定する為の伏線 (setq mu-cite-my-top "おおつかです") (setq mu-cite-instantiation-hook '(lambda () (insert (concat mu-cite-my-top "\n\n")))) ;; message の Alt + RET は SuperCite 専用のようなので胡麻化す (defun sc-cite-regexp () cited-prefix-regexp) (setq mu-cite-top-format '(">>>>> " id " において\n" ">>>>> “" prefix-register-verbose "”= " from " 様曰く\n\n")) ;;; latex-math-symbol (autoload 'latex-math-decode-buffer "latex-math-symbol" nil t) (add-hook 'mime-viewer/plain-text-preview-hook 'latex-math-decode-buffer) ;;; インデントを綺麗に (autoload 'gin-mode "gin-mode" "Guess INdent mode" t) (setq gin-left-hang-indent-re "\\s *\\([-*]\\|(\\([a-zA-Z0-9]\\|\\cj\\))\\|(\\([a-zA-Z0-9]|\\cj\\))\\.?:]?\\)\\s +" ) (setq gin-retain-indent-re "\\([-.a-zA-Z0-9]\\|\\cj\\)*>+[ \t]*\\|[ \t]+" ) (add-hook 'message-mode-hook '(lambda () (set-buffer-file-coding-system 'junet-unix) (gin-mode 1) )) ;;; hilit19 (さすがにもう使わないよなぁ) ;(if window-system ; (progn ; (setq hilit-mode-enable-list ; '(yatex-mode yahtml-mode) ; hilit-background-mode 'dark) ; 暗い画面の設定 ; hilit-inhibit-hooks nil ; hilit-inhibit-rebinding nil) ; (set-face-foreground 'highlight "black") ; (set-face-foreground 'secondary-selection "black") ; (require 'hilit19) ; (hilit-translate msg-quote 'green) ; (hilit-translate msg-from 'magenta) ; )) ;;; フレームその他 (if window-system (progn (set-face-foreground 'region "white") (set-face-background 'region "dim gray") (set-face-foreground 'modeline "yellow") (set-face-background 'modeline "blue") (setq default-frame-alist (append '((width . 80) (height . 30) ; (font . "fontset-16") ) default-frame-alist)) )) ;;; 漢字コード (set-language-environment "Japanese") (set-default-coding-systems 'japanese-iso-8bit-with-esc) ;(set-default-coding-systems 'euc-japan) (set-keyboard-coding-system 'euc-japan-1990-unix) (set-terminal-coding-system 'euc-japan-1990-unix) (setq default-buffer-file-coding-system 'euc-japan-1990-unix) ; (setq process-coding-system-alist ; (append ; '(("look" . euc-japan) ; ("nkf" . junet) ; ("kingtr" . sjis) ; ("*.tex$" . euc-japan)) ; process-coding-system-alist)) ;(modify-coding-system-alist 'file "\\.txt\\'" 'sjis-dos) ;;; 圧縮ファイルを読む (auto-compression-mode 1) ;;; Abbrev (setq-default abbrev-mode t) (read-abbrev-file "~/.abbrev_defs") (setq save-abbrebs t) ;; タイトルバーの設定 (setq frame-title-format "Emacs:%b") ;; バックアップは作らない ;(setq make-backup-files nil) ;; コンパイル画面はあんまりとらない ;(setq compilation-window-height 5) ;; カーソル位置に貼り付け (setq mouse-yank-at-point t) ;; 行数と桁を表示( Emacs-19.30 以降は多分必要ない) (line-number-mode 1) ;; C-k で, 改行も同時に削除 ;(setq kill-whole-line t) ;; メジャーモード ;(setq default-major-mode 'text-mode) ;; 引用マークは > (setq mail-yank-prefix ">") ;; プリンタの設定 (setq lpr-command "lpr" lpr-page-header-program "pr" lpr-page-header-switches '("-f" "-o 6" "-w 80" "-l 70") ps-lpr-command "lpr" ps-lpr-switches '("-Pps") ps-paper-type 'ps-a4 ps-print-header nil) ;; リージョンを色付きで ;(setq transient-mark-mode t) ;; 常にフォントロックモード (if window-system (global-font-lock-mode t)) ;; ビジブルベル ;(setq visible-bell t) ;;; ガーベージコレクションを減らす (setq gc-cons-threshold 1000000) ;;; dired-x を使う (require 'dired-x) ;;; 以前セーブしたファイルのカーソル位置を記録 (require 'saveplace) (setq-default save-place t) ;;; 横スクロールさせる ;(hscroll-global-mode) ;;; 対応する括弧を目立たせる (require 'paren) ;;; ジャンプスクロールの幅 ;(setq scroll-step 4) ;;; スクロールバーは右側に (set-scroll-bar-mode 'right) ;;; キーバインドの設定 (global-set-key "\C-x?" 'help-for-help) (global-set-key "\C-h" 'backward-delete-char) (global-set-key "\C-\\" 'advertised-undo) (global-set-key "\M-g" 'goto-line) ;(global-set-key "\C-m" 'newline-and-indent) ;(global-set-key "\C-x\C-c" 'server-edit) (global-set-key "\M- " 'expand-abbrev) ;(global-set-key [f10] 'save-buffers-kill-emacs) (global-set-key [S-right] 'forward-word) (global-set-key [S-left] 'backward-word) (global-set-key [delete] 'delete-char) (global-set-key [S-mouse-2] 'browse-url-at-mouse) (global-set-key [kanji] 'canna-henkan-region) (global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag) ;(global-set-key [f11] ; (lambda () (interactive) (insert (current-time-string)))) (global-set-key [f11] 'call-last-kbd-macro) (global-set-key [f12] 'next-error) ;(define-key fence-mode-map "\C-h" 'fence-backward-delete-char) ;(define-key henkan-mode-map "\C-h" 'henkan-quit) (or window-system (progn (global-set-key [kp-7] 'beginning-of-buffer) (global-set-key [kp-1] 'end-of-buffer))) (global-set-key "\C-cg" 'gnus) ;;; windows.el (require 'windows) (win:startup-with-window) (if window-system (setq win:use-frame nil)) ; フレームは使わない (setq win:switch-prefix "\C-l") (define-key global-map win:switch-prefix nil) (define-key global-map "\C-l1" 'win-switch-to-window) (define-key global-map "\C-l2" 'win-switch-to-window) (define-key global-map "\C-l3" 'win-switch-to-window) (define-key global-map "\C-l4" 'win-switch-to-window) (define-key global-map "\C-l5" 'win-switch-to-window) (define-key global-map "\C-l6" 'win-switch-to-window) (define-key global-map "\C-l7" 'win-switch-to-window) (define-key global-map "\C-l8" 'win-switch-to-window) (define-key global-map "\C-l9" 'win-switch-to-window) (define-key global-map "\C-l\C-l" 'recenter) ;(define-key ctl-x-map "C" 'see-you-again) ;(setq win:mouse-position (-5 -5)) ;(autoload 'win-switch-to-window "windows" "Switch window." t) ;(define-key global-map "\C-c\C-w1" 'win-switch-to-window) ;(define-key global-map "\C-c1" 'win-switch-to-window) ;(define-key ctl-x-map "C" 'see-you-again) ;;; Canna ;(setq canna-with-fences ; (not (setq canna-underline t))) ;(load-library "canna") ;(canna) ;;; egg ;(setq enable-double-n-syntax t) ;(set-egg-fence-mode-format "" "" 'underline) ;; SKK (setq skk-byte-compile-init-file nil) (setq skk-background-mode 'dark) (global-set-key "\C-x\C-j" 'skk-mode) (global-set-key [henkan] 'skk-mode) (global-set-key "\C-xj" 'skk-auto-fill-mode) (global-set-key "\C-xt" 'king::translation-region) (autoload 'skk-mode "skk" nil t) (autoload 'skk-tutorial "skk-tut" nil t) (autoload 'skk-check-jisyo "skk-tools" nil t) (autoload 'skk-merge "skk-tools" nil t) (autoload 'skk-diff "skk-tools" nil t) (autoload 'skk-isearch-mode-setup "skk-isearch" nil t) (autoload 'skk-isearch-mode-cleanup "skk-isearch" nil t) (add-hook 'isearch-mode-hook (function (lambda () (and (boundp 'skk-mode) skk-mode (skk-isearch-mode-setup))))) (add-hook 'isearch-mode-end-hook (function (lambda () (and (boundp 'skk-mode) skk-mode (skk-isearch-mode-cleanup))))) (add-hook 'minibuffer-setup-hook (function (lambda () (if (and (boundp 'skk-henkan-okuri-strictly) skk-henkan-okuri-strictly (not (eq last-command 'skk-purge-jisyo)) ) (progn (setq skk-henkan-okuri-strictly nil) (put 'skk-henkan-okuri-strictly 'temporary-nil t) ))))) (add-hook 'minibuffer-exit-hook (function (lambda () (if (get 'skk-henkan-okuri-strictly 'temporary-nil) (progn (put 'skk-henkan-okuri-strictly 'temporary-nil nil) (setq skk-henkan-okuri-strictly t) ))))) ;(setq skk-large-jisyo "/usr/local/share/skk/SKK-JISYO.L") ;(skk-mode 1) ;;; モードリスト (setq auto-mode-alist (append '(("\\.tex$" . yatex-mode) ("\\.sty$" . yatex-mode) ("\\.C$" . c++-mode) ("\\.cc$" . c++-mode) ("\\.c$" . c-mode) ("\\.cgi$" . cperl-mode) ("\\.pl$" . cperl-mode) ("\\.pm$" . cperl-mode) ("\\.h$" . c-mode) ("\\.m$" . objc-mode) ("\\.java$" . java-mode) ("\\.html$" . sgml-mode) ("\\.htm$" . sgml-mode) ("\\.shtml$" . sgml-mode) ("\\.spec$" . sh-mode) ("\\.rb$" . ruby-mode) ("/home/negi/memo/" . text-mode)) auto-mode-alist )) ;;; c-mode (autoload 'c++-mode "cc-mode" "C++ Editing Mode" t) (autoload 'c-mode "cc-mode" "C Editing Mode" t) (autoload 'objc-mode "cc-mode" "Objective-C Editing Mode" t) (autoload 'java-mode "cc-mode" "Java Editing Mode" t) (setq c-tab-always-indent t) (setq c-default-style "bsd") (setq c-block-comments-indent-p 3) (add-hook 'c-mode-hook '(lambda () (turn-on-auto-fill) (local-set-key "\C-c\C-c" 'compile) (local-set-key "\C-c\C-d" 'gdb) )) ;;; Text-mode (add-hook 'text-mode-hook '(lambda () (turn-on-auto-fill) (make-local-variable 'paragraph-start) (make-local-variable 'paragraph-separate) (make-local-variable 'fill-column) (make-local-variable 'tab-stop-list) (setq paragraph-start "[  \t\n]\\|\f") (setq paragraph-separate "[  \t]*$\\|\f") (setq fill-column 64 tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80)) (add-hook 'local-write-file-hooks '(lambda () (if (string-match "\\.txt?$" (buffer-name)) (set-buffer-file-coding-system 'sjis-dos)) ;; *.txt は DOS 型式で保存 (trim-eob) (trim-buffer))))) ;;; YaTeX/YaHTML (autoload 'yatex-mode "yatex" "Yet Another TeX mode" t) (modify-coding-system-alist 'process ".*tex$" 'euc-japan) ;; YaTeX でも font-lock したい (add-hook 'yatex-mode-hook '(lambda () (make-local-variable 'font-lock-defaults) (setq font-lock-defaults'(YaTeX-font-lock-keywords nil)) )) (if window-system (setq YaTeX-font-lock-keywords (append '(("%.*" . font-lock-comment-face) ("[^\\$]\\($\\($[^$]*\\$\\|[^$]*\\)\\$\\)" 1 font-lock-string-face) ("\\\\\\(sub\\)*item\\b\\(\\[[^]]*\\]\\)?" . font-lock-type-face) ("\\\\caption\\(\\[[^]]*\\]\\)?\\>" . font-lock-variable-name-face) ("\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\)\\>" . font-lock-variable-name-face)) tex-font-lock-keywords-2))) ;; YaTeX いろいろ設定 (setq YaTeX-kanji-code 3 ; EUC japan YaTeX-create-file-prefix-g t YaTeX-template-file "~/lib/template/template.tex" tex-command "platex" dvi2-command "xdvi -s 4 -paper a4" dviprint-command-format "dvips %f %t %s | lpr" dviprint-from-format "-p %b" dviprint-to-format "-l %e") ;;; trr (autoload 'trr "trr" nil t) ;(setq TRR:correct-color-name "cyan") ;(setq TRR:graph-color-name "yellow") ;;; seimei (autoload 'seimei "seimei" nil t) ;;; FVWM-mode (autoload 'fvwm-mode "fvwm-mode" nil t) (add-hook 'fvwm-mode-hook (lambda () (local-set-key "\t" 'indent-relative))) ;;; browse-url (autoload 'browse-url-interactive-arg "browse-url") (autoload 'browse-url-browser-function "browse-url" "Ask a WWW browser to show a URL." t) (autoload 'browse-url-at-point "browse-url" "Ask a WWW browser to load the URL at or before point." t) (autoload 'browse-url-at-mouse "browse-url" "Ask a WWW browser to load a URL clicked with the mouse." t) (autoload 'browse-url-of-buffer "browse-url" "Ask a WWW browser to display BUFFER." t) (autoload 'browse-url-of-file "browse-url" "Ask a WWW browser to display FILE." t) (autoload 'browse-url-of-dired-file "browse-url" "In Dired, ask a WWW browser to display the file named on this line." t) (setq browse-url-browser-function 'browse-url-netscape) ; (setq browse-url-browser-function 'browse-url-w3) (setq browse-url-new-window-p t) ;;; GNUPLOT-mode (autoload 'gnu-plot-mode "gnuplot" nil t) ;;; sdic (autoload 'sdic "sdic" "英単語の意味を調べる" t nil) (global-set-key "\C-xw" 'sdic) (setq sdic-face-color "khaki") (setq sdic-eiwa-dictionary-list '((sdicf-client "/usr/dict/eijirou.sdic" (strategy array)))) ;;; irchat (require 'cfirchat) (setq cfirchat-bell-keyword '("ねぎ" "ネギ" "おおつか" "大塚" "NegI" "NegI")) (autoload 'irchat "irchat" "GNUemacs IRC client." t) (setq irchat-pj-use-smiley nil) (add-hook 'irchat-Command-mode-hook '(lambda () (font-lock-mode 0))) (setq cfirchat-keywords-default '( ;; mymsg ((aquamarine) (cfirchat-mymsg-regexp)) ;; system ((pink italic) ("^[0-9][0-9]:[0-9][0-9] \\([^><(= \t\n].*\\)$" 1)) ;; system-mode ((pink bold) ("^[0-9][0-9]:[0-9][0-9] New mode for [%#]\\S + set by \\S +: \\(.*\\)$" 1) ("^[0-9][0-9]:[0-9][0-9] New topic on [%#]\\S + set by \\S +: \\(.*\\)$" 1) ("^[0-9][0-9]:[0-9][0-9] Topic for [%#]\\S +\\( ([0-9]+ users)\\)?: \\(.*\\)$" 2)) ;; server message ((white italic) ("^[0-9][0-9]:[0-9][0-9] \\(\\*\\*\\* .*\\)$" 1)) ;; priv ((yellow) ("^[0-9][0-9]:[0-9][0-9] \\(=[^= \t\n]+=\\)" 1)) ;; URL ((HotPink bold underline) (cfirchat-url-regexp)) ;; time ((SlateBlue1) ("^\\([0-9][0-9]:[0-9][0-9]\\) " 1)) ;; NegI ((red bold invert underline) ("ねぎ") ("ネギ") ("大塚") ("おおつか") ("<[^>< \t\n]+>.*\\(negi[0-9A-Za-z-_]*\\)" 1)) ;; nick ((pink) ("^[0-9][0-9]:[0-9][0-9] \\(<[^>< \t\n]+>\\) " 1) ("^[0-9][0-9]:[0-9][0-9] \\(([^)( \t\n]+)\\) " 1)) )) ;;; TiMidyty (autoload 'timidity "timidity" "TiMidity Interface" t) (setq timidity-prog-path "/usr/local/bin/timidity") ;; 書き込む時のフック (add-hook 'write-file-hooks (lambda () ;; (trim-eob) ;; (trim-buffer) (lastupdate-file))) ;;; 色々関数 (defun trim-region (start end) "リージョン中の行末の無駄な空白を消去" (interactive "r") (save-excursion (save-restriction (narrow-to-region start end) (goto-char start) (replace-regexp "[ \t]+$" "") ))) (defun trim-eob nil "バッファの最後に溜った空行を消去" (interactive) (save-excursion (progn (goto-char (point-max)) (delete-blank-lines) nil))) (defun trim-buffer nil "バッファ中の行末の無駄な空白を消去" (interactive) (save-excursion (mark-whole-buffer) (trim-region (region-beginning) (region-end)) )) (defun lastupdate-file nil "Lastupdate: という文字列を見付けると新しい日付を挿入する" (interactive) (let ((tostr (concat "Lastupdate: " (current-time-string) "."))) (save-excursion (goto-char (point-min)) (while (re-search-forward "\\Lastupdate\\([A-Za-z0-9: ]*\\)?\\." nil t) (replace-match tostr nil t))) )) ;;; スクリプトの場合,実行属性を付ける (defun add-executable-attribute () (save-restriction (widen) (and (string= "#!" (buffer-substring 1 (min 3 (point-max)))) (let* ((name (buffer-file-name)) (mode (file-modes name))) (if (not (string-match "/\\.[^/]+$" name)) (progn (set-file-modes name (logior mode (logand (/ mode 4) 73))) (message (concat "Wrote " name " (+x)")))) )))) (mapcar '(lambda (mode-list) (add-hook mode-list '(lambda () (make-local-hook 'after-save-hook) (add-hook 'after-save-hook 'add-executable-attribute nil t)))) '(sh-mode-hook perl-mode-hook cperl-mode-hook awk-mode-hook)) (add-hook 'perl-mode-hook '(lambda () (require 'perlplus) (define-key perl-mode-map "\M-\t" 'perlplus-complete-symbol) (define-key perl-mode-map "\C-c>" 'comment-region) (perlplus-setup))) (defun my-list-buffer (&optional files-only) "my buffer listing in my way" (interactive (list (if current-prefix-arg t nil))) (let ((buffer (list-buffers-noselect files-only))) (switch-to-buffer buffer))) (global-set-key "\C-x\C-b" 'my-list-buffer) ;;; x-face (autoload 'x-face-encode "x-face" "Generate X-Face string(s) from xbm file." t) (autoload 'x-face-insert "x-face" "Insert X-Face fields." t) (autoload 'x-face-save "x-face" "Save X-Face fields to files." t) (autoload 'x-face-view "x-face" "View X-Face fields." t) (autoload 'x-face-ascii-view "x-face" "View X-Face fields as ascii pictures." t) ;;; x-face-mule (require 'x-face-mule) (setq x-face-mule-highlight-x-face-position 'from x-face-mule-force-save-cache-file t x-face-default-xbm-file "negi.xbm" x-face-insert-interactive nil x-face-image-file-directory "~/lib/x-faces") ;;; find-func - 関数のソースを表示 ;; C-xF で起動 (find-function-setup-keys) ;;; eqn2eps TeX の数式から EPS ファイルを生成 (autoload 'eqn2eps "eqn2eps" "equation to eps" t) (autoload 'eqn2eps-region "eqn2eps" "equation to eps" t) ;(setq eqn2eps-mag "2000") ;;; auto-insert (require 'autoinsert) (add-hook 'find-file-hooks 'auto-insert) (setq auto-insert-directory "~/lib/template/") (setq auto-insert-alist (append '(("\\.spec" . "template.spec") ("\\.html" . "template.html")) auto-insert-alist)) ;; mpg123 (add-hook 'mpg123-load-hook (load "id3")) (autoload 'mpg123 "mpg123" nil t) (setq mpg123-startup-volume 80) ;; super-smart-find (require 'super-smart-find) (define-key global-map "\C-x\C-f" 'super-smart-find-file) (define-key global-map "\C-x4f" 'super-smart-find-file-other-window) (define-key global-map "\C-xi" 'super-smart-find-insert-file) (define-key global-map "\C-x\C-w" 'super-smart-find-write-file) (define-key global-map "\C-x5f" 'super-smart-find-file-other-frame) (define-key global-map "\C-x4l" 'super-smart-find-load-file) (add-hook 'mime-edit-load-hook (lambda () (define-key mime-edit-mode-map "\C-c\C-x\C-i" 'super-smart-find-mime-edit-insert-file) (put-alist 'file '("Insert File" super-smart-find-mime-edit-insert-file) mime-edit-menu-list) ) t) (setq smart-find-file-path '( "~" "~/memo" "~/src" "~/work" "~/work/rpm/SPECS" )) ;; use UTF-8 (add-path "~/lib/elisp/20/Mule-UCS-0.74/lisp") ;(require 'un-sample) ;(require 'un-tools) (require 'un-define) ;(require 'jisx0213) ;; namazu (autoload 'namazu "namazu" nil t) (setq namazu-default-dir "/home/negi/lib/namazu/memo") ;; PSGML (autoload 'sgml-mode "psgml" "Major mode to edit SGML files" t) (require 'html-helper-mode) (add-hook 'sgml-mode-hook (lambda () (make-local-variable 'fill-column) (setq fill-column 76))) ;; DOCTYPE 宣言の設定 (setq sgml-custom-dtd '(("HTML" "") ("HTML 3.2" "") ("HTML 4.01" "") ("HTML i-mode" "") )) (setq sgml-catalog-files '("CATALOG" "/home/negi/lib/sgml/CATALOG") ;; sgml-ecat-files '("ECAT" "/home/negi/lib/sgml/ECAT") sgml-display-char-list-filename "/home/negi/lib/sgml/iso88591.map" sgml-indent-data t sgml-indent-step 1) ; (setq sgml-set-face t) ; (setq sgml-markup-faces ; '((start-tag . font-lock-type-face) ; (end-tag . font-lock-type-face) ; (comment . font-lock-comment-face) ; (ignored . font-lock-comment-face) ; (pi . font-lock-keyword-face) ; (sgml . font-lock-keyword-face) ; (doctype . font-lock-constant-face) ; (entity . font-lock-string-face) ; (shortref . bold))) ;;; Cperl-mode (add-hook 'cperl-mode-hook (lambda () (local-set-key "\C-xhv" 'cperl-get-help) (local-set-key "\C-xhf" 'cperl-info-on-current-command) (local-set-key "\C-h" 'backward-delete-char) )) (setq cperl-indent-level 4 cperl-continued-statement-offset 4 cperl-continued-brace-offset -4 cperl-brace-offset 0 cperl-brace-imaginary-offset 0 cperl-label-offset -2 cperl-auto-newline t) ;;; follow-mouse カーソルがマウスカーソルに追従する (autoload 'toggle-follow-mouse "follow-mouse.el" nil t) ;(toggle-follow-mouse 1) ;;; Wanderlust (autoload 'wl "wl" "Wanderlust" t) (autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t) ;;; ruby-mode (autoload 'ruby-mode "ruby-mode" nil t) ;;; ミニバッファの大きさが可変する (resize-minibuffer-mode 1) ;;; 日本語 man をちゃんと読めるようにする (defun Man-cooked-2-backspace-code () (goto-char (point-min)) (while (re-search-forward "\\(.\\)\\(\b\b\\1\\)+" nil t) (replace-match "\\1") (if Man-fontify-manpage-flag (put-text-property (1- (point)) (point) 'face Man-overstrike-face))) (goto-char (point-min))) (add-hook 'Man-cooked-hook 'Man-cooked-2-backspace-code)