sdic-inline / ãã¤ã³ãä¸ã®åèªã®æå³ããããããã¡ã«è¡¨ç¤ºãã
ãµã¨ãFirefox ã® mouseover dictionary ã使ã£ã¦ãã¦ä¼¼ãæ©è½ã Emacs ã§ã使ããããªã¨æããä½ã£ã¦ã¿ã¾ããã
ãã¤ã³ãä¸ã«ããåèªã®æå³ãè¾æ¸ã§å¼ããæå³ãèªåã§ãããããã¡ã«è¡¨ç¤ºãã¾ãã
ã¤ã³ã¹ãã¼ã«
ãã¡ã¤ã«ã¯ãEmacsWiki ã«ç½®ãã¦ããã¾ããããã¦ã³ãã¼ãããload-path ã®éã£ããã£ã¬ã¯ããªã«ç½®ãã° OK ã§ãã
å¿ è¦ãªãã®ã¯ã以ä¸ã®éãã§ãã
- sdic
- sdic å½¢å¼ã«å¤æããè¾æ¸
- popup.el (popup 表示ã使ç¨ãããªãã°)
1. ã¯ãsdic ã®é¢æ°ã使ç¨ãã¦ããã®ã§ãç¡ããã°åãã¾ããã2. ã¯ãsdic ã使ã£ã¦ãããªãã°ãããã¨æãã®ã§åé¡ç¡ãã¨æãã¾ãã
è¾æ¸ã«ã¤ãã¦ã¯ãèªåã¯ãè±è¾éãè³¼å
¥ãã¦ä½¿ã£ã¦ãã¾ãããEDICT ã GENE ã§ã sdic å½¢å¼ã«å¤æããã°ä½¿ãã¾ãã
# sdic ã§ä½¿ããã®ã§å½ç¶ã¨è¨ãã°ãå½ç¶ã§ããã
3. ã¯ããã¤ã³ãä¸ã®åèªã®è©³ç´°ãªæå³ã表示ãããå ´åãpopup ã©ã¤ãã©ãªã使ã£ã¦è¡¨ç¤ºãã¦ããã®ã§ããã®æ©è½ã使ãããå ´åãå¿
è¦ã§ãã
åºæ¬çãªæ©è½ã«ã¤ãã¦ã¯ãç¡ãã¦ãåãã¾ãã
è¨å®
以ä¸ã®ãããªè¨å®ã .emacs ã«å ããã°è¯ãã§ãã
è¾æ¸ãã¡ã¤ã«ã®ä½ç½®ã«ã¤ãã¦ã¯ãé©å®èªã¿æ¿ãã¦ä¸ããã
(require 'sdic-inline) (sdic-inline-mode t) ; sdic-inline ã¢ã¼ãã®èµ·å ;; è¾æ¸ãã¡ã¤ã«ã®è¨å® (setq sdic-inline-eiwa-dictionary "/home/khiker/lib/dict/eijirou.sdic") (setq sdic-inline-waei-dictionary "/home/khiker/lib/dict/waeijirou.sdic")
è¾æ¸ãã¡ã¤ã«ã®ã¨ã³ã³ã¼ãã£ã³ã°ã«ã¤ãã¦ã¯ã`sdic-inline-dictionary-encoding' å¤æ°ã«æå®ãã¦ä¸ããã
ããã©ã«ãã®å¤ã¯ãeuc-jp ã§ãã
åä½
sdic-inline-mode ããªã³ã§ããã¨ããã¤ã³ãä¸ã«ããåèªãè¾æ¸ã§èªåã§ã²ããçµæããããããã¡ã«è¡¨ç¤ºãã¾ãã
0.3 以ä¸ã§ããã°ããªã¼ã¸ã§ã³é¸æãããå ´åãè¾æ¸ã§ã²ãåèªã¯ããªã¼ã¸ã§ã³ã§é¸æãããç¯å²ã®ãã®ã¨ããããã«ãã¦ãã¾ãã
# ãªã¼ã¸ã§ã³é¸æã«ãã表示ãæå¹ã¨ããå ´åãtransient-mark-mode ããªã³ã§ããå¿
è¦ãããã¾ãã
ç¾ç¶ã§ã¯ã以ä¸ã®ã¢ã¼ãããã¡ã¤ã«ãããã¹ãããããã£ä¸ã§åãã¾ãã
- ã¡ã¸ã£ã¼ã¢ã¼ãããtext-mode outline-mode fundamental-mode ã®ããããã®å ´åã
- ã«ã¼ã½ã«ä¸ã®åèªã®ããã¹ãããããã£ããfont-lock-string-face ã font-lock-comment-face ã®ããããã®å ´åã
ã¤ã¾ããããã°ã©ã ã«ãããã³ã¡ã³ãããæååä¸ã®å ´åã - é²è¦§ãã¦ãããããã¡ã®ãã¡ã¤ã«ã®æ¡å¼µåãã.txt ã®å ´åã
ããããç¡å¹ãåä½ããã¢ã¼ãã®è¿½å çããå ´åã¯ã以ä¸ã®å¤æ°ãç·¨éãã¦ä¸ããã
;; sdic-inline ãæå¹ã¨ããã¡ã¸ã£ã¼ã¢ã¼ããåãããªã¹ãã sdic-inline-enable-modes ;; sdic-inline ãæå¹ã¨ããããã¹ãããããã£ãåãããªã¹ãã sdic-inline-enable-faces ;; 以ä¸ã«è¨å®ãããæ£è¦è¡¨ç¾ã¨ãã¡ã¤ã«åããããããå ´åãsdic-inline ãæå¹ã¨ããã sdic-inline-enable-filename-regex ;; ãã®å¤æ°ã«æå®ãããé¢æ°ã®å®è¡çµæã t ãè¿ãå ´åãsdic-inline ãæå¹ã¨ããã sdic-inline-enable-func
ã¾ããåèªä¸ã§ãC-cC-p ãæ¼ãäºã§ãpopup ã©ã¤ãã©ãªãæå¹ãªãã°ãåèªã®è©³ç´°ãªæå³ã表示ããäºãã§ãã¾ãã
ãã¼ãã¤ã³ãã¯ãsdic-inline-map ã«è¨å®ãã¦ããã¾ãã®ã§ãæ°ã«å
¥ããªãå ´åãé©å®å¤æ´ãããªããã¦ä¸ããã
;; http://github.com/m2ym/auto-complete (require 'popup) ;; ãã¼å²ãå½ã¦ã®å¤æ´ ;; C-cC-p ãç¡å¹å (define-key sdic-inline-map "\C-c\C-p" 'nil) ;; C-cC-d ã«ãããã㦠sdic-inline-display-popup ãå²ãå½ã¦ (define-key sdic-inline-map "\C-c\C-d" 'sdic-inline-display-popup)
ã«ã¹ã¿ãã¤ãº
sdic-inline ãåä½ãããã¢ã¼ãçã®ç·¨éã¯ãä¾ãã°ã以ä¸ã®ããã«è¡ãã¾ãã
(setq sdic-inline-enable-modes nil) ; major-mode ãåºæºã«ãªã³ã»ãªããå¤æããªãããã (add-to-list 'sdic-inline-enable-modes 'w3m-mode) ; w3m-mode ã§ãåä½ããããã«ããã (setq sdic-inline-enable-faces nil) ; ããã¹ããããã£ãåºæºã«ãªã³ã»ãªããå¤æããªãããã (add-to-list 'sdic-inline-enable-faces 'font-lock-doc-face) ; ããã¹ãããããã£ã font-lock-doc-face ã§ããæåä¸ã§ããªã³ã¨ããã
ã¾ãã0.3 以ä¸ã§ã¯ããã¤ã³ãä¸ã®åèªãè¾æ¸ã§ã²ãé »åº¦ãå¶å¾¡ã§ããããã«ãã¾ããã
å
ã
ã¯ã`sdic-inline-delay' ã«æå®ããç§æ°æ¯ã«ããã¤ã³ãä¸ã®åèªãè¾æ¸ã§ã²ãããã«ãã¦ããã®ã§ããã
ãã¾ãã«ãé »ç¹ã§ãã£ã¨ãããã£ãã®ã§é »åº¦ãæ¸ããããã«ãã¾ããã
å
·ä½çã«ã¯ãååè¾æ¸ãã²ããã¨ãã¨åããã¤ã³ãä½ç½®ã§ãããªãã°ãè¾æ¸ã¯ã²ããªãã¨ãã風ã«ãã¾ããã
ãã®æ©è½ã¯ã以ä¸ã®å¤æ°ã§å¶å¾¡ã§ãã¾ãã
(setq sdic-inline-not-search-style 'point) ; ããã©ã«ãå¤ããã¤ã³ãä½ç½®ãååã¨åãã§ããéããå度è¾æ¸ã§ã¯ã²ããªãã (setq sdic-inline-not-search-style 'word) ; ã«ã¼ã½ã«ä¸ã®åèªãååè¾æ¸ã§å¼ããåèªã¨åãã§ããéããå度è¾æ¸ã§ã¯ã²ããªãã (setq sdic-inline-not-search-style 't) ; sdic-inline-delay ã«å®ããããç§æ°æ¯ã«ãã¤ã³ãä¸ã®åèªãè¾æ¸ã§ã²ãã
# å¤æ°ã®ååããããªã(åããã¥ãã)æ°ããã¾ãããè¯ãååãæãæµ®ãã°ãªãã£ãã®ã§â¦ã
åèªã®éå»å½¢ãæ´»ç¨ãé¤å»ãããã®ã§æ¤ç´¢ãèªåçã«è¡ãããã«ããããªãã°ã以ä¸ã®ããã«å¤æ°ãè¨å®ãã¾ãã
# ä¾ãã°ãenabled ã¨ããåèªããã¤ã³ãä¸ã«ãã£ããªãã°ãenable ã§æ¤ç´¢ããã
(setq sdic-inline-search-func 'sdic-inline-search-word-with-stem)
ããã¯ãsdic ã«ä»å±ãããstem.el ã使ã£ã¦å®ç¾ãã¦ãã¾ãã
ãã ããä¾ãã°ããenabledãã¨ããåèªã stem.el ã«æ¸¡ãã¨ãenablãããenableãããenabledãã¨ãã3ã¤ã®åè£ãè¿ããã¾ãã
ç¾ç¶ã§ã¯ãå
¨ã¦ã®åè£ã«å¯¾ãã¦æ¤ç´¢ãè¡ããå¾ãããçµæãå
¨ã¦è¡¨ç¤ºããããã«ãã¦ãã¾ãã
ãã®ããããããããããä½ãã®åèªã§ã¯ãåè£ã表示ããããã¦ãã¾ãããããããã¡ã大ãããªãããã¦è¦è¾ãã¨ããäºãèµ·ããããããã¾ããã
ãã®æ©è½ã¯ã0.4 ããå®è£
ãã¾ããã
# ãã°ãã使ç¨ãã¦ã¿ã¦ãåé¡ãç¡ãããã§ããã°ããã®æåãããã©ã«ãã¸ã¨å¤æ´ããããããã¾ããããã ãããã¨ãã¦ããã¤ã«ãªããããããªãã§ãã(^^;) (2010/03/06)
ã¾ãããã¤ã³ãä¸ã®åèªã®ä¸è´ã¯ããstudent ãã®ããã«åèªã®å¾ã«ç©ºç½ããã£ã¦ããã®ç©ºç½ã®ä¸ã«ãã¤ã³ã(ã«ã¼ã½ã«)ããã£ãå ´åã§ãããããã¾ãã
ããã¯ãsdic-inline ã current-word ã§ãã¤ã³ãä¸ã«åèªããããã©ããããã§ãã¯ãã¦ããããã§ãã
# å®éè¾æ¸ã¨ãããããèªå¥ãåå¾ããã®ã¯ãsdic-word-at-point ã¨ãã sdic ã«ããé¢æ°ã使ã£ã¦ãã¾ã
# current-word ã§ãã¤ã³ãä¸ã«åèªããããã©ããããã§ãã¯ãã¦ããçç±ã¯ãsdic-word-at-point ã ã¨ãã¤ã³ããã©ã®å ´æã«ãã£ã¦ãã
# 確å®ã«ä½ããã®èªå¥ãè¿ããããããããã¦ãã¾ãããã§ãã
ãã®æå(åèªã®å¾ã«ç©ºç½ãããã¤ããã£ã¦ããããããã¨ããæå)ãããã¤ã³ãä¸ã«åèªãããå ´åã®ã¿ãããããã¨ãããå ´åã
以ä¸ã®ããã«å¤æ° sdic-inline-word-at-point-strict ã t ã¨ãã¾ãã
(setq sdic-inline-word-at-point-strict t)
ã¹ã¯ãªã¼ã³ã·ã§ãã
以ä¸ã®ããã«ãããããã¡ã«æå³ã表示ãã¾ãã
次ã®ããã«ãåèªä¸ã§ C-cC-p ãæ¼ãäºã§ãpopup ã©ã¤ãã©ãªãæå¹ãªãã°ãåèªã®è©³ç´°ãªæå³ã表示ãã¾ãã
# é常ãåèªã®æå³ããããããã¡1è¡ã«åã¾ãããã«ãæå³ãé·ãããå ´åã¯ã«ãããã¦ãã¾ãã
# 1åèª1è¡ã§ãè¤æ°åè£ãããå ´åããã®åè£åãããããã¡ã«è¡¨ç¤ºãã¾ãã
ã¾ããè¤æ°ã®åè£ãããå ´åãããã popup ã©ã¤ãã©ãªãæå¹ãªãã°ãpopup-cascade-menu ã使ç¨ãã¦ã©ã®ã±ã¼ã¹ã®æå³ã表示ããããé¸æãã
æçµçã«ãpopup-tip ã§è¡¨ç¤ºãã¾ãã
æ¡å¼µæ©è½
sdic-inline-pos-tip.el
URL:http://www.emacswiki.org/emacs/PosTip
Twitter ã® @iRi_E ããããæ¡å¼µæ©è½ãä½ã£ã¦ä¸ããã¾ããããã¤ã³ãä¸ã®åèªã®æå³ã«ã¤ãã¦ãtooltip ã使ã£ã¦è¡¨ç¤ºã§ãã¾ããããããã£ãè¯ãã§ãã
使ç¨ããã«ã¯ãpos-tip.el 㨠`sdic-inline-pos-tip.el ã®2ã¤ãå¿
è¦ã§ããããããã-nw ãªç°å¢ã§ã¯ä½¿ç¨ã§ããªãã¨æããã¾ãã (追è¨) 0.0.2 ãã -nw ãªç°å¢ã§ã¯ãããããã¡ã«è¡¨ç¤ºããããã«ä¿®æ£ãããã¦ãåãããã«ãªã£ãã½ã§ãã
EmacsWiki ãããããããã¦ã³ãã¼ããã`load-path' ã®éã£ããã£ã¬ã¯ããªã«ç½®ãã¾ãã
ããã¦ã.emacs ã«ä»¥ä¸ã®è¨å®ã追è¨ãã¾ãã
(require 'sdic-inline-pos-tip) (setq sdic-inline-search-func 'sdic-inline-search-word-with-stem) (setq sdic-inline-display-func 'sdic-inline-pos-tip-show) (define-key sdic-inline-map "\C-c\C-p" 'sdic-inline-pos-tip-show)
ãªã¼ã¸ã§ã³é¸æããå ´åã®ã¿ãtooltip ã«è¡¨ç¤ºãã
é常ã®èªå表示ã§ã¯ããããããã¡ã«è¡¨ç¤ºããããªã¼ã¸ã§ã³é¸æãããå ´åã®ã¿ tooltip (pos-tip-show) ã§è¡¨ç¤ºãè¡ãã¾ãã
以ä¸ã®è¨å®ã追è¨ãã¦ä¸ãããpos-tip.el 㨠sdic-inline-pos-tip.el ã®é¢æ°ã使ç¨ãã¦ããã®ã§ãããã両è
ãå¿
è¦ã§ãã
(require 'sdic-inline-pos-tip) (defun sdic-inline-pos-tip-show-when-region-selected (entry) (cond ((and transient-mark-mode mark-active) (funcall 'sdic-inline-pos-tip-show entry)) (t (funcall 'sdic-inline-display-minibuffer entry)))) (setq sdic-inline-search-func 'sdic-inline-search-word-with-stem) (setq sdic-inline-display-func 'sdic-inline-pos-tip-show-when-region-selected) (define-key sdic-inline-map "\C-c\C-p" 'sdic-inline-pos-tip-show)
ãã®ä»
ä½ãæ©è½ã«ã¤ãã¦è¦æãããã°ããã£ããªãã°ãæãã¦é ããã¨å¹¸ãã§ãã
ããã§ã¯ã
æ´æ°å±¥æ´
0.4.5
- å¤æ° sdic-inline-word-at-point-strict ã追å ããã
- åèªããã¤ã³ãä¸(ãã¤ã³ãç´å¾ãå«ã)ã«ããå ´åã®ã¿æå³ã表示ããã
0.4.4
- 空è¡ç㧠sdic-inline ãã¨ã©ã¼ãåºãã¦ããã®ãæå¶ããã
- ãã¼ãããã®è¨å®ãä¿®æ£ããã
0.4.3
- ãããããã¡ã«æå³ã表示ããå ´åãä»ã¾ã§ã¯æå³ãã表示ãã¦ããªãã£ããããã®æå³ã示ãåèªåã表示ããããã«ããã
0.4.2
- `sdic-inline-word-at-point` ã§ãããããèªå¥ãæ£è¦è¡¨ç¾ã«ããã \\w ã«ããããããã®ã®ã¿ã¨ããã
0.4.1
- `sdic-inline-search-word-with-stem' ã§åãåè£ã2ã¤éè¤ãã¦è¡¨ç¤ºãããäºãããåé¡ãä¿®æ£ããã
0.4
- å¤æ° `sdic-inline-search-func' ã追å ãããè¾æ¸æ¤ç´¢ãè¡ããentry ãè¿ãé¢æ°ãæå®ããã
- sdic.el ã«ä»å±ãã stem.el ãç¨ããéå»å½¢ãæ´»ç¨ãåãé¤ããèªå¥ã§ãè¾æ¸æ¤ç´¢ãããã® entry ãè¿ãé¢æ° `sdic-inline-search-word-with-stem' ã追å ããã
0.3
- å¤æ° `sdic-inline-not-search-style' ã®è¿½å ããã¤ã³ãä¸ã®åèªãè¾æ¸ã§æ¤ç´¢ããé »åº¦ãå¶å¾¡ã§ããããã«ããã
- å¤æ° `sdic-inline-get-word-func' ã®è¿½å ãåèªãåå¾ããé¢æ°ãæå®ã§ããããã«ããã
- ãªã¼ã¸ã§ã³é¸æãããå ´åãè¾æ¸ã§ã²ãåèªã¯ããªã¼ã¸ã§ã³é¸æããã¦ããç¯å²ã¨ããããã«ããã
ãªã³ã¯
æ´æ°æå»
- 2010/03/03/23:50
- 2010/03/04/00:59
- 2010/03/04/08:30 / ã¡ãã£ã¨ã¡ã£ã¡ããªãã°ãã¿ã¤ããã®ã§ä¿®æ£ãâ 0.2.1 ã¸ã
- 2010/03/06/01:00 / æ©è½æ´æ°ãããã°ã¸è¿½è¨ãâ 0.3 ã¸ã
- 2010/03/06/02:10 / æ©è½æ´æ°ãããã°ã¸è¿½è¨ãâ 0.4 ã¸ã
- 2010/03/06/02:30 / ãã°ä¿®æ£ã`sdic-inline-search-word-with-stem' ã§åãåè£ã2ã¤éè¤ãã¦è¡¨ç¤ºãããäºãããåé¡ãä¿®æ£ãâ 0.4.1 ã¸ã
- 2010/03/07/19:15 / @iRi_E ããä½ã® sdic-inline-pos-tip.el ã追è¨ã
- 2010/03/08/18:20 / sdic-inline-pos-tip.el ã -nw ã§åãããã«ãªã£ãæ¨ã追è¨ã
- 2010/03/23/00:45 / ã¡ãã£ã¨ããæ©è½ä¿®æ£ãâ 0.4.2 ã¸ã
- 2010/03/28/01:05 / ã¡ãã£ã¨ããæ©è½ä¿®æ£ãâ 0.4.3 ã¸ã
- 2010/05/06/23:12 / ãã°ä¿®æ£ â 0.4.4 ã¸ã
- 2010/05/07/02:26 / æ©è½è¿½å â 0.4.5 ã¸ã