(add-hook '*before-find-file-hook* #'(lambda (file) (let ((let-type (pathname-type file))) (cond ( (string-equal let-type "info") (require "info2") (info2-mode file) (selected-buffer) ) ) ) ) )
(defun my-view-info-reference () "\ カーソル位置の単語でモード毎のマニュアルを検索。 " (interactive) (require "info2") (let ( (let-buffer (selected-buffer)) (let-index (my-get-index)) ) (when let-index (delete-other-windows) (split-window) (case buffer-mode ;; lisp-mode ( 'lisp-mode (info2-mode "~/info/Language/Lisp/reference/reference.info" "*Reference*") (info2-index let-index) ) ;; lisp-interaction-mode ( 'lisp-interaction-mode (info2-mode "~/info/Language/Lisp/reference/reference.info" "*Reference*") (info2-index let-index) ) ;; texinfo-mode ( 'texinfo-mode (info2-mode "~/info/Language/Texinfo/Texinfo.info" "*Reference*") (info2-index let-index) ) ;; その他 ( t ;; CalMemo から検索 (require "grepd") (setf ;; 正規表現 *grep-regexp-search* t ;; サブディレクトリも検索 *grep-subdir* t ) ;; CalMemo ログディレクトリ Grep (scan-files (decode-escape-sequence (concat "^\*.*" let-index) t) "*.clm" (merge-pathnames ".calmemo/log" (user-config-path)) ) ;; 複数見つからなければ即表示 (unless (> (buffer-lines) 2) (first-error) (recenter 0) (other-window) ;; Grep バッファを閉じる (close-selected-buffer) ) ) ) ;; 元いたバッファを表示しているウィンドウへ (set-window (get-buffer-window let-buffer)) ) ) ) (global-set-key #\S-F1 'my-view-info-reference)