2017-06-10 17:48:18 +00:00
|
|
|
(defun buffer-changes-recorder (change-beg change-end prev-len)
|
2017-06-11 15:02:28 +00:00
|
|
|
;(append-to-file
|
|
|
|
(message
|
2017-06-10 17:48:18 +00:00
|
|
|
(format "%s;%s;%s\n"
|
|
|
|
(buffer-file-name)
|
|
|
|
(format-time-string "%s")
|
|
|
|
(if (> prev-len 0)
|
|
|
|
(format "D;%d;%d"
|
|
|
|
change-beg
|
|
|
|
(+ change-beg prev-len))
|
|
|
|
(format "A;%d;%s"
|
|
|
|
change-beg
|
|
|
|
(buffer-substring change-beg change-end))
|
|
|
|
)
|
|
|
|
)
|
2017-06-11 15:02:28 +00:00
|
|
|
; nil "~/test.log"
|
2017-06-10 17:48:18 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(add-hook 'after-change-functions 'buffer-changes-recorder)
|
2017-06-11 15:02:28 +00:00
|
|
|
|
|
|
|
(defun buffer-switchs-recorder ()
|
|
|
|
;(append-to-file
|
|
|
|
(message
|
|
|
|
(format "%s;%s;%s\n"
|
|
|
|
(buffer-file-name)
|
|
|
|
(format-time-string "%s")
|
|
|
|
(format "S;%s;%s" (selected-window) (buffer-name))
|
|
|
|
)
|
|
|
|
; nil "~/test.log"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(add-hook 'buffer-list-update-hook 'buffer-switchs-recorder)
|