emacs23ããªãªã¼ã¹ããã¦ããããã°ãããã¡ã¾ãããemacs 23.2 for windows(NTEmacs)ã®ãã¤ããªãè¦ã¤ããã®ã§ãinstallãã¦ã¿ã¾ãããwww.gnu.orgã§å ¬éããã¦ããemacs23 for windowsã§ã¯IMEå¤ææã®æåãä¸èªç¶ã¨èãããã¨ãããã¾ãããNTEmacsã§ã¯æ£ãã?ã¤ã³ã©ã¤ã³ã§å¤æãããã®ã§ãNTEmacsã使ãã®ãããã¨æãã¾ãã
NTEmacsã¯gnupackã®projectããå ¥æ
http://gnupack.sourceforge.jp/docs/current/UsersGuide.html
ä»åãgnupackã¨ãã解åãã¦ããã ãã§Cygwin㨠NTEmacsã使ããããã±ã¼ã¸ã®åå¨ãããã¾ããã
gnupackã«å«ã¾ããntemacsã使ç¨ãã¦ãæ§ãã¾ããããç§ã®ç°å¢ã«ã¯æ¢ã«Cygwinã¯installããã¦ãã¾ãããgnupackã®ããã±ã¼ã¸ã100MBç¨ãããã®ã§ã次ã®urlã«ããNTEmacsã®ã¿ãå
¥æãã¾ããã
http://gnupack.sourceforge.jp/docs/current/UsersGuide_download.html
installã¨ãã£ã¦ã解åããã ãã§ã
ntemacsã¯installã¨è¡ã£ã¦ããèªå·±è§£çå½¢å¼ã®ãã¡ã¤ã«ã解åããã ãã§ãã®ã§ãåèã¾ã§ã«ç§ã®ç°å¢ã®.emacsãè¨è¼ãã¦ããã¾ãã
; -*- Mode: Emacs-Lisp ; Coding: utf-8 -*- ;åècommand ;M-x query-replace-regexp ;æ£è¦è¡¨ç¾ã«ããæååã®ç½®æ ;M-x replace-regexp ;æ£è¦è¡¨ç¾ã«ããæååã®ç¡æ¡ä»¶ç½®æ ;M-x set-buffer-file-coding-system ;æå+æ¹è¡ã³ã¼ãã®å¤æ´ ;M-x untabify ,M-x tabify ;ã¿ã->ã¹ãã¼ã¹,ã¹ãã¼ã¹->ã¿ã ;M-= ;æåæ°,è¡æ°ãã«ã¦ã³ã ;C-x RET c euc-jp-unix C-x C-f ;æåã³ã¼ããæå®ãã¦fileãéã ;M-x print-buffer ;ãããã¡ã®å°å· ;M-x upcase-region, M-x downcase-region ;大æå<->å°æå ;M-x perltidy-region ;C-/ ;undo ;C-. ;ãããã¡ãã¯ã·ã¯ã·åãæ¿ã ;M-x japanese-hankaku-region ;å ¨è§->åè§ å¤æ ;M-/ ;åçç¥èªå±é ;C-x ' ;éçç¥èªå±é(define ~/.abbrev_defs) ;M-x kill-rectangle ;ç©å½¢ã§cut ;M-x yank-rectangle ;ç©å½¢ã§paste ;M-TAB in css-mode ;cssã®å±æ§è£å® ;ç½®ææåå = C-q C-m(CR), C-q C-j(LF) ;ç½®ææååã«æ¹è¡ã³ã¼ãã使ã ;C-x b ;anything ;C-RET ;zencoding ;M-x sort-lines ;sort ;C-u 2 M-x sort-fields ;no2 columnã§sort ;M-x se/make-summary-buffer ;medhodä¸è¦§è¡¨ç¤º ;M-x set-variable[RET]tab-width[RET]4[RET] ;tabå¹ å¤æ´ ;M-x hs-hide-all , hs-show-all ;é¢æ°ã®æãããã¿. è¦ M-x hs-minor-mode ;------------------------------------------------------------------------ (prefer-coding-system 'utf-8-unix) ; æ¥æ¬èªå ¥åã®ããã®è¨å® (setq default-file-name-coding-system 'shift_jis) ;diredã§æ¥æ¬èªfileååºå (set-default-font "ï¼ï¼³ ã´ã·ãã¯-10") ;------------------------------------------------------------------------ (setq default-input-method "W32-IME") ;æ¨æºIMEã®è¨å® (w32-ime-initialize) ;IMEã®åæå (set-cursor-color "red") ;IME OFFæã®åæã«ã¼ã½ã«ã«ã©ã¼ (setq w32-ime-buffer-switch-p nil) ;ãããã¡åãæ¿ãæã«IMEç¶æ ãå¼ãç¶ã ;IME ON/OFFæã®ã«ã¼ã½ã«ã«ã©ã¼ (add-hook 'input-method-activate-hook (lambda() (set-cursor-color "green"))) (add-hook 'input-method-inactivate-hook (lambda() (set-cursor-color "red"))) ;------------------------------------------------------------------------ (setq default-frame-alist (append (list '(width . 81) '(height . 53) '(top . 0) '(left . 720)) default-frame-alist)) (setq resize-mini-windows t) ;ãããããã¡æ¡å¤§é²æ¢ (show-paren-mode 1) (setq-default make-backup-files nil) ;BackUp File (setq auto-save-default nil) ;èªåä¿å (global-set-key "\C-h" 'backward-delete-char) ;C-h ã§BackSpace ;(menu-bar-mode t) ;menu bar表示 (tool-bar-mode nil) ;tool bar表示 (setq line-number-mode t) ;è¡çªå·è¡¨ç¤º (setq column-number-mode 1) ;åçªå·è¡¨ç¤º (put 'downcase-region 'disabled nil) ;å°æååå®è¡æã®ç¢ºèªãç¡å¹ã« (global-set-key "\C-x\C-b" 'bs-show) ;C-xC-bãM-x bs-showã«å¤æ´ (global-set-key [M-kanji] 'ignore) ;M-kanjiã¨ããããã®ã§... (put 'upcase-region 'disabled nil) ;; ------------------------------------------------------------------------ ;;keisen.el Shift+ç¢å°ã§ç°¡åã«ç½«ç·ãæç» (global-set-key [S-right] 'keisen-right-move ) (global-set-key [S-left] 'keisen-left-move ) (global-set-key [S-up] 'keisen-up-move ) (global-set-key [S-down] 'keisen-down-move ) (autoload 'keisen-up-move "keisen" nil t) (autoload 'keisen-down-move "keisen" nil t) (autoload 'keisen-left-move "keisen" nil t) (autoload 'keisen-right-move "keisen" nil t) ;; ------------------------------------------------------------------------ ;; programing mode ;;php-mode ;; (load-library "php-mode") ;; ;(require 'php-mode) ;; (setq php-mode-force-pear t) ;; (add-hook 'php-mode-user-hook ;; '(lambda () ;; (c-set-style "stroustrup") ;; (setq tab-width 4) ;; (setq c-basic-offset 4) ;; (setq indent-tabs-mode nil))) ;;cperl-mode (autoload 'cperl-mode "cperl-mode" "alternate mode for editing Perl programs" t) (setq auto-mode-alist (append '(("\\.\\([pP][Llm]\\|al\\|cgi\\|t\\|psgi\\)$" . cperl-mode)) auto-mode-alist )) (add-hook 'cperl-mode-hook (lambda () (setq cperl-font-lock t) (cperl-set-style "PerlStyle"))) ;; M-x hs-hide-all , hs-show-all ã§é¢æ°ã®æãããã¿ (add-hook 'cperl-mode-hook '(lambda() (hs-minor-mode 1))) ;å ã ã®perl-modeã¯cperlã¸ä¾åããããã¨ã§ãåä½ã軽ããªãã¾ã (defalias 'perl-mode 'cperl-mode) ;;html-helper-mode tagå ã®indentãã¤ãã¤ããªã®ã§ä½¿ç¨ä¸æ¢ãã¾ãã ;(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t) ;(setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist)) ;(add-hook 'html-helper-load-hook '(lambda () (require 'html-font))) ;;zencoding-mode ããç¨ãçç£æ§ãåä¸ããªãã£ãã®ã§ã使ç¨ä¸æ¢ãã¾ãã ;(require 'zencoding-mode) ;(add-hook 'sgml-mode-hook 'zencoding-mode) ;(add-hook 'html-mode-hook 'zencoding-mode) ;; css-mode (autoload 'css-mode "css-mode") (setq auto-mode-alist (cons '("\\.css$" . css-mode) auto-mode-alist)) (setq cssm-indent-level 4) (setq cssm-indent-function #'cssm-c-style-indenter) ;ã¤ã³ãã³ããc-styleã« ;; js2-mode (autoload 'js2-mode "js2" nil t) (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) ; fixing indentation ; refer to http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode ; emacs 23.2以éã§ã¯ä¸è¦ãã? (autoload 'espresso-mode "espresso") (defun my-js2-indent-function () (interactive) (save-restriction (widen) (let* ((inhibit-point-motion-hooks t) (parse-status (save-excursion (syntax-ppss (point-at-bol)))) (offset (- (current-column) (current-indentation))) (indentation (espresso--proper-indentation parse-status)) node) (save-excursion ;; I like to indent case and labels to half of the tab width (back-to-indentation) (if (looking-at "case\\s-") (setq indentation (+ indentation (/ espresso-indent-level 2)))) ;; consecutive declarations in a var statement are nice if ;; properly aligned, i.e: ;; ;; var foo = "bar", ;; bar = "foo"; (setq node (js2-node-at-point)) (when (and node (= js2-NAME (js2-node-type node)) (= js2-VAR (js2-node-type (js2-node-parent node)))) (setq indentation (+ 4 indentation)))) (indent-line-to indentation) (when (> offset 0) (forward-char offset))))) (defun my-indent-sexp () (interactive) (save-restriction (save-excursion (widen) (let* ((inhibit-point-motion-hooks t) (parse-status (syntax-ppss (point))) (beg (nth 1 parse-status)) (end-marker (make-marker)) (end (progn (goto-char beg) (forward-list) (point))) (ovl (make-overlay beg end))) (set-marker end-marker end) (overlay-put ovl 'face 'highlight) (goto-char beg) (while (< (point) (marker-position end-marker)) ;; don't reindent blank lines so we don't set the "buffer ;; modified" property for nothing (beginning-of-line) (unless (looking-at "\\s-*$") (indent-according-to-mode)) (forward-line)) (run-with-timer 0.5 nil '(lambda(ovl) (delete-overlay ovl)) ovl))))) (defun my-js2-mode-hook () (require 'espresso) (setq espresso-indent-level 4 indent-tabs-mode nil c-basic-offset 4) (c-toggle-auto-state 0) (c-toggle-hungry-state 1) (set (make-local-variable 'indent-line-function) 'my-js2-indent-function) ; (define-key js2-mode-map [(meta control |)] 'cperl-lineup) (define-key js2-mode-map "\C-\M-\\" '(lambda() (interactive) (insert "/* -----[ ") (save-excursion (insert " ]----- */")) )) (define-key js2-mode-map "\C-m" 'newline-and-indent) ; (define-key js2-mode-map [(backspace)] 'c-electric-backspace) ; (define-key js2-mode-map [(control d)] 'c-electric-delete-forward) (define-key js2-mode-map "\C-\M-q" 'my-indent-sexp) (if (featurep 'js2-highlight-vars) (js2-highlight-vars-mode)) (message "My JS2 hook")) (add-hook 'js2-mode-hook 'my-js2-mode-hook) ;; (autoload 'js2-mode "js2" nil t) ;; (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) ;; (add-hook 'js2-mode-hook ;; '(lambda () ;; (setq js2-basic-offset 4))) ;;yaml-mode (require 'yaml-mode) (add-to-list 'auto-mode-alist '("\\.\\(yaml\\|yml\\)$" . yaml-mode)) ;; vbnet-mode (autoload 'vbnet-mode "vbnet-mode" "Mode for editing VB.NET code." t) (setq auto-mode-alist (append '(("\\.\\(frm\\|bas\\|cls\\|vb\\|vbs\\)$" . vbnet-mode)) auto-mode-alist)) ;------------------------------------------------------------------------ ;;c-modeã®ã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã« ;(setq c-default-style "linux") ;;ã¤ã³ãã³ãã¯ã¿ãã«ãã ;(setq indent-tabs-mode t) ;;ã¤ã³ãã³ãå¹ ;(setq c-basic-offset 4) ;;ã¿ãå¹ ;(setq default-tab-width 4) ;(setq tab-width 4) ;------------------------------------------------------------------------ ;;; methodLog or prolog mode (setq-default auto-mode-alist (nconc '( ; ("\\.pl$" . prolog-mode) ("\\.cs$" . prolog-mode) ; ("\\.tbl$" . prolog-mode) ) auto-mode-alist)) (add-hook 'prolog-mode-hook '(lambda () (make-local-variable 'font-lock-syntactic-keywords) (setq font-lock-syntactic-keywords '(("\\$\\([#\"'`$\\]\\)" 1 (1 . nil)) ("\\(#\\)[{$@]" 1 (1 . nil)))) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '((prolog-font-lock-keywords) nil nil)) (setq font-lock-keywords prolog-font-lock-keywords))) (defvar prolog-font-lock-keywords (list (cons (concat "\\(^\\|[^_:.@$]\\|\\.\\.\\)\\b\\(" (mapconcat 'identity '("class" "be" "endClass" "superClass" "classSlot" "instanceSlot" "fail" "true" "is" "for" "module" "not" "or" "catch" "throw" "super" "there" "upper" "here" ) "\\|") "\\)\\>[^_]") 2) ;; variables '("\\b\\(nil\\|self\\)\\b" 1 font-lock-variable-name-face) ;; variables '("[$@].\\(\\w\\|_\\)*" 0 font-lock-variable-name-face) ;; constants '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)" 2 font-lock-type-face) ;; functions '("^\\s *def\\s *\\<\\(\\(\\w\\|_\\)+\\(\\.\\|::\\)\\)?\\(\\(\\w\\|_\\)+\\??\\)\\>" 4 font-lock-function-name-face t) ;; symbols '("\\(^\\|[^:]\\)\\(:\\(\\w\\|_\\)+\\??\\)\\b" 2 font-lock-reference-face)) "*Additional expressions to highlight in prolog mode.") ;; ------------------------------------------------------------------------ ;;å ¨è§ç©ºç½ãã¿ãæåãè¡æ«ç©ºç½ã®è¡¨ç¤º ;; http://homepage1.nifty.com/blankspace/emacs/color.html (defface my-face-b-1 '((t (:background "bisque"))) nil) (defface my-face-b-2 '((t (:background "LemonChiffon2"))) nil) (defface my-face-u-1 '((t (:foreground "SteelBlue" :underline t))) nil) (defvar my-face-b-1 'my-face-b-1) (defvar my-face-b-2 'my-face-b-2) (defvar my-face-u-1 'my-face-u-1) (defadvice font-lock-mode (before my-font-lock-mode ()) (font-lock-add-keywords major-mode '(("ã" 0 my-face-b-1 append) ("\t" 0 my-face-b-2 append) ("[ \t]+$" 0 my-face-u-1 append) ))) (ad-enable-advice 'font-lock-mode 'before 'my-font-lock-mode) (ad-activate 'font-lock-mode) ;------------------------------------------------------------------------ ;éçç¥èªå±é(abbrev) ;(setq abbrev-file-name "c:/home/endo/.abbrev_defs") ;(setq save-abbrevs t) ;(quietly-read-abbrev-file) (global-set-key "\M-/" 'expand-abbrev) (eval-after-load "abbrev" '(global-set-key "\M-/" 'expand-abbrev)) ;; auto-complete http://code.google.com/p/auto-complete/ (require 'auto-complete) (require 'auto-complete-config) ;æ å ±æº ;bufferã«ããåä¸modeããsuggest (setq-default ac-sources '( ac-source-words-in-same-mode-buffers ac-source-abbrev ac-source-dictionary ; ac-source-filename ;file name suggest )) ;refer to http://d.hatena.ne.jp/sugyan/20120107 (defvar ac-source-css-property-names '((candidates . (loop for property in ac-css-property-alist collect (car property))))) ;css-modeã®å ´åã®ã¿ãcssã®key-valueãsuggest (defun my-css-mode-hook () (add-to-list 'ac-sources 'ac-source-css-property) ;cssã®keyã®suggest (add-to-list 'ac-sources 'ac-source-css-property-names)) ;cssã®valã®suggest (add-hook 'css-mode-hook 'my-css-mode-hook) ;auto-completeã使ç¨ããmode (global-auto-complete-mode t) ;âãããtrueã®å ´åãac-modes ã®ç»é²è¦ (setq ac-modes (append ac-modes '(cperl-mode html-mode sql-mode vbnet-mode css-mode actionscript-mode))) (define-key ac-completing-map "\C-n" 'ac-next) (define-key ac-completing-map "\C-p" 'ac-previous) (setq ac-ignore-case t) ;大æåã»å°æåãåºå¥ããªã ;------------------------------------------------------------------------ ;http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html ;(load "nxhtml/autostart.el") ;------------------------------------------------------------------------ ;;auto-install ã使ç¨ããå ´åã®ã¿ã³ã¡ã³ãã解é¤ãã¾ããã ;(require 'auto-install) ;(setq auto-install-directory "~/.emacs.d/auto-install/") ;(auto-install-update-emacswiki-package-name t) ;(auto-install-compatibility-setup) ;------------------------------------------------------------------------ (require 'anything-config) (setq anything-sources (list ; anything-c-source-buffers ; anything-c-source-file-cache anything-c-source-file-name-history ; anything-c-source-files-in-current-dir anything-c-source-recentf ; anything-c-source-info-pages ; anything-c-source-man-pages ; anything-c-source-locate ; anything-c-source-emacs-commands ; anything-c-source-emacs-functions )) (global-set-key "\C-xb" 'anything) ;------------------------------------------------------------------------ (require 'pod-mode) (add-to-list 'auto-mode-alist '("\\.pod$" . pod-mode)) (add-hook 'pod-mode-hook '(lambda () (progn (font-lock-mode) (auto-fill-mode 1) (flyspell-mode 1) ))) ;------------------------------------------------------------------------ ;; actionscript-mode (autoload 'actionscript-mode "actionscript-mode" "Major mode for actionscript." t) (add-to-list 'auto-mode-alist '("\\.as$" . actionscript-mode)) ;------------------------------------------------------------------------ ;; japanese-holidays.el (require 'calendar) (setq number-of-diary-entries 31) (define-key calendar-mode-map "f" 'calendar-forward-day) (define-key calendar-mode-map "n" 'calendar-forward-day) (define-key calendar-mode-map "b" 'calendar-backward-day) (setq mark-holidays-in-calendar t) ;; (install-elisp "http://www.meadowy.org/meadow/netinstall/export/799/branches/3.00/pkginfo/japanese-holidays/japanese-holidays.el") (require 'japanese-holidays) (setq calendar-holidays (append japanese-holidays local-holidays other-holidays)) (setq calendar-weekend-marker 'diary) (add-hook 'today-visible-calendar-hook 'calendar-mark-weekend) (add-hook 'today-invisible-calendar-hook 'calendar-mark-weekend) ;; http://www.bookshelf.jp/soft/meadow_42.html#SEC641 (autoload 'se/make-summary-buffer "summarye" nil t) ;; http://d.hatena.ne.jp/rubikitch/20091224/recentf ;(require 'recentf-ext) (when (require 'recentf nil t) (setq recentf-max-saved-items 2000) (setq recentf-exclude '(".recentf")) (setq recentf-auto-cleanup 10) (setq recentf-auto-save-timer (run-with-idle-timer 30 t 'recentf-save-list)) (recentf-mode 1))