Change Mode

ファイルの変更箇所をハイライトするモードです.

導入

  1. ここから切り貼りしてchange-mode.elを作成します.
  2. こんな設定を.emacsにしておきます.
    (autoload 'change-mode "change-mode"
      "Show changes in a distincive face" t)
    (autoload 'change-mode-next-change "change-mode" "\
    Move to the beginning of the next change, if minor-mode
    change-mode is in effect." t)
    (autoload 'change-mode-previous-change "change-mode" "\
    Move to the beginning of the previous change, if minor-mode
    change-mode is in effect." t)
    (autoload 'compare-with-file "change-mode"
    "Compare this saved buffer with a file,  showing differences
    in a distinctive face" t)
    (autoload 'change-mode-remove-change-face "change-mode" "\
    Remove the change face from the region.  This allows you to
    manually remove highlighting from uninteresting changes." t)
    (autoload (quote global-change-mode) "change-mode" "\
    Turn on or off global Change mode.\"
    `change-mode-global-modes'." t nil)
    ;;(global-set-key '[C-right] 'change-mode-next-change)
    ;;(global-set-key '[C-left]  'change-mode-previous-change)
    
    最後の2行をコメントを外すと, Ctl+カーソルキーで変更箇所を移動できるよ うになります. しかし逆に単語間移動が効かなくなるので, local-set-keyを 設定するほうが幸せになれるでしょう.

使い方

M-x change-modeでchange-modeになります. 変更箇所の色を消すにはリージョ ンを選択してからM-x change-mode-remove-change-faceとします. 全部消すに はC-x h M-x change-mode-remove-change-faceです.

M-x change-mode-rotate-coloursで色が変更されます.

参考