Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jplindstrom (594)

jplindstrom
  (email not shown publicly)

Journal of jplindstrom (594)

Sunday January 16, 2005
01:10 PM

Emacs: highlight changes

[ #22733 ]

The colleague who is my Emacs mentor found one very cool and potentially very useful feature yesterday: Highlight Changes. Instant color-coded diff of the changes you made since opening the file.

Put this in your .emacs file:

;; Hightlight Changes
 
; Turn it on for all opened files
(global-highlight-changes "passive")
 
; Toggle display Highlights
(global-set-key (kbd "\C-x \C-h h") 'highlight-changes-mode)                ; Highlight toggle
(global-set-key (kbd "\C-x \C-h r") 'highlight-changes-remove-highlight)    ; Remove colors in region
(global-set-key (kbd "\C-x \C-h c") 'highlight-changes-rotate-faces)        ; rotate Colors
 
(global-set-key (kbd "\C-x \C-h \C-n") 'highlight-changes-next-change)      ; Next change
(global-set-key (kbd "\C-x \C-h \C-p") 'highlight-changes-previous-change)  ; Previous change

and it will start tracking changes. It won't highlight the changes right away, that would just be annoying. But when you are curious about all the possible ways you screwed up the text, hit

C-h C-h h

and the changes gets highlighted. Or you can jump back and forth between the changed portions.

Yummy!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.