;NetInstallerだってさ。 (require "ni/setup") ;; 自動設定を利用する (ni-autoload) ;; PROXYを通す場合 ;(setq ni::*http-proxy-host* "proxy.host") ; PROXY のホスト ;(setq ni::*http-proxy-port* 8080) ; PROXY のポート ;いろいろロード (load-library "winkey") (load-library "browserex") (load-library "olt/olt") (require "xml-mode") (use-package 'xml) (require "xml/xhtml") ;拡張子が以下の時は自動でxml-modeだよ。 (pushnew '("\\.\\(xml\\|xsl\\|html\\|svg\\|fo\\|xi\\)" . xml-mode) *auto-mode-alist* :test 'equal) ;インクリメンタルサーチとみげも (require "isearch") (require "migemo") (migemo-toggle t) ;sample.xyzzy for www-mode。でもni-autoloadに全く同じことが (autoload 'www "www/www" t) ; 通常起動 (autoload 'www-open-url "www/www" t) ; URLを指定して起動 (autoload 'www-open-local-file "www/www" t) ; ローカルのファイルを指定して開く (autoload 'www-open-current-buffer "www/www" t) ; 現在のバッファのファイルを開く ;;2ch-mode (autoload '2ch "2ch/main" t) ;ftpupdate (autoload 'ftpupdate "ftpupdate" t) (autoload 'ftpupdate-this-file "ftpupdate" t) (autoload 'ftpupdate-all "ftpupdate" t) (autoload 'ftpupdate-update-time "ftpupdate" t) ;;アップロードするサーバ (setq *ftpupdate-server* "s14.xrea.com") ;;ユーザー名 (setq *ftpupdate-user* "yaske") ;;パスワード (setq *ftpupdate-pass* "**************") ;;サーバーのアップロードする基準のトップディレクトリ (setq *ftpupdate-remote-path* "public_html") ;;ローカルのアップロードする基準のトップディレクトリ (setq *ftpupdate-local-path* "D:/xrea") ;;アップロードしないファイルの正規表現(小文字で指定) ;(setq *ftpupdate-file-ignore-regexp* ; "~$\\|\.lc\\|\.bak$\\|\.log$\\|\.dat$\\|/cvs/\\|/rcs/\\|tags$") ;litestep (require "litestep") (setq *litestep-rc-path* "c:/litestep/step.rc") ;ポップアップで補完 (require "dabbrev") (global-set-key #\C-\; 'dabbrev-popup) ; Ctrl+セミコロン (setq *popup-completion-list-default* :always) (setq *minibuffer-popup-completion-list* :never) ;clickable-url (load-library "clickable-url") (global-set-key #\C-l 'clickable-url-recenter) (global-set-key '(#\C-c #\C-o) 'clickable-url-open) (setq *clickable-url-set-attribute-mode-list* '(fundamental-mode text-mode)) (setq *clickable-url-attribute* '(:foreground 4 :underline t)) (setq *clickable-url-selection-attribute* '(:foreground 4 :underline t :bold t)) (setq *clickable-url-selection-timeout* 0.2) ;; ; 英次郎 (load-library "eijiro/eijiro") ; ※前バージョンと異なってます!! (global-set-key '(#\C-c #\e) 'ie-eijiro-selection) ;; ; 国語辞書 (global-set-key '(#\C-c #\j) 'jj-dictionary-selection) ;;;ミニバッファのIMEをOFFではじめる (defvar *start-minibuffer-toggle-ime* nil) (defun start-minibuffer-ime-off-1 (buf his) (when (get-ime-mode) (toggle-ime) (setq *start-minibuffer-toggle-ime* t))) (defun start-minibuffer-ime-off-2 (buf his) (when *start-minibuffer-toggle-ime* (toggle-ime) (setq *start-minibuffer-toggle-ime* nil))) (add-hook '*enter-minibuffer-hook* 'start-minibuffer-ime-off-1) (add-hook '*exit-minibuffer-hook* 'start-minibuffer-ime-off-2) ;;;site-lisp削除とかダンプファイル消すとかC-c bで (defun compile-and-delete-dump-file () (interactive) (and (find-buffer "siteinit.l") (eval-buffer "siteinit.l")) (byte-compile-file (concat (si:system-root) "site-lisp/siteinit.l")) (let ((dumpfile (concat (si:system-root) "xyzzy.w" (case (os-platform) (whistler "xp") (windows-2000 "2k") (windows-nt "nt") (windows-me "me") (windows-98 "98") (windows-95 "95") (t "nt"))))) (and (file-exist-p dumpfile) (delete-file dumpfile)))) (global-set-key '(#\C-c #\b) 'compile-and-delete-dump-file) ;;;rss-mode (require "rss/main") ;; www-modeで開く (require "rss/open-www") ;; 出したり引っ込めたりするキーバインド設定 (global-set-key #\C-F3 'rss-toggle) ;;うまくいくかなhtmllint提携 (defvar *htmllint-file* "C:/htmllint/htmllint") (defun htmllint-exec () (interactive) (let ((file (get-buffer-file-name))) (when file (pipe-command (format nil "perl \"~A\" \"~A\"" (map-slash-to-backslash *htmllint-file*) (map-slash-to-backslash file)))))) (global-set-key #\S-F3 'htmllint-exec) ;;インデントし直せ! (global-set-key #\C-F11 #'(lambda () (interactive) (indent-region (point-min) (point-max)) (message "indent buffer"))) ;;ラベルがないといろいろ忘れがち (set-function-bar-label #\C-F11 "indent buffer") (set-function-bar-label #\C-F3 "rss") (set-function-bar-label #\S-F3 "htmllint") (set-function-bar-label #\S-F1 "ndiary") ;;ndiary-mode (load-library "ndiary-mode") (push '("\\.diary$" . ndiary-mode) *auto-mode-alist*) (setq *ndiary-directory* "D:/ndiary/log") (setq *ndiary-yesterday-hour* 0) (setq *ndiary-filename* "D:/ndiary/script/diary") ;(setq *ndiary-upload-command* "C:/tools/internet/autoftp/autoftp") (setq *ndiary-html* "D:/ndiary/html/index.html") (setq *ndiary-offer-save* t) (global-set-key #\S-F1 'ndiary-edit) ;(defun diary-n-convert-to-html () (defun ndiary-compile () (interactive) (if *ndiary-offer-save* (save-some-buffers)) (let (cmd) (setq cmd (read-string "Command: " :default (concat "ruby " *ndiary-filename*))) (message "converting ...") (execute-shell-command cmd) (message "convert ... done"))) ; upload は ftpupdate で。 (defun ndiary-upload () (interactive) "まずはコンパイル" (ndiary-compile) "日記をサーバにあげましょー" (ftpupdate-ndiary)) (defun ftpupdate-ndiary () (interactive) (setq *ftpupdate-server* "s14.xrea.com") (setq *ftpupdate-user* "yaske") (setq *ftpupdate-pass* "**************") (setq *ftpupdate-remote-path* "public_html/") (setq *ftpupdate-local-path* (concat "D:/ndiary/html")) (setq *ftpupdate-file-ignore-regexp* "\\.xml$\\|\.pl$\\|/old/\\|\\.jp\\|\\.com") (ftpupdate) (setq *ftpupdate-local-path* "D:/xrea") ) ;www-modeのソースはxml-modeで見るだろ (add-hook 'www::*www-source-mode-hook* 'xml::xml-mode) ;ファイラ ; ファイラで全ファイル表示をデフォルトに ;; 2 画面用 (setq *filer-primary-file-mask* '("*")) (setq *filer-secondary-file-mask* '("*")) ;; 1 画面用 (setq *filer-last-file-mask* '("*")) ;grep結果をダブルクリックで飛ぶ。 (defun grep-mouse-left-press () "grep結果をダブルクリックでファイルopen" (interactive) (let ((click (mod *last-mouse-click-count* 6))) (if (= click 2) (first-error) (mouse-left-press)))) (defvar *grep-map* nil) (unless *grep-map* (setq *grep-map* (make-sparse-keymap)) (define-key *grep-map* #\LBtnDown 'grep-mouse-left-press)) (add-hook 'ed::*grep-hook* #'(lambda () (use-keymap *grep-map*))) (add-hook 'ed::*grepd-hook* #'(lambda () (use-keymap *grep-map*))) ;コピペを楽に(範囲選択でコピー。真ん中クリックで貼り付け) (defun mouse-right-press () (interactive) (mouse-left-press) (paste-from-clipboard)) (global-set-key #\LBtnUp 'copy-selection-to-clipboard) (global-set-key #\MBtnUp 'mouse-right-press) ;2ch-modeの時バッファバー邪魔。 (add-hook '*2ch-start-hook* #'(lambda () (hide-command-bar 'buffer-bar))) (add-hook '*2ch-exit-hook* #'(lambda () (show-command-bar 'buffer-bar))) ;贅沢にもxyzzyでdocファイルを見る ;; cygwin の bash コマンド (defvar *wview-bash-command* "c:\\cygwin\\bin\\bash") (defun wview-find-file (filename fn) ;; .doc 以外は nil を返しておまかせモード (unless (string-match (compile-regexp "\\.doc$" t) ; case-fold filename) (return-from wview-find-file nil)) ;; .doc の場合は wvWare を使ってHTMLにしてどうこうする。 (let ((html (make-temp-file-name "wv" ".html"))) (execute-shell-command (format nil (concat "~A --login -c" " \"wvHtml --charset=Shift_JIS `cygpath ~A`" " --targetdir=`cygpath ~A` ~A\"") *wview-bash-command* filename (directory-namestring html) (file-namestring html))) (funcall fn html) (selected-buffer))) (add-hook '*before-find-file-hook* #'(lambda (filename) (wview-find-file filename #'(lambda (html) ;; www-mode で開く (www-open-local-file html))))) ;wikilog (require "wikilog") (setq *wikilog-user* "yaske ")