2008-11 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Emacs補完候補の選択を便利に - あどけない話
Emacs が提供する標準の Completion List を便利にする方法。以下の方法
を想定しているそうな。今までは 2 の後に補完候補をミニバッファにコピ
ペしていたので、これは結構良いかも。(・∀・)
1. TAB や M-TAB で補完の候補を表示
2. C-xo で補完の候補のバッファへ移動
3. C-f/C-b/C-n/C-p あるいは C-s/C-r で候補を選択
4. RET で候補を選ぶと、元々の状態に戻り、選んだ候補が挿入される
以下が該当のコード。~/.emacs に張り付けるだけ。n/p にも割り当ててみた。
(define-key completion-list-mode-map (kbd "n") 'next-completion) (define-key completion-list-mode-map (kbd "C-n") 'next-completion) (define-key completion-list-mode-map (kbd "C-f") 'next-completion) (define-key completion-list-mode-map (kbd "p") 'previous-completion) (define-key completion-list-mode-map (kbd "C-p") 'previous-completion) (define-key completion-list-mode-map (kbd "C-b") 'previous-completion) (define-key completion-list-mode-map (kbd "C-m") 'my-choose-completion) (defun my-choose-completion () "Choose the completion that point is in or next to." (interactive) (let (beg end completion (buffer completion-reference-buffer) (base-size completion-base-size)) (if (and (not (eobp)) (get-text-property (point) 'mouse-face)) (setq end (point) beg (1+ (point)))) (if (and (not (bobp)) (get-text-property (1- (point)) 'mouse-face)) (setq end (1- (point)) beg (point))) (if (null beg) (error "No completion here")) (setq beg (previous-single-property-change beg 'mouse-face)) (setq end (or (next-single-property-change end 'mouse-face) (point-max))) (setq completion (buffer-substring-no-properties beg end)) (delete-completion-window) (choose-completion-string completion buffer base-size)))
P.S.
Mew でのフォルダ名入力時の、C-s/C-r/TAB ももちろん使っています。:-)
PCオンラインの記事によると、米国サンノゼのISPが、ある迷惑メール送信
事業者のインターネット接続を遮断したところ、以降の迷惑メールの流通
量が75%も減ったそうである。
確かに、10/1 頃は 100 通は来てた迷惑メールが、最近は 60 通前後に減っ
ている。ホントだとしたら、なんという効果的な対応。w
(URL: http://slashdot.jp/it/article.pl?sid=08/11/17/0353221)
2008-11 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30