[[Editor]] //////////////////////////////////////////////////////////////////////////////// * 目次 [#xdc7c37e] #contents(); * Links [#u98e735b] - [[Meadow/Emacs memo>http://www.bookshelf.jp/soft/meadow.html#SEC_Top]] - [[Programming in Emacs Lisp [ja]>http://www.math.s.chiba-u.ac.jp/~matsu/lisp/emacs-lisp-intro-jp.html]] - [[Emacs 活用法>http://www.math.s.chiba-u.ac.jp/~matsu/emacs/emacs21/index.html]] - [[navi.el(関数の一覧表示とジャンプ)>http://www.ne.jp/asahi/love/suna/pub/soft/navi.el/index.html]] -- fume-mode.el は XEmacsでしか使えないが、これはemacsで使える。 - [[Emacs Lispまとめ>http://matome.replore.com/index.php?title=Emacs_Lisp%E3%81%BE%E3%81%A8%E3%82%81]] - [[CEDET>http://sourceforge.jp/projects/sfnet_cedet/]] -- [[Undo-tree.el>http://www.emacswiki.org/emacs/UndoTree]] //////////////////////////////////////////////////////////////////////////////// * emacs / XEmacs 共通 [#r71ffd67] ** 表示関連 [#l0e4033f] (setq frame-title-format (format "emacs@%s : %%f" (system-name))) ; タイトルバーの表示書式にファイル名を入れる ** Time-stamp [#m59e6eee] ; Time-stamp ; http://homepage.mac.com/zenitani/elisp-j.html#time-stamp (require 'time-stamp) (setq time-stamp-start "Last updated: <") ; 開始文字列の設定。通常は "Time-stamp: <>" ;; 日本語で日付を入れたくないのでlocaleをCにする (defun time-stamp-with-locale-c () (let ((system-time-locale "C")) (time-stamp) nil)) (if (not (memq 'time-stamp-with-locale-c write-file-hooks)) (add-hook 'write-file-hooks 'time-stamp-with-locale-c)) ; (setq time-stamp-format "%3a %3b %02d %02H:%02M:%02S %Z %:y") (setq time-stamp-format "%04y/%02m/%02d %02H:%02M:%02S %Z") ; YYYY/MM/DD HH:MM:SS JST ** 文字数を数える [#t87cae47] - 対象領域を選択し、 M-x: count-lines-region または M-= とする。 - 行数と文字数が表示される。文字数は、全角も半角もそれぞれ1文字として扱われる。 ** isearch で、カーソルの位置にある単語を検索対象にする [#t5442189] - isearch時に、 C-w と打てばOK ** shell-mode で制御文字を処理する [#s805f2e5] ; shell-mode で制御文字を処理する。 (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) ** ファイルを read-only で開く [#sd5faa53] C-x C-r ** バックアップファイルを作らないようにする [#d7ff8fd4] (setq make-backup-files nil) ; *.~ とかのバックアップファイルを作らない (setq auto-save-default nil) ; .#* とかのバックアップファイルを作らない ** 選択領域を [DEL] で一気に消せるようにする [#y95ca8b8] ; (setq delete-selection-mode t) (delete-selection-mode) //////////////////////////////////////////////////////////////////////////////// ** HTML文書編集での自動補完 [#d02f9e86] - yahtmlを使う(yahtmlは、YaTeXに付属しているもの)。 - [[参考リンク>http://www.namazu.org/~tsuchiya/elisp/yahtml-mode.html]] //////////////////////////////////////////////////////////////////////////////// * emacs only [#f05f3f8e] ** {menu|tool}-barを消す [#y7f4f9fe] (tool-bar-mode 0) ; tool bar を表示しない (menu-bar-mode 0) ; menu bar を表示しない (which-function-mode 1) ; 現在の関数名をモードラインに表示 ** 前のウインドウに戻る [#ia6f365e] ; XEmacsにはあるが、emacsにはない(!) ; http://matome.replore.com/index.php?title=Emacs_Lisp%E3%81%BE%E3%81%A8%E3%82%81 ; xemacsに合わせて、関数名を backward-other-window に変更。 ; (defun other-window-backward (&optional n) (defun backward-other-window (&optional n) "Select nth previous window." (interactive "P") (other-window (- (prefix-numeric-value n)))) //////////////////////////////////////////////////////////////////////////////// * XEmacs only [#g1765dad] ** fume-mode [#n684f157] ;========================================================= ; fume-mode (XEmacs only) (defun function-menu-mode() (interactive) (fume-mode t) (fume-add-menubar-entry t)) ; モード行に現在カーソルがある関数の名前を表示 (global-set-key "\C-\M-l" 'function-menu-mode) ; function-menu-mode に入る ** using Unicode [#u5f8b4cd] emacsでは使えるのに、何故かXEmacsのdefaultでは使えないUnicode. 使えるようにするには、以下をinit.elに追記する: (require 'un-define) (unless (emacs-version>= 21 5 6) (require 'mule-ucs-unicode "unicode")) (set-coding-category-system 'utf-8 'utf-8) (set-coding-priority-list '(utf-8)) (load "term/keyswap") (global-set-key [backspace] 'backward-delete-char) (keyboard-translate ?\C-h 'backspace) (global-set-key [delete] 'delete-char) ** ホイールマウスのスクロールを有効にする [#a470e136] (autoload 'mwheel-install "mwheel" "Enabal mouse wheel support.") (mwheel-install)